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 Details

  • Method Details

    • is

      public boolean is(Class<? extends Node> c)
      Returns:
      is this the meta model for this node class?
    • 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)
    • getType

      public Class<? extends Node> getType()
      Returns:
      the class for this AST node type.
    • 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".
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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.
    • construct

      public Node construct(Map<String,​Object> parameters)
      Creates a new node of this type.
      Parameters:
      parameters - a map of propertyName -> value. This should at least contain a pair for every required property for this node.