Class TypeElement
java.lang.Object
org.revapi.base.BaseElement<org.revapi.java.spi.JavaElement>
- All Implemented Interfaces:
Cloneable
,Comparable<org.revapi.java.spi.JavaElement>
,org.revapi.Element<org.revapi.java.spi.JavaElement>
,org.revapi.java.spi.JavaElement
,org.revapi.java.spi.JavaModelElement
,org.revapi.java.spi.JavaTypeElement
- Direct Known Subclasses:
MissingClassElement
public class TypeElement
extends JavaElementBase<TypeElement,DeclaredType>
implements org.revapi.java.spi.JavaTypeElement
- Since:
- 0.1
- Author:
- Lukas Krejci
-
Field Summary
Fields inherited from class org.revapi.java.model.JavaElementBase
element, representation
Fields inherited from class org.revapi.java.model.AbstractJavaElement
environment
-
Constructor Summary
ConstructorsConstructorDescriptionTypeElement
(ProbingEnvironment env, org.revapi.Archive archive, TypeElement element, DeclaredType type) This constructor is used under "normal working conditions" when the probing environment already has the compilation infrastructure available (which is assumed since otherwise it would not be possible to obtain instances of the javax.lang.model.element.TypeElement interface). -
Method Summary
Modifier and TypeMethodDescriptionclone()
int
compareTo
(org.revapi.java.spi.JavaElement o) protected String
protected String
protected String
Map
<org.revapi.java.spi.UseSite.Type, Map<TypeElement, Set<org.revapi.java.spi.JavaModelElement>>> This provides the types used by this type.Set
<org.revapi.java.spi.UseSite> void
A helper method ofJavaArchiveAnalyzer.prune(ElementForest)
.boolean
isInAPI()
boolean
void
setInApi
(boolean inApi) void
setInApiThroughUse
(boolean inApiThroughUse) void
setRawUsedTypes
(Map<org.revapi.java.spi.UseSite.Type, Map<TypeElement, Set<UseSitePath>>> usedTypes) void
setRawUseSites
(Set<ClassPathUseSite> rawUseSites) Methods inherited from class org.revapi.java.model.JavaElementBase
cloneUnder, equals, getApi, getComparableSignature, getDeclaringElement, getFullHumanReadableString, getModelRepresentation, getParent, hashCode, isInherited, lookupChildElement, setInherited, setParent, toString
Methods inherited from class org.revapi.java.model.AbstractJavaElement
getTypeEnvironment, newReference, setArchive
Methods inherited from class org.revapi.base.BaseElement
castThis, getArchive, getChildren, getReferencedElements, getReferencingElements, iterateOverChildren, newChildrenInstance, searchChildren, searchChildren
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.revapi.Element
as, getApi, getArchive, getChildren, getCumulativeReferencedElements, getCumulativeReferencingElements, getFullHumanReadableString, getReferencedElements, getReferencingElements, iterateOverChildren, searchChildren, searchChildren, setParent, stream
Methods inherited from interface org.revapi.java.spi.JavaElement
getTypeEnvironment
Methods inherited from interface org.revapi.java.spi.JavaModelElement
getParent, getParentType, isInherited
Methods inherited from interface org.revapi.java.spi.JavaTypeElement
getDeclaringElement, getModelRepresentation
-
Constructor Details
-
TypeElement
public TypeElement(ProbingEnvironment env, org.revapi.Archive archive, TypeElement element, DeclaredType type) This constructor is used under "normal working conditions" when the probing environment already has the compilation infrastructure available (which is assumed since otherwise it would not be possible to obtain instances of the javax.lang.model.element.TypeElement interface).- Parameters:
env
- the probing environmentelement
- the model element to be represented
-
-
Method Details
-
getHumanReadableElementType
- Specified by:
getHumanReadableElementType
in classJavaElementBase<TypeElement,
DeclaredType>
-
getBinaryName
-
getCanonicalName
-
isInAPI
public boolean isInAPI()- Specified by:
isInAPI
in interfaceorg.revapi.java.spi.JavaTypeElement
-
isInApiThroughUse
public boolean isInApiThroughUse()- Specified by:
isInApiThroughUse
in interfaceorg.revapi.java.spi.JavaTypeElement
-
getUseSites
-
getUsedTypes
public Map<org.revapi.java.spi.UseSite.Type,Map<TypeElement, getUsedTypes()Set<org.revapi.java.spi.JavaModelElement>>> This provides the types used by this type. The keys are the types of use, values are maps from the used type to the set of concrete users of the type (the users represent some child of this element).- Returns:
- the types used by this type
-
setRawUsedTypes
public void setRawUsedTypes(Map<org.revapi.java.spi.UseSite.Type, Map<TypeElement, Set<UseSitePath>>> usedTypes) -
setInApi
public void setInApi(boolean inApi) -
setInApiThroughUse
public void setInApiThroughUse(boolean inApiThroughUse) -
setRawUseSites
-
initReferences
public void initReferences()A helper method ofJavaArchiveAnalyzer.prune(ElementForest)
. Only makes sense if called on all types in the whole forest, otherwise the references and back-references might not be complete. -
compareTo
- Specified by:
compareTo
in interfaceComparable<org.revapi.java.spi.JavaElement>
- Overrides:
compareTo
in classJavaElementBase<TypeElement,
DeclaredType>
-
createFullHumanReadableString
- Overrides:
createFullHumanReadableString
in classJavaElementBase<TypeElement,
DeclaredType>
-
createComparableSignature
- Specified by:
createComparableSignature
in classJavaElementBase<TypeElement,
DeclaredType>
-
clone
- Overrides:
clone
in classJavaElementBase<TypeElement,
DeclaredType>
-