org.exolab.castor.builder
Class ClassInfo

java.lang.Object
  extended byorg.exolab.castor.builder.XMLInfo
      extended byorg.exolab.castor.builder.ClassInfo

public class ClassInfo
extends XMLInfo

This class holds the necessary information so that the source generator can properly create the necessary Classes for the Object model.

Version:
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:07:41 $
Author:
Keith Visco

Field Summary
 
Fields inherited from class org.exolab.castor.builder.XMLInfo
ATTRIBUTE_TYPE, ELEMENT_TYPE, TEXT_TYPE
 
Constructor Summary
ClassInfo(org.exolab.javasource.JClass jClass)
          Creates a new ClassInfo
 
Method Summary
 void addFieldInfo(FieldInfo fieldInfo)
          Adds the given FieldInfo to this ClassInfo
 void addFieldInfo(FieldInfo[] fields)
          Adds the given set of FieldInfos to this ClassInfo
 boolean allowContent()
           
 boolean contains(FieldInfo fieldInfo)
          Returns true if the given FieldInfo is contained within this ClassInfo
 FieldInfo getAttributeField(java.lang.String nodeName)
          Returns a fieldInfo that corresponds to an attribute with the given node name.
 FieldInfo[] getAttributeFields()
          Returns an array of XML attribute associated fields
 ClassInfo getBaseClass()
          Returns the base class of this classInfo if any.
 FieldInfo getElementField(java.lang.String nodeName)
          Returns a fieldInfo that corresponds to an element with the given node name.
 FieldInfo[] getElementFields()
          Returns an array of XML element associated fields
 int getFieldCount()
          Returns the number of FieldInfo definitions for this ClassInfo.
 GroupInfo getGroupInfo()
          Returns the GroupInfo for this ClassInfo
 org.exolab.javasource.JClass getJClass()
          Returns the JClass described by this ClassInfo
 FieldInfo getTextField()
          Returns the FieldInfo for the XML text associated field.
 boolean isAbstract()
           
 boolean isChoice()
          Returns true if the compositor of this GroupInfo is a choice
 boolean isContainer()
          Returns true if this ClassInfo describes a container class.
 boolean isSequence()
          Returns true if the compositor of this GroupInfo is a sequence
 void setAbstract(boolean abstractClass)
           
 void setBaseClass(ClassInfo base)
          Sets the base class of this classInfo.
 void setContainer(boolean isContainer)
          Sets whether or not this ClassInfo describes a container class.
 
Methods inherited from class org.exolab.castor.builder.XMLInfo
getNamespacePrefix, getNamespaceURI, getNodeName, getNodeType, getNodeTypeName, getSchemaType, isMultivalued, isRequired, setMultivalued, setNamespacePrefix, setNamespaceURI, setNodeName, setNodeType, setRequired, setSchemaType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassInfo

public ClassInfo(org.exolab.javasource.JClass jClass)
Creates a new ClassInfo

Parameters:
jClass - the JClass which this ClassInfo describes
Method Detail

addFieldInfo

public void addFieldInfo(FieldInfo fieldInfo)
Adds the given FieldInfo to this ClassInfo

Parameters:
fieldInfo - the FieldInfo to add

addFieldInfo

public void addFieldInfo(FieldInfo[] fields)
Adds the given set of FieldInfos to this ClassInfo

Parameters:
fields - an Array of FieldInfo objects

allowContent

public boolean allowContent()
Returns:
true if Classes created with this ClassInfo allow content

contains

public boolean contains(FieldInfo fieldInfo)
Returns true if the given FieldInfo is contained within this ClassInfo

Returns:
true if the given FieldInfo is contained within this ClassInfo

getAttributeFields

public FieldInfo[] getAttributeFields()
Returns an array of XML attribute associated fields

Returns:
an array of XML attribute associated fields

getAttributeField

public FieldInfo getAttributeField(java.lang.String nodeName)
Returns a fieldInfo that corresponds to an attribute with the given node name. A ClassInfo cannot have 2 attributes with the same xml name.

Parameters:
nodeName - the NodeName of the field to get.
Returns:
a fieldInfo that corresponds to an attribute with the given node name.

getBaseClass

public ClassInfo getBaseClass()
Returns the base class of this classInfo if any. A classInfo can indeed extend another classInfo to reflect the extension mechanism used in the XML Schema

Returns:
the base class of this classInfo if any.

getElementFields

public FieldInfo[] getElementFields()
Returns an array of XML element associated fields

Returns:
an array of XML element associated fields

getElementField

public FieldInfo getElementField(java.lang.String nodeName)
Returns a fieldInfo that corresponds to an element with the given node name. A ClassInfo cannot have 2 elements with the same xml name.

Parameters:
nodeName - the NodeName of the field to get.
Returns:
a fieldInfo that corresponds to an element with the given node name.

getFieldCount

public int getFieldCount()
Returns the number of FieldInfo definitions for this ClassInfo.

Returns:
the number of FieldInfo definitions for this ClassInfo.

getGroupInfo

public GroupInfo getGroupInfo()
Returns the GroupInfo for this ClassInfo

Returns:
the GroupInfo for this ClassInfo

getJClass

public org.exolab.javasource.JClass getJClass()
Returns the JClass described by this ClassInfo

Returns:
the JClass which is described by this ClassInfo

getTextField

public FieldInfo getTextField()
Returns the FieldInfo for the XML text associated field.

Returns:
the FieldInfo for the text content associated field, this may be null.

isAbstract

public boolean isAbstract()

isChoice

public boolean isChoice()
Returns true if the compositor of this GroupInfo is a choice

Returns:
true if the compositor of this GroupInfo is a choice

isContainer

public boolean isContainer()
Returns true if this ClassInfo describes a container class. A container class is a class which should not be marshalled as XML, but whose members should be.

Returns:
true if this ClassInfo describes a container class.

isSequence

public boolean isSequence()
Returns true if the compositor of this GroupInfo is a sequence

Returns:
true if the compositor of this GroupInfo is a sequence

setAbstract

public void setAbstract(boolean abstractClass)

setBaseClass

public void setBaseClass(ClassInfo base)
Sets the base class of this classInfo. A classInfo can indeed extend another classInfo to reflect the extension mechanism used in the XML Schema


setContainer

public void setContainer(boolean isContainer)
Sets whether or not this ClassInfo describes a container class. A container class is a class which should not be marshalled as XML, but whose members should be. By default this is false.

Parameters:
isContainer - the boolean value when true indicates this class should be a container class.


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com