Package com.github.javaparser.metamodel
Class BaseNodeMetaModel
- java.lang.Object
-
- com.github.javaparser.metamodel.BaseNodeMetaModel
-
- Direct Known Subclasses:
NodeMetaModel
public abstract class BaseNodeMetaModel extends Object
Meta-data about all classes in the AST. These are all Nodes, except NodeList.
-
-
Constructor Summary
Constructors Constructor Description BaseNodeMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel, Class<? extends Node> type, String name, String packageName, boolean isAbstract, boolean hasWildcard)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Nodeconstruct(Map<String,Object> parameters)Creates a new node of this type.booleanequals(Object o)List<PropertyMetaModel>getAllPropertyMetaModels()List<PropertyMetaModel>getConstructorParameters()List<PropertyMetaModel>getDeclaredPropertyMetaModels()List<PropertyMetaModel>getDerivedPropertyMetaModels()StringgetMetaModelFieldName()The name of the field in JavaParserMetaModel for this node meta model.StringgetPackageName()StringgetQualifiedClassName()Optional<BaseNodeMetaModel>getSuperNodeMetaModel()Class<? extends Node>getType()StringgetTypeName()StringgetTypeNameGenerified()inthashCode()booleanhasWildcard()booleanis(Class<? extends Node> c)booleanisAbstract()booleanisInstanceOfMetaModel(BaseNodeMetaModel baseMetaModel)booleanisRootNode()StringtoString()
-
-
-
Method Detail
-
getQualifiedClassName
public String getQualifiedClassName()
- Returns:
- package name + class name
-
getSuperNodeMetaModel
public Optional<BaseNodeMetaModel> getSuperNodeMetaModel()
- Returns:
- the meta model for the node that this node extends. Note that this is to be used to find properties defined in superclasses of a Node.
-
getDeclaredPropertyMetaModels
public List<PropertyMetaModel> getDeclaredPropertyMetaModels()
- Returns:
- a list of all properties declared directly in this node (not its parent nodes.) These are also available as fields.
-
getDerivedPropertyMetaModels
public List<PropertyMetaModel> getDerivedPropertyMetaModels()
-
getConstructorParameters
public List<PropertyMetaModel> getConstructorParameters()
- Returns:
- a list of all properties that describe the parameters to the all-fields (but not "range" and "comment") constructor, in the order of appearance in the constructor parameter list.
-
getAllPropertyMetaModels
public List<PropertyMetaModel> getAllPropertyMetaModels()
- Returns:
- a list of all properties in this node and its parents. Note that a new list is created every time this method is called.
-
isInstanceOfMetaModel
public boolean isInstanceOfMetaModel(BaseNodeMetaModel baseMetaModel)
-
getPackageName
public String getPackageName()
- Returns:
- the package containing this AST node class.
-
isAbstract
public boolean isAbstract()
- Returns:
- whether this AST node is abstract.
-
hasWildcard
public boolean hasWildcard()
- Returns:
- whether this AST node has a <?> at the end of its type.
-
isRootNode
public boolean isRootNode()
- Returns:
- whether this AST node is the root node, meaning that it is the meta model for "Node": "NodeMetaModel".
-
getTypeNameGenerified
public String getTypeNameGenerified()
- Returns:
- the type name, with generics.
-
getTypeName
public String getTypeName()
- Returns:
- the raw type name, so nothing but the name.
-
getMetaModelFieldName
public String getMetaModelFieldName()
The name of the field in JavaParserMetaModel for this node meta model.
-
-