org.eclipse.jdt.internal.eval
Class CodeSnippetSkeleton

java.lang.Object
  extended by org.eclipse.jdt.internal.eval.CodeSnippetSkeleton
All Implemented Interfaces:
IBinaryType, IDependent, IGenericType, EvaluationConstants

public class CodeSnippetSkeleton
extends java.lang.Object
implements IBinaryType, EvaluationConstants

The skeleton of the class 'org.eclipse.jdt.internal.eval.target.CodeSnippet' used at compile time. Note that the method run() is declared to throw Throwable so that the user can write a code snipet that throws checked exceptio without having to catch those.


Nested Class Summary
static class CodeSnippetSkeleton.BinaryMethodSkeleton
           
 
Field Summary
 
Fields inherited from interface org.eclipse.jdt.internal.compiler.env.IBinaryType
NoField, NoInterface, NoMethod, NoNestedType
 
Fields inherited from interface org.eclipse.jdt.internal.compiler.env.IDependent
JAR_FILE_ENTRY_SEPARATOR
 
Fields inherited from interface org.eclipse.jdt.internal.eval.EvaluationConstants
CODE_SNIPPET_CLASS_NAME_PREFIX, CODE_SNIPPET_NAME, DELEGATE_THIS, GLOBAL_VARS_CLASS_NAME_PREFIX, LOCAL_VAR_PREFIX, PACKAGE_NAME, RESULT_TYPE_FIELD, RESULT_VALUE_FIELD, ROOT_CLASS_NAME, ROOT_COMPOUND_NAME, ROOT_FULL_CLASS_NAME, RUN_METHOD, SETRESULT_ARGUMENTS, SETRESULT_SELECTOR
 
Constructor Summary
CodeSnippetSkeleton()
          CodeSnippetSkeleton constructor comment.
 
Method Summary
 IBinaryAnnotation[] getAnnotations()
          Answer the runtime visible and invisible annotations for this type 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.
 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 signature which describes the parameter & return types as specified in section 4.4.4 of the Java 2 VM spec 3rd edition.
 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.
 java.lang.String getJavadocContents()
           
 java.lang.String getJavadocContents(org.eclipse.core.runtime.IProgressMonitor monitor, java.lang.String defaultEncoding)
           
 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[] 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.
 java.lang.String getURLContents(java.lang.String docUrlValue, java.lang.String defaultEncoding)
           
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodeSnippetSkeleton

public CodeSnippetSkeleton()
CodeSnippetSkeleton constructor comment.

Method Detail

getAnnotations

public IBinaryAnnotation[] getAnnotations()
Description copied from interface: IBinaryType
Answer the runtime visible and invisible annotations for this type or null if none.

Specified by:
getAnnotations in interface IBinaryType

getEnclosingTypeName

public char[] getEnclosingTypeName()
Description copied from interface: 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.

Specified by:
getEnclosingTypeName in interface IBinaryType

getFields

public IBinaryField[] getFields()
Description copied from interface: IBinaryType
Answer the receiver's fields or null if the array is empty.

Specified by:
getFields in interface IBinaryType

getFileName

public char[] getFileName()
Description copied from interface: 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.

Specified by:
getFileName in interface IDependent
See Also:
IDependent.getFileName()

getGenericSignature

public char[] getGenericSignature()
Description copied from interface: IBinaryType
Answer the receiver's signature which describes the parameter & return types as specified in section 4.4.4 of the Java 2 VM spec 3rd edition. Returns null if none.

Specified by:
getGenericSignature in interface IBinaryType
Returns:
the receiver's signature, null if none

getInterfaceNames

public char[][] getInterfaceNames()
Description copied from interface: 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.

Specified by:
getInterfaceNames in interface IBinaryType

getJavadocContents

public java.lang.String getJavadocContents()

getJavadocContents

public java.lang.String getJavadocContents(org.eclipse.core.runtime.IProgressMonitor monitor,
                                           java.lang.String defaultEncoding)
                                    throws JavaModelException
Throws:
JavaModelException

getMemberTypes

public IBinaryNestedType[] getMemberTypes()
Description copied from interface: 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.

Specified by:
getMemberTypes in interface IBinaryType

getMethods

public IBinaryMethod[] getMethods()
Description copied from interface: IBinaryType
Answer the receiver's methods or null if the array is empty.

Specified by:
getMethods in interface IBinaryType

getModifiers

public int getModifiers()
Description copied from interface: IGenericType
Answer an int whose bits are set according the access constants defined by the VM spec. NOTE 1: We have added AccDeprecated & AccSynthetic. NOTE 2: If the receiver represents a member type, the modifiers are extracted from its inner class attributes.

Specified by:
getModifiers in interface IGenericType

getMissingTypeNames

public char[][][] getMissingTypeNames()
Description copied from interface: IBinaryType
Answer the list of missing type names which were referenced from the problem classfile. This list is encoded via an extra attribute.

Specified by:
getMissingTypeNames in interface IBinaryType

getName

public char[] getName()
Description copied from interface: 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.

Specified by:
getName in interface IBinaryType

getSourceName

public char[] getSourceName()
Description copied from interface: IBinaryType
Answer the simple name of the type in the class file. For member A$B, will answer B. For anonymous will answer null.

Specified by:
getSourceName in interface IBinaryType

getSuperclassName

public char[] getSuperclassName()
Description copied from interface: 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.

Specified by:
getSuperclassName in interface IBinaryType

getTagBits

public long getTagBits()
Description copied from interface: IBinaryType
Answer the tagbits set according to the bits for annotations.

Specified by:
getTagBits in interface IBinaryType

getURLContents

public java.lang.String getURLContents(java.lang.String docUrlValue,
                                       java.lang.String defaultEncoding)

isAnonymous

public boolean isAnonymous()
Description copied from interface: IBinaryType
Answer true if the receiver is an anonymous class. false otherwise

Specified by:
isAnonymous in interface IBinaryType

isBinaryType

public boolean isBinaryType()
Description copied from interface: IGenericType
Answer whether the receiver contains the resolved binary form or the unresolved source form of the type.

Specified by:
isBinaryType in interface IGenericType

isLocal

public boolean isLocal()
Description copied from interface: IBinaryType
Answer true if the receiver is a local class. false otherwise

Specified by:
isLocal in interface IBinaryType

isMember

public boolean isMember()
Description copied from interface: IBinaryType
Answer true if the receiver is a member class. false otherwise

Specified by:
isMember in interface IBinaryType

sourceFileName

public char[] sourceFileName()
Description copied from interface: IBinaryType
Answer the source file attribute, or null if none. For example, "String.java"

Specified by:
sourceFileName in interface IBinaryType