Top Description Fields Constructors Methods
com.github.javaparser.metamodel

public abstract Class BaseNodeMetaModel

extends Object
Class Inheritance
Known Direct Subclasses
com.github.javaparser.metamodel.NodeMetaModel
Imports
com.github.javaparser.ast.AllFieldsConstructor, .Node, .NodeList, java.lang.reflect.Constructor, .InvocationTargetException, java.util.*

Meta-data about all classes in the AST. These are all Nodes, except NodeList.

Field Summary

Modifier and TypeField and Description
private final List<PropertyMetaModel>
private final List<PropertyMetaModel>
private final List<PropertyMetaModel>
private final boolean
private final boolean
private final String
private final String
private final Optional<BaseNodeMetaModel>
private final Class<? extends Node>

Constructor Summary

AccessConstructor and Description
public
BaseNodeMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel, Class<? extends Node> type, String name, String packageName, boolean isAbstract, boolean hasWildcard)

Method Summary

Modifier and TypeMethod and Description
public Node
construct(Map<String, Object>
a map of propertyName -> value. This should at least contain a pair for every required property for this node.
parameters
)

Creates a new node of this type.

public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public List<PropertyMetaModel>

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.
getAllPropertyMetaModels
()

public List<PropertyMetaModel>

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.
getConstructorParameters
()

public List<PropertyMetaModel>

Returns:

a list of all properties declared directly in this node (not its parent nodes.) These are also available as fields.
getDeclaredPropertyMetaModels
()

public List<PropertyMetaModel>
public String
getMetaModelFieldName()

The name of the field in JavaParserMetaModel for this node meta model.

public String

Returns:

the package containing this AST node class.
getPackageName
()

public String

Returns:

package name + class name
getQualifiedClassName
()

public Optional<BaseNodeMetaModel>

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.
getSuperNodeMetaModel
()

public Class<? extends Node>

Returns:

the class for this AST node type.
getType
()

public String

Returns:

the raw type name, so nothing but the name.
getTypeName
()

public String

Returns:

the type name, with generics.
getTypeNameGenerified
()

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.
public boolean

Returns:

whether this AST node has a <?> at the end of its type.
hasWildcard
()

public boolean

Returns:

is this the meta model for this node class?
is
(Class<? extends Node> c)

public boolean

Returns:

whether this AST node is abstract.
isAbstract
()

public boolean
public boolean

Returns:

whether this AST node is the root node, meaning that it is the meta model for "Node": "NodeMetaModel".
isRootNode
()

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

constructorParametersback to summary
private final List<PropertyMetaModel> constructorParameters
declaredPropertyMetaModelsback to summary
private final List<PropertyMetaModel> declaredPropertyMetaModels
derivedPropertyMetaModelsback to summary
private final List<PropertyMetaModel> derivedPropertyMetaModels
hasWildcardback to summary
private final boolean hasWildcard
isAbstractback to summary
private final boolean isAbstract
nameback to summary
private final String name
packageNameback to summary
private final String packageName
superNodeMetaModelback to summary
private final Optional<BaseNodeMetaModel> superNodeMetaModel
typeback to summary
private final Class<? extends Node> type

Constructor Detail

BaseNodeMetaModelback to summary
public BaseNodeMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel, Class<? extends Node> type, String name, String packageName, boolean isAbstract, boolean hasWildcard)

Method Detail

constructback to summary
public Node construct(Map<String, Object> parameters)

Creates a new node of this type.

Parameters
parameters:Map<String, Object>

a map of propertyName -> value. This should at least contain a pair for every required property for this node.

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getAllPropertyMetaModelsback to summary
public List<PropertyMetaModel> getAllPropertyMetaModels()
Returns:List<PropertyMetaModel>

a list of all properties in this node and its parents. Note that a new list is created every time this method is called.

getConstructorParametersback to summary
public List<PropertyMetaModel> getConstructorParameters()
Returns:List<PropertyMetaModel>

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.

getDeclaredPropertyMetaModelsback to summary
public List<PropertyMetaModel> getDeclaredPropertyMetaModels()
Returns:List<PropertyMetaModel>

a list of all properties declared directly in this node (not its parent nodes.) These are also available as fields.

getDerivedPropertyMetaModelsback to summary
public List<PropertyMetaModel> getDerivedPropertyMetaModels()
getMetaModelFieldNameback to summary
public String getMetaModelFieldName()

The name of the field in JavaParserMetaModel for this node meta model.

getPackageNameback to summary
public String getPackageName()
Returns:String

the package containing this AST node class.

getQualifiedClassNameback to summary
public String getQualifiedClassName()
Returns:String

package name + class name

getSuperNodeMetaModelback to summary
public Optional<BaseNodeMetaModel> getSuperNodeMetaModel()
Returns:Optional<BaseNodeMetaModel>

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.

getTypeback to summary
public Class<? extends Node> getType()
Returns:Class<? extends Node>

the class for this AST node type.

getTypeNameback to summary
public String getTypeName()
Returns:String

the raw type name, so nothing but the name.

getTypeNameGenerifiedback to summary
public String getTypeNameGenerified()
Returns:String

the type name, with generics.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
hasWildcardback to summary
public boolean hasWildcard()
Returns:boolean

whether this AST node has a <?> at the end of its type.

isback to summary
public boolean is(Class<? extends Node> c)
Returns:boolean

is this the meta model for this node class?

isAbstractback to summary
public boolean isAbstract()
Returns:boolean

whether this AST node is abstract.

isInstanceOfMetaModelback to summary
public boolean isInstanceOfMetaModel(BaseNodeMetaModel baseMetaModel)
isRootNodeback to summary
public boolean isRootNode()
Returns:boolean

whether this AST node is the root node, meaning that it is the meta model for "Node": "NodeMetaModel".

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override