Package org.codehaus.modello.model
Class ModelClass
- java.lang.Object
-
- org.codehaus.modello.model.BaseElement
-
- org.codehaus.modello.model.ModelType
-
- org.codehaus.modello.model.ModelClass
-
public class ModelClass extends ModelType
- Author:
- Jason van Zyl, Emmanuel Venisse
-
-
Constructor Summary
Constructors Constructor Description ModelClass()
ModelClass(Model model, String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addField(ModelField modelField)
void
addInterface(String modelInterface)
boolean
equals(Object o)
List<ModelField>
getAllFields()
Returns the list of all fields in this class.List<ModelField>
getAllFields(boolean withInheritedField)
Returns all the fields in this class and all super classes if withInheritedField equals to true.ModelField
getField(String type, VersionRange versionRange)
List<String>
getInterfaces()
Returns the list of all interfaces of this class.ClassMetadata
getMetadata(String key)
String
getSuperClass()
int
hashCode()
boolean
hasSuperClass()
void
initialize(Model model)
boolean
isInternalSuperClass()
void
setSuperClass(String superClass)
void
validateElement()
-
Methods inherited from class org.codehaus.modello.model.ModelType
addCodeSegment, getAllCodeSegments, getAllFields, getCodeSegments, getCodeSegments, getField, getFields, getIdentifierFields, getModel, getPackageName, getPackageName, hasField, setPackageName
-
Methods inherited from class org.codehaus.modello.model.BaseElement
addMetadata, getAnnotations, getComment, getDeprecatedVersion, getDescription, getMetadata, getName, getVersionRange, hasMetadata, isEmpty, setAnnotations, setComment, setDeprecatedVersion, setDescription, setName, setVersionRange, validate, validateFieldNotEmpty
-
-
-
-
Method Detail
-
getSuperClass
public String getSuperClass()
-
setSuperClass
public void setSuperClass(String superClass)
-
getInterfaces
public List<String> getInterfaces()
Returns the list of all interfaces of this class.- Returns:
- Returns the list of all interfaces of this class.
-
addInterface
public void addInterface(String modelInterface)
-
getAllFields
public List<ModelField> getAllFields()
Returns the list of all fields in this class. It does not include the fields of super classes.- Specified by:
getAllFields
in classModelType
- Returns:
- Returns the list of all fields in this class. It does not include the fields of super classes.
-
getAllFields
public List<ModelField> getAllFields(boolean withInheritedField)
Returns all the fields in this class and all super classes if withInheritedField equals to true.- Specified by:
getAllFields
in classModelType
- Parameters:
withInheritedField
- whether inherited fields should be included.- Returns:
- Returns all the fields in this class and all super classes.
-
getField
public ModelField getField(String type, VersionRange versionRange)
-
addField
public void addField(ModelField modelField)
-
hasSuperClass
public boolean hasSuperClass()
-
isInternalSuperClass
public boolean isInternalSuperClass()
-
getMetadata
public ClassMetadata getMetadata(String key)
-
initialize
public void initialize(Model model)
- Overrides:
initialize
in classModelType
-
validateElement
public void validateElement() throws ModelValidationException
- Specified by:
validateElement
in classBaseElement
- Throws:
ModelValidationException
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classBaseElement
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBaseElement
-
-