Package org.revapi.java.model
Class TypeElement
- java.lang.Object
-
- org.revapi.base.BaseElement<org.revapi.java.spi.JavaElement>
-
- org.revapi.java.model.AbstractJavaElement
-
- org.revapi.java.model.JavaElementBase<TypeElement,DeclaredType>
-
- org.revapi.java.model.TypeElement
-
- 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
Constructors Constructor Description 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).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeElementclone()intcompareTo(org.revapi.java.spi.JavaElement o)protected StringcreateComparableSignature()protected StringcreateFullHumanReadableString()StringgetBinaryName()StringgetCanonicalName()protected StringgetHumanReadableElementType()Map<org.revapi.java.spi.UseSite.Type,Map<TypeElement,Set<org.revapi.java.spi.JavaModelElement>>>getUsedTypes()This provides the types used by this type.Set<org.revapi.java.spi.UseSite>getUseSites()voidinitReferences()A helper method ofJavaArchiveAnalyzer.prune(ElementForest).booleanisInAPI()booleanisInApiThroughUse()voidsetInApi(boolean inApi)voidsetInApiThroughUse(boolean inApiThroughUse)voidsetRawUsedTypes(Map<org.revapi.java.spi.UseSite.Type,Map<TypeElement,Set<UseSitePath>>> usedTypes)voidsetRawUseSites(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
-
-
-
-
Constructor Detail
-
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 Detail
-
getHumanReadableElementType
@Nonnull protected String getHumanReadableElementType()
- Specified by:
getHumanReadableElementTypein classJavaElementBase<TypeElement,DeclaredType>
-
getBinaryName
public String getBinaryName()
-
getCanonicalName
public String getCanonicalName()
-
isInAPI
public boolean isInAPI()
- Specified by:
isInAPIin interfaceorg.revapi.java.spi.JavaTypeElement
-
isInApiThroughUse
public boolean isInApiThroughUse()
- Specified by:
isInApiThroughUsein interfaceorg.revapi.java.spi.JavaTypeElement
-
getUseSites
public Set<org.revapi.java.spi.UseSite> getUseSites()
-
getUsedTypes
public Map<org.revapi.java.spi.UseSite.Type,Map<TypeElement,Set<org.revapi.java.spi.JavaModelElement>>> getUsedTypes()
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
public void setRawUseSites(Set<ClassPathUseSite> rawUseSites)
-
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
public int compareTo(@Nonnull org.revapi.java.spi.JavaElement o)
- Specified by:
compareToin interfaceComparable<org.revapi.java.spi.JavaElement>- Overrides:
compareToin classJavaElementBase<TypeElement,DeclaredType>
-
createFullHumanReadableString
protected String createFullHumanReadableString()
- Overrides:
createFullHumanReadableStringin classJavaElementBase<TypeElement,DeclaredType>
-
createComparableSignature
protected String createComparableSignature()
- Specified by:
createComparableSignaturein classJavaElementBase<TypeElement,DeclaredType>
-
clone
public TypeElement clone()
- Overrides:
clonein classJavaElementBase<TypeElement,DeclaredType>
-
-