public class ModelDeclaration extends Object implements Declaration
Modifier | Constructor and Description |
---|---|
protected |
ModelDeclaration(DmdlSemantics owner,
AstModelDefinition<?> originalAst,
AstSimpleName name,
AstDescription description,
List<? extends AstAttribute> attributes)
Creates and returns a new instance.
|
Modifier and Type | Method and Description |
---|---|
PropertySymbol |
createPropertySymbol(AstSimpleName propertyName)
Creates and returns a new property symbol in this model.
|
PropertyDeclaration |
declareProperty(AstNode propertyOriginalAst,
AstSimpleName propertyName,
Type propertyType,
AstDescription propertyDescription,
List<? extends AstAttribute> propertyAttributes)
Declares a new property into this model.
|
PropertyReferenceDeclaration |
declarePropertyReference(AstNode memberOriginalAst,
AstSimpleName memberName,
Type referentType,
PropertyReferenceDeclaration.ReferenceContainer<?> references,
AstDescription memberDescription,
List<? extends AstAttribute> memberAttributes)
Declares a new property reference into this model.
|
MemberDeclaration |
findMemberDeclaration(String memberName)
Returns a declared member in this model.
|
PropertyDeclaration |
findPropertyDeclaration(String propertyName)
Returns a declared property in this model.
|
PropertyReferenceDeclaration |
findPropertyReferenceDeclaration(String propertyName)
Returns a declared property reference in this model.
|
List<AstAttribute> |
getAttributes()
Returns the attached attributes of this element.
|
List<MemberDeclaration> |
getDeclaredMembers()
Returns all declared members in this model.
|
List<PropertyDeclaration> |
getDeclaredProperties()
Returns all declared properties in this model.
|
List<PropertyReferenceDeclaration> |
getDeclaredPropertyReferences()
Returns all declared property references in this model.
|
AstDescription |
getDescription()
Returns the description of this element.
|
AstSimpleName |
getName()
Returns the name of this declared element.
|
AstModelDefinition<?> |
getOriginalAst()
Returns the corresponded syntactic element of this.
|
ModelSymbol |
getSymbol()
Returns the symbol refer to this declaration.
|
<T extends Trait<T>> |
getTrait(Class<T> kind)
Returns the specified trait of this declaration.
|
<T extends Trait<T>> |
putTrait(Class<T> kind,
T trait)
Puts a trait into this declaration.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findTrait
protected ModelDeclaration(DmdlSemantics owner, AstModelDefinition<?> originalAst, AstSimpleName name, AstDescription description, List<? extends AstAttribute> attributes)
owner
- the world contains this symboloriginalAst
- the original AST, or null
if this is an ad-hoc elementname
- the name of this modeldescription
- the description of this model, or null
if unknownattributes
- the attributes of this modelIllegalArgumentException
- if some parameters were null
public ModelSymbol getSymbol()
public AstModelDefinition<?> getOriginalAst()
Element
getOriginalAst
in interface Element
null
if unknownpublic AstSimpleName getName()
Declaration
getName
in interface Declaration
public AstDescription getDescription()
Declaration
getDescription
in interface Declaration
null
not defindpublic List<AstAttribute> getAttributes()
Declaration
If not attributes are attached, this returns an empty list.
getAttributes
in interface Declaration
public PropertyDeclaration declareProperty(AstNode propertyOriginalAst, AstSimpleName propertyName, Type propertyType, AstDescription propertyDescription, List<? extends AstAttribute> propertyAttributes)
propertyOriginalAst
- the original AST, or null
if this is an ad-hoc elementpropertyName
- the name of this propertypropertyType
- the type of this propertypropertyDescription
- the description of this property, or null
if unknownpropertyAttributes
- the attributes of this propertyIllegalArgumentException
- if some parameters were null
public PropertyReferenceDeclaration declarePropertyReference(AstNode memberOriginalAst, AstSimpleName memberName, Type referentType, PropertyReferenceDeclaration.ReferenceContainer<?> references, AstDescription memberDescription, List<? extends AstAttribute> memberAttributes)
memberOriginalAst
- the original AST, or null
if this is an ad-hoc elementmemberName
- the name of this memberreferentType
- the referent typereferences
- the referencesmemberDescription
- the description of this member, or null
if unknownmemberAttributes
- the attributes of this memberIllegalArgumentException
- if some parameters were null
public MemberDeclaration findMemberDeclaration(String memberName)
memberName
- the name of the membernull
if not declaredIllegalArgumentException
- if some parameters were null
public PropertyDeclaration findPropertyDeclaration(String propertyName)
propertyName
- the name of the propertynull
if not declaredIllegalArgumentException
- if some parameters were null
public PropertyReferenceDeclaration findPropertyReferenceDeclaration(String propertyName)
propertyName
- the name of the property referencenull
if not declaredIllegalArgumentException
- if some parameters were null
public List<MemberDeclaration> getDeclaredMembers()
public List<PropertyDeclaration> getDeclaredProperties()
public List<PropertyReferenceDeclaration> getDeclaredPropertyReferences()
public PropertySymbol createPropertySymbol(AstSimpleName propertyName)
propertyName
- the name of target propertyIllegalArgumentException
- if some parameters were null
public <T extends Trait<T>> T getTrait(Class<T> kind)
Declaration
getTrait
in interface Declaration
T
- type of traitkind
- the kind of traitnull
if not putpublic <T extends Trait<T>> void putTrait(Class<T> kind, T trait)
Declaration
putTrait
in interface Declaration
T
- type of traitkind
- the kind of traittrait
- the traits to put, or null
to removeCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.