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, representationFields 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()intcompareTo(org.revapi.java.spi.JavaElement o) protected Stringprotected Stringprotected StringMap<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> voidA helper method ofJavaArchiveAnalyzer.prune(ElementForest).booleanisInAPI()booleanvoidsetInApi(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, toStringMethods inherited from class org.revapi.java.model.AbstractJavaElement
getTypeEnvironment, newReference, setArchiveMethods inherited from class org.revapi.base.BaseElement
castThis, getArchive, getChildren, getReferencedElements, getReferencingElements, iterateOverChildren, newChildrenInstance, searchChildren, searchChildrenMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.revapi.Element
as, getApi, getArchive, getChildren, getCumulativeReferencedElements, getCumulativeReferencingElements, getFullHumanReadableString, getReferencedElements, getReferencingElements, iterateOverChildren, searchChildren, searchChildren, setParent, streamMethods inherited from interface org.revapi.java.spi.JavaElement
getTypeEnvironmentMethods inherited from interface org.revapi.java.spi.JavaModelElement
getParent, getParentType, isInheritedMethods 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:
getHumanReadableElementTypein classJavaElementBase<TypeElement,DeclaredType>
-
getBinaryName
-
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
-
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:
compareToin interfaceComparable<org.revapi.java.spi.JavaElement>- Overrides:
compareToin classJavaElementBase<TypeElement,DeclaredType>
-
createFullHumanReadableString
- Overrides:
createFullHumanReadableStringin classJavaElementBase<TypeElement,DeclaredType>
-
createComparableSignature
- Specified by:
createComparableSignaturein classJavaElementBase<TypeElement,DeclaredType>
-
clone
- Overrides:
clonein classJavaElementBase<TypeElement,DeclaredType>
-