Package org.codehaus.modello.model
Class BaseElement
java.lang.Object
org.codehaus.modello.model.BaseElement
- Direct Known Subclasses:
CodeSegment,Model,ModelField,ModelType
This is the base class for all elements of the model. The name attribute is immutable because it's used as the key.
- Author:
- Jason van Zyl, Trygve Laugstøl, Emmanuel Venisse
-
Constructor Summary
ConstructorsConstructorDescriptionBaseElement(boolean nameRequired) BaseElement(boolean nameRequired, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMetadata(Metadata metadata) booleanprotected <T extends Metadata>
TgetMetadata(Class<T> type, String key) getName()inthashCode()booleanhasMetadata(String key) protected booleanvoidsetAnnotations(List<String> annotations) voidsetComment(String comment) voidsetDeprecatedVersion(Version deprecatedVersion) voidsetDescription(String description) voidvoidsetVersionRange(VersionRange versionRange) final voidvalidate()abstract voidprotected voidvalidateFieldNotEmpty(String objectName, String fieldName, String value)
-
Constructor Details
-
BaseElement
public BaseElement(boolean nameRequired) -
BaseElement
-
-
Method Details
-
validateElement
- Throws:
ModelValidationException
-
getName
-
setName
-
getDescription
-
setDescription
-
getVersionRange
-
setVersionRange
-
setDeprecatedVersion
-
getDeprecatedVersion
-
getComment
-
setComment
-
hasMetadata
-
addMetadata
-
getMetadata
-
validateFieldNotEmpty
protected void validateFieldNotEmpty(String objectName, String fieldName, String value) throws ModelValidationException - Throws:
ModelValidationException
-
validate
- Throws:
ModelValidationException
-
isEmpty
-
equals
-
hashCode
public int hashCode() -
getAnnotations
- Returns:
- the annotations
-
setAnnotations
- Parameters:
annotations- the annotations to set
-