Top Description Constructors Methods
com.github.javaparser.ast.type

public abstract Class ReferenceType

extends Type
Class Inheritance
Known Direct Subclasses
com.github.javaparser.ast.type.TypeParameter, com.github.javaparser.ast.type.ArrayType, com.github.javaparser.ast.type.ClassOrInterfaceType
Imports
com.github.javaparser.TokenRange, com.github.javaparser.ast.AllFieldsConstructor, .Node, .NodeList, .Generated, com.github.javaparser.ast.expr.AnnotationExpr, com.github.javaparser.ast.visitor.CloneVisitor, com.github.javaparser.metamodel.JavaParserMetaModel, .ReferenceTypeMetaModel, java.util.function.Consumer, java.util.Optional

Base class for reference types.
Author
Julio Vilmar Gesser

Constructor Summary

AccessConstructor and Description
public
public
public
ReferenceType(TokenRange tokenRange, NodeList<AnnotationExpr> annotations)

This constructor is used by the parser and is considered private.

Method Summary

Modifier and TypeMethod and Description
public ReferenceType
public ReferenceType
clone()

Overrides com.github.javaparser.ast.type.Type.clone.

Creates and returns a copy of this object.
public ReferenceTypeMetaModel
public void
public boolean
public boolean
public boolean
public Optional<ReferenceType>
Inherited from com.github.javaparser.ast.type.Type:
asArrayTypeasClassOrInterfaceTypeasIntersectionTypeasPrimitiveTypeasStringasTypeParameterasUnionTypeasUnknownTypeasVarTypeasVoidTypeasWildcardTypegetAnnotationgetAnnotationsgetArrayLevelgetElementTypeifArrayTypeifClassOrInterfaceTypeifIntersectionTypeifPrimitiveTypeifTypeParameterifUnionTypeifUnknownTypeifVarTypeifVoidTypeifWildcardTypeisArrayTypeisClassOrInterfaceTypeisIntersectionTypeisPrimitiveTypeisTypeParameterisUnionTypeisUnknownTypeisVarTypeisVoidTypeisWildcardTyperesolvesetAnnotationstoArrayTypetoClassOrInterfaceTypetoIntersectionTypetoPrimitiveTypetoTypeParametertoUnionTypetoUnknownTypetoVarTypetoVoidTypetoWildcardType

Constructor Detail

ReferenceTypeback to summary
public ReferenceType()
ReferenceTypeback to summary
public ReferenceType(NodeList<AnnotationExpr> annotations)
Annotations
@AllFieldsConstructor
ReferenceTypeback to summary
public ReferenceType(TokenRange tokenRange, NodeList<AnnotationExpr> annotations)

This constructor is used by the parser and is considered private.

Annotations
@Generated:com.github.javaparser.generator.core.node.MainConstructorGenerator

Method Detail

asReferenceTypeback to summary
public ReferenceType asReferenceType()

Overrides com.github.javaparser.ast.type.Type.asReferenceType.

Annotations
@Override
@Generated:com.github.javaparser.generator.core.node.TypeCastingGenerator
cloneback to summary
public ReferenceType clone()

Overrides com.github.javaparser.ast.type.Type.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:ReferenceType

a clone of this instance.

Annotations
@Override
@Generated:com.github.javaparser.generator.core.node.CloneGenerator
getMetaModelback to summary
public ReferenceTypeMetaModel getMetaModel()

Overrides com.github.javaparser.ast.type.Type.getMetaModel.

Returns:ReferenceTypeMetaModel

Doc from com.github.javaparser.ast.Node.getMetaModel.

get JavaParser specific node introspection information.

Annotations
@Override
@Generated:com.github.javaparser.generator.core.node.GetMetaModelGenerator
ifReferenceTypeback to summary
public void ifReferenceType(Consumer<ReferenceType> action)

Overrides com.github.javaparser.ast.type.Type.ifReferenceType.

Annotations
@Generated:com.github.javaparser.generator.core.node.TypeCastingGenerator
isReferenceTypeback to summary
public boolean isReferenceType()

Overrides com.github.javaparser.ast.type.Type.isReferenceType.

Annotations
@Override
@Generated:com.github.javaparser.generator.core.node.TypeCastingGenerator
removeback to summary
public boolean remove(Node node)

Overrides com.github.javaparser.ast.type.Type.remove.

Annotations
@Override
@Generated:com.github.javaparser.generator.core.node.RemoveMethodGenerator
replaceback to summary
public boolean replace(Node node, Node replacementNode)

Overrides com.github.javaparser.ast.type.Type.replace.

Annotations
@Override
@Generated:com.github.javaparser.generator.core.node.ReplaceMethodGenerator
toReferenceTypeback to summary
public Optional<ReferenceType> toReferenceType()

Overrides com.github.javaparser.ast.type.Type.toReferenceType.

Annotations
@Override
@Generated:com.github.javaparser.generator.core.node.TypeCastingGenerator