Klasse ExternalAnnotationDecorator

java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ExternalAnnotationDecorator
Alle implementierten Schnittstellen:
IBinaryType, IDependent, IGenericType

public class ExternalAnnotationDecorator extends Object implements IBinaryType
  • Konstruktordetails

    • ExternalAnnotationDecorator

      public ExternalAnnotationDecorator(IBinaryType toDecorate, ExternalAnnotationProvider externalAnnotationProvider)
    • ExternalAnnotationDecorator

      public ExternalAnnotationDecorator(IBinaryType toDecorate, boolean isFromSource)
  • Methodendetails

    • getFileName

      public char[] getFileName()
      Beschreibung aus Schnittstelle kopiert: IDependent
      Answer the file name which defines the type. The path part (optional) must be separated from the actual file proper name by a separator suitable for the type (java.io.File.separator for example), e.g. "c:\\source\\com\\p\\X.java" or "/com/p/Y.java". The path to the zip or jar file (optional) must be separated from the actual path part by JAR_FILE_ENTRY_SEPARATOR, e.g. "c:\\lib\\some.jar|/com/p/X.class" or "/lib/some.zip|/com/q/Y.class". The proper file name includes the suffix extension (e.g. ".java") e.g. "c:/org/eclipse/jdt/internal/compileri/env/IDependent.java" Return null if no file defines the type.
      Angegeben von:
      getFileName in Schnittstelle IDependent
    • isBinaryType

      public boolean isBinaryType()
      Beschreibung aus Schnittstelle kopiert: IGenericType
      Answer whether the receiver contains the resolved binary form or the unresolved source form of the type.
      Angegeben von:
      isBinaryType in Schnittstelle IGenericType
    • getAnnotations

      public IBinaryAnnotation[] getAnnotations()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer the runtime visible and invisible annotations for this type or null if none.
      Angegeben von:
      getAnnotations in Schnittstelle IBinaryType
    • getTypeAnnotations

      public IBinaryTypeAnnotation[] getTypeAnnotations()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer the runtime visible and invisible type annotations for this type or null if none.
      Angegeben von:
      getTypeAnnotations in Schnittstelle IBinaryType
    • getEnclosingMethod

      public char[] getEnclosingMethod()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer the enclosing method (including method selector and method descriptor), or null if none. For example, "foo()Ljava/lang/Object;V"
      Angegeben von:
      getEnclosingMethod in Schnittstelle IBinaryType
    • getEnclosingTypeName

      public char[] getEnclosingTypeName()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      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. For example, java.lang.String is java/lang/String.
      Angegeben von:
      getEnclosingTypeName in Schnittstelle IBinaryType
    • getFields

      public IBinaryField[] getFields()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer the receiver's fields or null if the array is empty.
      Angegeben von:
      getFields in Schnittstelle IBinaryType
    • getRecordComponents

      public IRecordComponent[] getRecordComponents()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer the receiver's record components or null if the array is empty.
      Angegeben von:
      getRecordComponents in Schnittstelle IBinaryType
    • getGenericSignature

      public char[] getGenericSignature()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      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. Returns null if none.
      Angegeben von:
      getGenericSignature in Schnittstelle IBinaryType
      Gibt zurück:
      the receiver's signature, null if none
    • getInterfaceNames

      public char[][] getInterfaceNames()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      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. For example, java.lang.String is java/lang/String.
      Angegeben von:
      getInterfaceNames in Schnittstelle IBinaryType
    • getMemberTypes

      public IBinaryNestedType[] getMemberTypes()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer the receiver's nested types or null if the array is empty. This nested type info is extracted from the inner class attributes. Ask the name environment to find a member type using its compound name.
      Angegeben von:
      getMemberTypes in Schnittstelle IBinaryType
    • getMethods

      public IBinaryMethod[] getMethods()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer the receiver's methods or null if the array is empty.
      Angegeben von:
      getMethods in Schnittstelle IBinaryType
    • getMissingTypeNames

      public char[][][] getMissingTypeNames()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer the list of missing type names which were referenced from the problem classfile. This list is encoded via an extra attribute.
      Angegeben von:
      getMissingTypeNames in Schnittstelle IBinaryType
    • getName

      public char[] getName()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer the resolved name of the type in the class file format as specified in section 4.2 of the Java 2 VM spec. For example, java.lang.String is java/lang/String.
      Angegeben von:
      getName in Schnittstelle IBinaryType
    • getSourceName

      public char[] getSourceName()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer the simple name of the type in the class file. For member A$B, will answer B. For anonymous will answer null.
      Angegeben von:
      getSourceName in Schnittstelle IBinaryType
    • getSuperclassName

      public char[] getSuperclassName()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      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. For example, java.lang.String is java/lang/String.
      Angegeben von:
      getSuperclassName in Schnittstelle IBinaryType
    • getTagBits

      public long getTagBits()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer the tagbits set according to the bits for annotations.
      Angegeben von:
      getTagBits in Schnittstelle IBinaryType
    • isAnonymous

      public boolean isAnonymous()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer true if the receiver is an anonymous class. false otherwise
      Angegeben von:
      isAnonymous in Schnittstelle IBinaryType
    • isLocal

      public boolean isLocal()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer true if the receiver is a local class. false otherwise
      Angegeben von:
      isLocal in Schnittstelle IBinaryType
    • isRecord

      public boolean isRecord()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer true if the receiver is a record. false otherwise
      Angegeben von:
      isRecord in Schnittstelle IBinaryType
    • isMember

      public boolean isMember()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer true if the receiver is a member class. false otherwise
      Angegeben von:
      isMember in Schnittstelle IBinaryType
    • sourceFileName

      public char[] sourceFileName()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer the source file attribute, or null if none. For example, "String.java"
      Angegeben von:
      sourceFileName in Schnittstelle IBinaryType
    • getModifiers

      public int getModifiers()
      Beschreibung aus Schnittstelle kopiert: IGenericType
      Answer an int whose bits are set according the access constants defined by the VM spec. NOTE 1: We have added AccDeprecated Ungültige Eingabe: "&" AccSynthetic. NOTE 2: If the receiver represents a member type, the modifiers are extracted from its inner class attributes.
      Angegeben von:
      getModifiers in Schnittstelle IGenericType
    • getModule

      public char[] getModule()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer the module to which this type belongs. null if the type is associated to the unnamed module.
      Angegeben von:
      getModule in Schnittstelle IBinaryType
      Gibt zurück:
      the module name or null
    • getAnnotationZipFile

      public static ZipFile getAnnotationZipFile(String basePath, ExternalAnnotationDecorator.ZipFileProducer producer) throws IOException
      Returns the zip file containing external annotations, if any. Returns null if there are no external annotations or if the basePath refers to a directory.
      Parameter:
      basePath - resolved filesystem path of either directory or zip file
      producer - an optional helper to produce the zipFile when needed.
      Gibt zurück:
      the client provided zip file; or else a fresh new zip file, to let clients cache it, if desired; or null to signal that basePath is not a zip file, but a directory.
      Löst aus:
      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.
    • externalAnnotationProvider

      public static ExternalAnnotationProvider externalAnnotationProvider(String basePath, String qualifiedBinaryTypeName, ZipFile zipFile) throws IOException
      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.
      Parameter:
      basePath - resolved filesystem path of either directory or zip file
      qualifiedBinaryTypeName - slash-separated type name
      zipFile - an existing zip file for the same basePath, or null.
      Gibt zurück:
      the annotation provider or null if there are no external annotations.
      Löst aus:
      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.
    • create

      public static IBinaryType create(IBinaryType toDecorate, String basePath, String qualifiedBinaryTypeName, ZipFile zipFile) throws IOException
      Possibly wrap the provided binary type in a ClassWithExternalAnnotations to which a fresh provider for external annotations is associated. This provider is constructed using the given basePath, which is either a directory holding .eea text files, or a zip file of entries of the same format. If no such provider could be constructed, then the original binary type is returned unchanged.
      Parameter:
      toDecorate - the binary type to wrap, if needed
      basePath - resolved filesystem path of either directory or zip file
      qualifiedBinaryTypeName - slash-separated type name
      zipFile - an existing zip file for the same basePath, or null.
      Gibt zurück:
      either a fresh ClassWithExternalAnnotations or the original binary type unchanged.
      Löst aus:
      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.
    • enrichWithExternalAnnotationsFor

      public ITypeAnnotationWalker enrichWithExternalAnnotationsFor(ITypeAnnotationWalker walker, Object member, LookupEnvironment environment)
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer a type annotation walker that takes into consideration also external annotations.
      Angegeben von:
      enrichWithExternalAnnotationsFor in Schnittstelle IBinaryType
      Parameter:
      walker - previous walker, may be empty, otherwise it will be returned unchanged
      member - if either a IBinaryField or a IBinaryMethod is provided, answer a walker specifically for that member
      environment - for use by the walker
      Gibt zurück:
      either a matching walker with data from external annotations or the walker provided via argument 'walker'.
    • getExternalAnnotationStatus

      public BinaryTypeBinding.ExternalAnnotationStatus getExternalAnnotationStatus()
      Beschreibung aus Schnittstelle kopiert: IBinaryType
      Answer whether a provider for external annotations is associated with this binary type.
      Angegeben von:
      getExternalAnnotationStatus in Schnittstelle IBinaryType
    • getURI

      public URI getURI()
      Angegeben von:
      getURI in Schnittstelle IBinaryType