org.codehaus.modello.model
Class ModelClass

java.lang.Object
  extended byorg.codehaus.modello.model.BaseElement
      extended byorg.codehaus.modello.model.ModelClass

public class ModelClass
extends BaseElement

Version:
$Id: ModelClass.java 430 2005-07-01 13:24:35Z trygvis $
Author:
Jason van Zyl, Emmanuel Venisse

Field Summary
private  java.util.Map codeSegmentMap
           
private  java.util.List codeSegments
           
private  java.util.Map fieldMap
           
private  java.util.List fields
           
private  java.util.List interfaces
           
private  Model model
           
private  java.lang.String packageName
           
private  java.lang.String superClass
           
 
Fields inherited from class org.codehaus.modello.model.BaseElement
 
Constructor Summary
ModelClass()
           
ModelClass(Model model, java.lang.String name)
           
 
Method Summary
 void addCodeSegment(CodeSegment codeSegment)
           
 void addField(ModelField modelField)
           
 void addInterface(java.lang.String modelInterface)
           
 boolean equals(java.lang.Object o)
           
 java.util.List getAllCodeSegments()
           
 java.util.List getAllFields()
          Returns the list of all fields in this class.
 java.util.List getAllFields(boolean withInheritedField)
          Returns all the fields in this class and all super classes if withInheritedField equals to true.
 java.util.List getAllFields(Version version, boolean withInheritedField)
           
 java.util.List getCodeSegments(Version version)
           
 java.util.List getCodeSegments(VersionRange versionRange)
           
 ModelField getField(java.lang.String type, Version version)
           
 ModelField getField(java.lang.String type, VersionRange versionRange)
           
 java.util.List getFields(Version version)
          Returns the list of all fields in this class for a specific version.
 java.util.List getIdentifierFields(Version version)
           
 java.util.List getInterfaces()
          Returns the list of all interfaces of this class.
 ClassMetadata getMetadata(java.lang.String key)
           
 Model getModel()
           
 java.lang.String getPackageName()
           
 java.lang.String getPackageName(boolean withVersion, Version version)
           
 java.lang.String getSuperClass()
           
 boolean hasField(java.lang.String type, Version version)
           
 int hashCode()
           
 boolean hasSuperClass()
           
 void initialize(Model model)
           
 void setPackageName(java.lang.String packageName)
           
 void setSuperClass(java.lang.String superClass)
           
 void validateElement()
           
 
Methods inherited from class org.codehaus.modello.model.BaseElement
addMetadata, getComment, getDeprecatedVersion, getDescription, getMetadata, getName, getVersionRange, hasMetadata, isEmpty, setComment, setDeprecatedVersion, setDescription, setName, setVersionRange, validate, validateFieldNotEmpty
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

superClass

private java.lang.String superClass

interfaces

private java.util.List interfaces

packageName

private java.lang.String packageName

fields

private java.util.List fields

codeSegments

private java.util.List codeSegments

model

private transient Model model

fieldMap

private transient java.util.Map fieldMap

codeSegmentMap

private transient java.util.Map codeSegmentMap
Constructor Detail

ModelClass

public ModelClass()

ModelClass

public ModelClass(Model model,
                  java.lang.String name)
Method Detail

getSuperClass

public java.lang.String getSuperClass()

setSuperClass

public void setSuperClass(java.lang.String superClass)

getModel

public Model getModel()

getInterfaces

public java.util.List getInterfaces()
Returns the list of all interfaces of this class.

Returns:
Returns the list of all interfaces of this class.

addInterface

public void addInterface(java.lang.String modelInterface)

getPackageName

public java.lang.String getPackageName()

getPackageName

public java.lang.String getPackageName(boolean withVersion,
                                       Version version)

setPackageName

public void setPackageName(java.lang.String packageName)

getAllFields

public java.util.List getAllFields()
Returns the list of all fields in this class. It does not include the fields of super classes.

Returns:
Returns the list of all fields in this class. It does not include the fields of super classes.

getAllFields

public java.util.List getAllFields(Version version,
                                   boolean withInheritedField)

getFields

public java.util.List getFields(Version version)
Returns the list of all fields in this class for a specific version. It does not include the fields of super classes.

Returns:
Returns the list of all fields in this class. It does not include the fields of super classes.

getAllFields

public java.util.List getAllFields(boolean withInheritedField)
Returns all the fields in this class and all super classes if withInheritedField equals to true.

Returns:
Returns all the fields in this class and all super classes.

hasField

public boolean hasField(java.lang.String type,
                        Version version)

getField

public ModelField getField(java.lang.String type,
                           Version version)

getField

public ModelField getField(java.lang.String type,
                           VersionRange versionRange)

addField

public void addField(ModelField modelField)

getIdentifierFields

public java.util.List getIdentifierFields(Version version)

getAllCodeSegments

public java.util.List getAllCodeSegments()

getCodeSegments

public java.util.List getCodeSegments(Version version)

getCodeSegments

public java.util.List getCodeSegments(VersionRange versionRange)

addCodeSegment

public void addCodeSegment(CodeSegment codeSegment)

hasSuperClass

public boolean hasSuperClass()

getMetadata

public ClassMetadata getMetadata(java.lang.String key)

initialize

public void initialize(Model model)

validateElement

public void validateElement()
                     throws ModelValidationException
Specified by:
validateElement in class BaseElement
Throws:
ModelValidationException

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class BaseElement

hashCode

public int hashCode()
Overrides:
hashCode in class BaseElement