public class PropertyDeclaration extends Object implements MemberDeclaration
Modifier | Constructor and Description |
---|---|
protected |
PropertyDeclaration(ModelSymbol owner,
AstNode originalAst,
AstSimpleName name,
Type type,
AstDescription description,
List<? extends AstAttribute> attributes)
Creates and returns a new instance.
|
Modifier and Type | Method and Description |
---|---|
List<AstAttribute> |
getAttributes()
Returns the attached attributes of this element.
|
AstDescription |
getDescription()
Returns the description of this element.
|
AstSimpleName |
getName()
Returns the name of this declared element.
|
AstNode |
getOriginalAst()
Returns the corresponded syntactic element of this.
|
ModelSymbol |
getOwner()
Returns owner of this member.
|
PropertySymbol |
getSymbol()
Returns the symbol refer to this declaration.
|
<T extends Trait<T>> |
getTrait(Class<T> kind)
Returns the specified trait of this declaration.
|
Type |
getType()
Returns the type of this property.
|
<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 PropertyDeclaration(ModelSymbol owner, AstNode originalAst, AstSimpleName name, Type type, AstDescription description, List<? extends AstAttribute> attributes)
owner
- the owner symboloriginalAst
- the original AST, or null
if this is an ad-hoc elementname
- the name of this propertytype
- the type of this propertydescription
- the description of this property, or null
if unknownattributes
- the attributes of this propertyIllegalArgumentException
- if some parameters were null
public AstNode getOriginalAst()
Element
getOriginalAst
in interface Element
null
if unknownpublic AstSimpleName getName()
Declaration
getName
in interface Declaration
public Type getType()
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 ModelSymbol getOwner()
MemberDeclaration
getOwner
in interface MemberDeclaration
public PropertySymbol getSymbol()
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.