public class ExternalAnnotationDecorator extends java.lang.Object implements IBinaryType
IBinaryType that allows external annotations to be attached. This can be used to change the
result of enrichWithExternalAnnotationsFor(org.aspectj.org.eclipse.jdt.internal.compiler.env.ITypeAnnotationWalker, java.lang.Object, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment) or getExternalAnnotationStatus().| Modifier and Type | Class and Description |
|---|---|
static interface |
ExternalAnnotationDecorator.ZipFileProducer
Auxiliary interface for
getAnnotationZipFile(String, ZipFileProducer). |
NoField, NoInterface, NoMethod, NoNestedTypeJAR_FILE_ENTRY_SEPARATOR| Constructor and Description |
|---|
ExternalAnnotationDecorator(IBinaryType toDecorate,
boolean isFromSource) |
ExternalAnnotationDecorator(IBinaryType toDecorate,
ExternalAnnotationProvider externalAnnotationProvider) |
| Modifier and Type | Method and Description |
|---|---|
static IBinaryType |
create(IBinaryType toDecorate,
java.lang.String basePath,
java.lang.String qualifiedBinaryTypeName,
java.util.zip.ZipFile zipFile)
Possibly wrap the provided binary type in a ClassWithExternalAnnotations to which a fresh provider for external
annotations is associated.
|
ITypeAnnotationWalker |
enrichWithExternalAnnotationsFor(ITypeAnnotationWalker walker,
java.lang.Object member,
LookupEnvironment environment)
Answer a type annotation walker that takes into consideration also external annotations.
|
static ExternalAnnotationProvider |
externalAnnotationProvider(java.lang.String basePath,
java.lang.String qualifiedBinaryTypeName,
java.util.zip.ZipFile zipFile)
Creates an external annotation provider for external annotations using the given basePath, which is either a
directory holding .eea text files, or a zip file of entries of the same format.
|
IBinaryAnnotation[] |
getAnnotations()
Answer the runtime visible and invisible annotations for this type or null if none.
|
static java.util.zip.ZipFile |
getAnnotationZipFile(java.lang.String basePath,
ExternalAnnotationDecorator.ZipFileProducer producer)
Returns the zip file containing external annotations, if any.
|
char[] |
getEnclosingMethod()
Answer the enclosing method (including method selector and method descriptor), or
null if none.
|
char[] |
getEnclosingTypeName()
Answer the resolved name of the enclosing type in the
class file format as specified in section 4.2 of the Java 2 VM spec
or null if the receiver is a top level type.
|
BinaryTypeBinding.ExternalAnnotationStatus |
getExternalAnnotationStatus()
Answer whether a provider for external annotations is associated with this binary type.
|
IBinaryField[] |
getFields()
Answer the receiver's fields or null if the array is empty.
|
char[] |
getFileName()
Answer the file name which defines the type.
|
char[] |
getGenericSignature()
Answer the receiver's ClassSignature, which describes the type parameters,
super class, and super interfaces as specified in section "4.7.9.1 Signatures"
of the Java SE 8 VM spec.
|
char[][] |
getInterfaceNames()
Answer the resolved names of the receiver's interfaces in the
class file format as specified in section 4.2 of the Java 2 VM spec
or null if the array is empty.
|
IBinaryNestedType[] |
getMemberTypes()
Answer the receiver's nested types or null if the array is empty.
|
IBinaryMethod[] |
getMethods()
Answer the receiver's methods or null if the array is empty.
|
char[][][] |
getMissingTypeNames()
Answer the list of missing type names which were referenced from
the problem classfile.
|
int |
getModifiers()
Answer an int whose bits are set according the access constants
defined by the VM spec.
|
char[] |
getModule()
Answer the module to which this type belongs.
|
char[] |
getName()
Answer the resolved name of the type in the
class file format as specified in section 4.2 of the Java 2 VM spec.
|
char[] |
getSourceName()
Answer the simple name of the type in the class file.
|
char[] |
getSuperclassName()
Answer the resolved name of the receiver's superclass in the
class file format as specified in section 4.2 of the Java 2 VM spec
or null if it does not have one.
|
long |
getTagBits()
Answer the tagbits set according to the bits for annotations.
|
IBinaryTypeAnnotation[] |
getTypeAnnotations()
Answer the runtime visible and invisible type annotations for this type or null if none.
|
boolean |
isAnonymous()
Answer true if the receiver is an anonymous class.
|
boolean |
isBinaryType()
Answer whether the receiver contains the resolved binary form
or the unresolved source form of the type.
|
boolean |
isLocal()
Answer true if the receiver is a local class.
|
boolean |
isMember()
Answer true if the receiver is a member class.
|
char[] |
sourceFileName()
Answer the source file attribute, or null if none.
|
public ExternalAnnotationDecorator(IBinaryType toDecorate, ExternalAnnotationProvider externalAnnotationProvider)
public ExternalAnnotationDecorator(IBinaryType toDecorate, boolean isFromSource)
public char[] getFileName()
IDependentgetFileName in interface IDependentpublic boolean isBinaryType()
IGenericTypeisBinaryType in interface IGenericTypepublic IBinaryAnnotation[] getAnnotations()
IBinaryTypegetAnnotations in interface IBinaryTypepublic IBinaryTypeAnnotation[] getTypeAnnotations()
IBinaryTypegetTypeAnnotations in interface IBinaryTypepublic char[] getEnclosingMethod()
IBinaryTypegetEnclosingMethod in interface IBinaryTypepublic char[] getEnclosingTypeName()
IBinaryTypegetEnclosingTypeName in interface IBinaryTypepublic IBinaryField[] getFields()
IBinaryTypegetFields in interface IBinaryTypepublic char[] getGenericSignature()
IBinaryTypegetGenericSignature in interface IBinaryTypepublic char[][] getInterfaceNames()
IBinaryTypegetInterfaceNames in interface IBinaryTypepublic IBinaryNestedType[] getMemberTypes()
IBinaryTypegetMemberTypes in interface IBinaryTypepublic IBinaryMethod[] getMethods()
IBinaryTypegetMethods in interface IBinaryTypepublic char[][][] getMissingTypeNames()
IBinaryTypegetMissingTypeNames in interface IBinaryTypepublic char[] getName()
IBinaryTypegetName in interface IBinaryTypepublic char[] getSourceName()
IBinaryTypegetSourceName in interface IBinaryTypepublic char[] getSuperclassName()
IBinaryTypegetSuperclassName in interface IBinaryTypepublic long getTagBits()
IBinaryTypegetTagBits in interface IBinaryTypepublic boolean isAnonymous()
IBinaryTypeisAnonymous in interface IBinaryTypepublic boolean isLocal()
IBinaryTypeisLocal in interface IBinaryTypepublic boolean isMember()
IBinaryTypeisMember in interface IBinaryTypepublic char[] sourceFileName()
IBinaryTypesourceFileName in interface IBinaryTypepublic int getModifiers()
IGenericTypegetModifiers in interface IGenericTypepublic char[] getModule()
IBinaryTypenull if the type is associated to the unnamed module.getModule in interface IBinaryTypenullpublic static java.util.zip.ZipFile getAnnotationZipFile(java.lang.String basePath,
ExternalAnnotationDecorator.ZipFileProducer producer)
throws java.io.IOException
basePath - resolved filesystem path of either directory or zip fileproducer - an optional helper to produce the zipFile when needed.java.io.IOException - any unexpected errors during file access. File not found while accessing an individual file if
basePath is a directory is expected, and simply answered with null. If basePath is neither a
directory nor a zip file, this is unexpected.public static ExternalAnnotationProvider externalAnnotationProvider(java.lang.String basePath, java.lang.String qualifiedBinaryTypeName, java.util.zip.ZipFile zipFile) throws java.io.IOException
basePath - resolved filesystem path of either directory or zip filequalifiedBinaryTypeName - slash-separated type namezipFile - an existing zip file for the same basePath, or null.java.io.IOException - any unexpected errors during file access. File not found while accessing an individual file if
basePath is a directory is expected, and simply answered with null. If basePath is neither a
directory nor a zip file, this is unexpected.public static IBinaryType create(IBinaryType toDecorate, java.lang.String basePath, java.lang.String qualifiedBinaryTypeName, java.util.zip.ZipFile zipFile) throws java.io.IOException
toDecorate - the binary type to wrap, if neededbasePath - resolved filesystem path of either directory or zip filequalifiedBinaryTypeName - slash-separated type namezipFile - an existing zip file for the same basePath, or null.java.io.IOException - any unexpected errors during file access. File not found while accessing an individual file if
basePath is a directory is expected, and simply handled by not setting up an external
annotation provider. If basePath is neither a directory nor a zip file, this is unexpected, resulting
in an exception.public ITypeAnnotationWalker enrichWithExternalAnnotationsFor(ITypeAnnotationWalker walker, java.lang.Object member, LookupEnvironment environment)
IBinaryTypeenrichWithExternalAnnotationsFor in interface IBinaryTypewalker - previous walker, may be empty, otherwise it will be returned unchangedmember - if either a IBinaryField or a IBinaryMethod is provided, answer a walker specifically for that memberenvironment - for use by the walkerpublic BinaryTypeBinding.ExternalAnnotationStatus getExternalAnnotationStatus()
IBinaryTypegetExternalAnnotationStatus in interface IBinaryType