org.codehaus.modello.model

Class ModelClass


public class ModelClass
extends BaseElement

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

Constructor Summary

ModelClass()
ModelClass(Model model, String name)

Method Summary

void
addCodeSegment(CodeSegment codeSegment)
void
addField(ModelField modelField)
void
addInterface(String modelInterface)
boolean
equals(Object o)
List
getAllCodeSegments()
List
getAllFields()
Returns the list of all fields in this class.
List
getAllFields(boolean withInheritedField)
Returns all the fields in this class and all super classes if withInheritedField equals to true.
List
getAllFields(Version version, boolean withInheritedField)
List
getCodeSegments(Version version)
List
getCodeSegments(VersionRange versionRange)
ModelField
getField(String type, Version version)
ModelField
getField(String type, VersionRange versionRange)
List
getFields(Version version)
Returns the list of all fields in this class for a specific version.
List
getIdentifierFields(Version version)
List
getInterfaces()
Returns the list of all interfaces of this class.
ClassMetadata
getMetadata(String key)
Model
getModel()
String
getPackageName()
String
getPackageName(boolean withVersion, Version version)
String
getSuperClass()
boolean
hasField(String type, Version version)
boolean
hasSuperClass()
int
hashCode()
void
initialize(Model model)
void
setPackageName(String packageName)
void
setSuperClass(String superClass)
void
validateElement()

Methods inherited from class org.codehaus.modello.model.BaseElement

addMetadata, equals, getComment, getDeprecatedVersion, getDescription, getMetadata, getName, getVersionRange, hasMetadata, hashCode, isEmpty, setComment, setDeprecatedVersion, setDescription, setName, setVersionRange, validate, validateElement, validateFieldNotEmpty

Constructor Details

ModelClass

public ModelClass()

ModelClass

public ModelClass(Model model,
                  String name)

Method Details

addCodeSegment

public void addCodeSegment(CodeSegment codeSegment)

addField

public void addField(ModelField modelField)

addInterface

public void addInterface(String modelInterface)

equals

public boolean equals(Object o)
Overrides:
equals in interface BaseElement

getAllCodeSegments

public List getAllCodeSegments()

getAllFields

public 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 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.

getAllFields

public List getAllFields(Version version,
                         boolean withInheritedField)

getCodeSegments

public List getCodeSegments(Version version)

getCodeSegments

public List getCodeSegments(VersionRange versionRange)

getField

public ModelField getField(String type,
                           Version version)

getField

public ModelField getField(String type,
                           VersionRange versionRange)

getFields

public 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.

getIdentifierFields

public List getIdentifierFields(Version version)

getInterfaces

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

getMetadata

public ClassMetadata getMetadata(String key)

getModel

public Model getModel()

getPackageName

public String getPackageName()

getPackageName

public String getPackageName(boolean withVersion,
                             Version version)

getSuperClass

public String getSuperClass()

hasField

public boolean hasField(String type,
                        Version version)

hasSuperClass

public boolean hasSuperClass()

hashCode

public int hashCode()
Overrides:
hashCode in interface BaseElement

initialize

public void initialize(Model model)

setPackageName

public void setPackageName(String packageName)

setSuperClass

public void setSuperClass(String superClass)

validateElement

public void validateElement()
            throws ModelValidationException
Overrides:
validateElement in interface BaseElement