Package org.codehaus.modello.model
Class ModelType
- java.lang.Object
-
- org.codehaus.modello.model.BaseElement
-
- org.codehaus.modello.model.ModelType
-
- Direct Known Subclasses:
ModelClass
,ModelInterface
public abstract class ModelType extends BaseElement
Either a model class or interface.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,CodeSegment>
codeSegmentMap
private java.util.List<CodeSegment>
codeSegments
private Model
model
private java.lang.String
packageName
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addCodeSegment(CodeSegment codeSegment)
java.util.List<CodeSegment>
getAllCodeSegments()
abstract java.util.List<ModelField>
getAllFields()
Returns the list of all fields in this class.abstract java.util.List<ModelField>
getAllFields(boolean withInheritedField)
Returns all the fields in this class and all super classes if withInheritedField equals to true.java.util.List<ModelField>
getAllFields(Version version, boolean withInheritedField)
java.util.List<CodeSegment>
getCodeSegments(Version version)
java.util.List<CodeSegment>
getCodeSegments(VersionRange versionRange)
ModelField
getField(java.lang.String type, Version version)
abstract ModelField
getField(java.lang.String type, VersionRange versionRange)
java.util.List<ModelField>
getFields(Version version)
Returns the list of all fields in this class for a specific version.java.util.List<ModelField>
getIdentifierFields(Version version)
Model
getModel()
java.lang.String
getPackageName()
java.lang.String
getPackageName(boolean withVersion, Version version)
boolean
hasField(java.lang.String type, Version version)
void
initialize(Model model)
void
setPackageName(java.lang.String packageName)
-
Methods inherited from class org.codehaus.modello.model.BaseElement
addMetadata, equals, getAnnotations, getComment, getDeprecatedVersion, getDescription, getMetadata, getName, getVersionRange, hashCode, hasMetadata, isEmpty, setAnnotations, setComment, setDeprecatedVersion, setDescription, setName, setVersionRange, validate, validateElement, validateFieldNotEmpty
-
-
-
-
Field Detail
-
packageName
private java.lang.String packageName
-
codeSegments
private java.util.List<CodeSegment> codeSegments
-
model
private transient Model model
-
codeSegmentMap
private transient java.util.Map<java.lang.String,CodeSegment> codeSegmentMap
-
-
Constructor Detail
-
ModelType
public ModelType()
-
ModelType
public ModelType(Model model, java.lang.String name)
-
-
Method Detail
-
getPackageName
public java.lang.String getPackageName()
-
getPackageName
public java.lang.String getPackageName(boolean withVersion, Version version)
-
setPackageName
public void setPackageName(java.lang.String packageName)
-
getModel
public Model getModel()
-
getAllCodeSegments
public java.util.List<CodeSegment> getAllCodeSegments()
-
getCodeSegments
public java.util.List<CodeSegment> getCodeSegments(Version version)
-
getCodeSegments
public java.util.List<CodeSegment> getCodeSegments(VersionRange versionRange)
-
addCodeSegment
public void addCodeSegment(CodeSegment codeSegment)
-
getAllFields
public abstract java.util.List<ModelField> 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 abstract java.util.List<ModelField> getAllFields(boolean withInheritedField)
Returns all the fields in this class and all super classes if withInheritedField equals to true.- Parameters:
withInheritedField
- whether inherited fields should be included.- Returns:
- Returns all the fields in this class and all super classes.
-
getField
public abstract ModelField getField(java.lang.String type, VersionRange versionRange)
-
getFields
public java.util.List<ModelField> 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.- Parameters:
version
- the specific version- Returns:
- Returns the list of all fields in this class. It does not include the fields of super classes.
-
getAllFields
public java.util.List<ModelField> getAllFields(Version version, boolean withInheritedField)
-
hasField
public boolean hasField(java.lang.String type, Version version)
-
getField
public ModelField getField(java.lang.String type, Version version)
-
getIdentifierFields
public java.util.List<ModelField> getIdentifierFields(Version version)
-
initialize
public void initialize(Model model)
-
-