T
- the type of target model kindpublic class AstModelDefinition<T extends AstTerm<T>> extends AbstractAstNode
AstNode.AbstractVisitor<C,R>, AstNode.Visitor<C,R>
Modifier and Type | Field and Description |
---|---|
List<AstAttribute> |
attributes
The attributes of the defining model.
|
AstDescription |
description
The description of the defining model, or
null . |
AstExpression<T> |
expression
The model structure of this definition.
|
ModelDefinitionKind |
kind
The kind of the defining model.
|
AstSimpleName |
name
The name of the defining model.
|
Constructor and Description |
---|
AstModelDefinition(Region region,
ModelDefinitionKind kind,
AstDescription description,
List<AstAttribute> attributes,
AstSimpleName name,
AstExpression<T> expression)
Creates and returns a new instance.
|
Modifier and Type | Method and Description |
---|---|
<C,R> R |
accept(C context,
AstNode.Visitor<C,R> visitor)
Accepts and calls back the visitor.
|
AstModelDefinition<AstJoin> |
asJoined()
Safely casts this definition as a joined model definition.
|
AstModelDefinition<AstRecord> |
asProjective()
Safely casts this definition as a projective model definition.
|
AstModelDefinition<AstRecord> |
asRecord()
Safely casts this definition as a record model definition.
|
AstModelDefinition<AstSummarize> |
asSummarized()
Safely casts this definition as a summarized model definition.
|
boolean |
equals(Object obj) |
Region |
getRegion()
Returns the region of this node.
|
int |
hashCode() |
public final ModelDefinitionKind kind
public final AstDescription description
null
.public final List<AstAttribute> attributes
public final AstSimpleName name
public final AstExpression<T extends AstTerm<T>> expression
public AstModelDefinition(Region region, ModelDefinitionKind kind, AstDescription description, List<AstAttribute> attributes, AstSimpleName name, AstExpression<T> expression)
region
- the region of this node on the enclosing script, or null
if unknownkind
- the kind of this definitiondescription
- the description of this model, or null
if is omittedattributes
- the attributes of this modelname
- the nameexpression
- the model structure of this definitionIllegalArgumentException
- if some parameters were null
public AstModelDefinition<AstRecord> asRecord()
IllegalStateException
- if this is not a record model definitionpublic AstModelDefinition<AstRecord> asProjective()
IllegalStateException
- if this is not a projective model definitionpublic AstModelDefinition<AstJoin> asJoined()
IllegalStateException
- if this is not a joined model definitionpublic AstModelDefinition<AstSummarize> asSummarized()
IllegalStateException
- if this is not a summarized model definitionpublic Region getRegion()
AstNode
null
if unknownpublic <C,R> R accept(C context, AstNode.Visitor<C,R> visitor)
AstNode
C
- type of visitor contextR
- type of visitor resultcontext
- the visitor contextvisitor
- the visitor to call backCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.