org.eclipse.jdt.internal.compiler
Interface IDocumentElementRequestor
- All Known Implementing Classes:
- DOMBuilder
public interface IDocumentElementRequestor
Part of the source element parser responsible for building the output.
It gets notified of structural information as they are detected, relying
on the requestor to assemble them together, based on the notifications it got.
The structural investigation includes:
- package statement
- import statements
- top-level types: package member, member types (member types of member types...)
- fields
- methods
If reference information is requested, then all source constructs are
investigated and type, field & method references are provided as well.
Any (parsing) problem encountered is also provided.
All positions are relative to the exact source fed to the parser.
Elements which are complex are notified in two steps:
- enter : once the element header has been identified
- exit : once the element has been fully consumed
other simpler elements (package, import) are read all at once:
- accept
Method Summary |
void |
acceptImport(int declarationStart,
int declarationEnd,
int[] javaDocPositions,
char[] name,
int nameStartPosition,
boolean onDemand,
int modifiers)
|
void |
acceptInitializer(int declarationStart,
int declarationEnd,
int[] javaDocPositions,
int modifiers,
int modifiersStart,
int bodyStart,
int bodyEnd)
|
void |
acceptLineSeparatorPositions(int[] positions)
|
void |
acceptPackage(int declarationStart,
int declarationEnd,
int[] javaDocPositions,
char[] name,
int nameStartPosition)
|
void |
acceptProblem(CategorizedProblem problem)
|
void |
enterClass(int declarationStart,
int[] javaDocPositions,
int modifiers,
int modifiersStart,
int classStart,
char[] name,
int nameStart,
int nameEnd,
char[] superclass,
int superclassStart,
int superclassEnd,
char[][] superinterfaces,
int[] superinterfaceStarts,
int[] superinterfaceEnds,
int bodyStart)
|
void |
enterCompilationUnit()
|
void |
enterConstructor(int declarationStart,
int[] javaDocPositions,
int modifiers,
int modifiersStart,
char[] name,
int nameStart,
int nameEnd,
char[][] parameterTypes,
int[] parameterTypeStarts,
int[] parameterTypeEnds,
char[][] parameterNames,
int[] parameterNameStarts,
int[] parameterNameEnds,
int parametersEnd,
char[][] exceptionTypes,
int[] exceptionTypeStarts,
int[] exceptionTypeEnds,
int bodyStart)
|
void |
enterField(int declarationStart,
int[] javaDocPositions,
int modifiers,
int modifiersStart,
char[] type,
int typeStart,
int typeEnd,
int typeDimensionCount,
char[] name,
int nameStart,
int nameEnd,
int extendedTypeDimensionCount,
int extendedTypeDimensionEnd)
|
void |
enterInterface(int declarationStart,
int[] javaDocPositions,
int modifiers,
int modifiersStart,
int interfaceStart,
char[] name,
int nameStart,
int nameEnd,
char[][] superinterfaces,
int[] superinterfaceStarts,
int[] superinterfaceEnds,
int bodyStart)
|
void |
enterMethod(int declarationStart,
int[] javaDocPositions,
int modifiers,
int modifiersStart,
char[] returnType,
int returnTypeStart,
int returnTypeEnd,
int returnTypeDimensionCount,
char[] name,
int nameStart,
int nameEnd,
char[][] parameterTypes,
int[] parameterTypeStarts,
int[] parameterTypeEnds,
char[][] parameterNames,
int[] parameterNameStarts,
int[] parameterNameEnds,
int parametersEnd,
int extendedReturnTypeDimensionCount,
int extendedReturnTypeDimensionEnd,
char[][] exceptionTypes,
int[] exceptionTypeStarts,
int[] exceptionTypeEnds,
int bodyStart)
|
void |
exitClass(int bodyEnd,
int declarationEnd)
|
void |
exitCompilationUnit(int declarationEnd)
|
void |
exitConstructor(int bodyEnd,
int declarationEnd)
|
void |
exitField(int bodyEnd,
int declarationEnd)
|
void |
exitInterface(int bodyEnd,
int declarationEnd)
|
void |
exitMethod(int bodyEnd,
int declarationEnd)
|
acceptImport
void acceptImport(int declarationStart,
int declarationEnd,
int[] javaDocPositions,
char[] name,
int nameStartPosition,
boolean onDemand,
int modifiers)
- Parameters:
declarationStart
- - a source position corresponding to the start of the package
declarationdeclarationEnd
- - a source position corresponding to the end of the package
declarationjavaDocPositions
- - answer back an array of sourceStart/sourceEnd
positions of the available JavaDoc comments. The array is a flattened
structure: 2*n entries with consecutives start and end positions.
If no JavaDoc is available, then null is answered instead of an empty array.
e.g. { 10, 20, 25, 45 } --> javadoc1 from 10 to 20, javadoc2 from 25 to 45
The array is equals to null if there are no javadoc commentsname
- - the name of the packagenameStartPosition
- - a source position corresponding to the first character of the
nameonDemand
- - a boolean equals to true if the import is an import on demand
acceptInitializer
void acceptInitializer(int declarationStart,
int declarationEnd,
int[] javaDocPositions,
int modifiers,
int modifiersStart,
int bodyStart,
int bodyEnd)
- Parameters:
declarationStart
- - a source position corresponding to the start of the package
declarationdeclarationEnd
- - a source position corresponding to the end of the package
declarationjavaDocPositions
- - answer back an array of sourceStart/sourceEnd
positions of the available JavaDoc comments. The array is a flattened
structure: 2*n entries with consecutives start and end positions.
If no JavaDoc is available, then null is answered instead of an empty array.
e.g. { 10, 20, 25, 45 } --> javadoc1 from 10 to 20, javadoc2 from 25 to 45
The array is equals to null if there are no javadoc commentsmodifiers
- - the modifiers for this initializermodifiersStart
- - a source position corresponding to the start
of the textual modifiers, is < 0 if there are no textual modifiersbodyStart
- - the position of the '{'bodyEnd
- - the position of the '}'
acceptLineSeparatorPositions
void acceptLineSeparatorPositions(int[] positions)
acceptPackage
void acceptPackage(int declarationStart,
int declarationEnd,
int[] javaDocPositions,
char[] name,
int nameStartPosition)
- Parameters:
declarationStart
- - a source position corresponding to the start of the package
declarationdeclarationEnd
- - a source position corresponding to the end of the package
declarationjavaDocPositions
- - answer back an array of sourceStart/sourceEnd
positions of the available JavaDoc comments. The array is a flattened
structure: 2*n entries with consecutives start and end positions.
If no JavaDoc is available, then null is answered instead of an empty array.
e.g. { 10, 20, 25, 45 } --> javadoc1 from 10 to 20, javadoc2 from 25 to 45
The array is equals to null if there are no javadoc commentsname
- - the name of the packagenameStartPosition
- - a source position corresponding to the first character of the
name
acceptProblem
void acceptProblem(CategorizedProblem problem)
- Parameters:
problem
- - Used to report a problem while running the JDOM
enterClass
void enterClass(int declarationStart,
int[] javaDocPositions,
int modifiers,
int modifiersStart,
int classStart,
char[] name,
int nameStart,
int nameEnd,
char[] superclass,
int superclassStart,
int superclassEnd,
char[][] superinterfaces,
int[] superinterfaceStarts,
int[] superinterfaceEnds,
int bodyStart)
- Parameters:
declarationStart
- - a source position corresponding to the start
of this class.javaDocPositions
- - answer back an array of sourceStart/sourceEnd
positions of the available JavaDoc comments. The array is a flattened
structure: 2*n entries with consecutives start and end positions.
If no JavaDoc is available, then null is answered instead of an empty array.
e.g. { 10, 20, 25, 45 } --> javadoc1 from 10 to 20, javadoc2 from 25 to 45
The array is equals to null if there are no javadoc commentsmodifiers
- - the modifiers for this classmodifiersStart
- - a source position corresponding to the start
of the textual modifiers, is < 0 if there are no textual modifiersclassStart
- - a source position corresponding to the start
of the keyword 'class'name
- - the name of the classnameStart
- - a source position corresponding to the start of the namenameEnd
- - a source position corresponding to the end of the namesuperclass
- - the name of the superclasssuperclassStart
- - a source position corresponding to the start
of the superclass namesuperclassEnd
- - a source position corresponding to the end of the
superclass namesuperinterfaces
- - the name of the superinterfacessuperinterfaceStarts
- - an array of source positions corresponding
to the start of their respective superinterface namessuperinterfaceEnds
- - an array of source positions corresponding
to the end of their respective superinterface namesbodyStart
- - a source position corresponding to the open bracket
of the class body
enterCompilationUnit
void enterCompilationUnit()
enterConstructor
void enterConstructor(int declarationStart,
int[] javaDocPositions,
int modifiers,
int modifiersStart,
char[] name,
int nameStart,
int nameEnd,
char[][] parameterTypes,
int[] parameterTypeStarts,
int[] parameterTypeEnds,
char[][] parameterNames,
int[] parameterNameStarts,
int[] parameterNameEnds,
int parametersEnd,
char[][] exceptionTypes,
int[] exceptionTypeStarts,
int[] exceptionTypeEnds,
int bodyStart)
- Parameters:
declarationStart
- - a source position corresponding to the first character
of this constructor declarationjavaDocPositions
- - answer back an array of sourceStart/sourceEnd
positions of the available JavaDoc comments. The array is a flattened
structure: 2*n entries with consecutives start and end positions.
If no JavaDoc is available, then null is answered instead of an empty array.
e.g. { 10, 20, 25, 45 } --> javadoc1 from 10 to 20, javadoc2 from 25 to 45
The array is equals to null if there are no javadoc commentsmodifiers
- - the modifiers for this constructor converted to a flagmodifiersStart
- - a source position corresponding to the first character of the
textual modifiersname
- - the name of this constructornameStart
- - a source position corresponding to the first character of the namenameEnd
- - a source position corresponding to the last character of the nameparameterTypes
- - a list of parameter type namesparameterTypeStarts
- - a list of source positions corresponding to the
first character of each parameter type nameparameterTypeEnds
- - a list of source positions corresponding to the
last character of each parameter type nameparameterNames
- - a list of the names of the parametersparametersEnd
- - a source position corresponding to the last character of the
parameter listexceptionTypes
- - a list of the exception typesexceptionTypeStarts
- - a list of source positions corresponding to the first
character of the respective exception typesexceptionTypeEnds
- - a list of source positions corresponding to the last
character of the respective exception typesbodyStart
- - a source position corresponding to the start of this
constructor's body
enterField
void enterField(int declarationStart,
int[] javaDocPositions,
int modifiers,
int modifiersStart,
char[] type,
int typeStart,
int typeEnd,
int typeDimensionCount,
char[] name,
int nameStart,
int nameEnd,
int extendedTypeDimensionCount,
int extendedTypeDimensionEnd)
- Parameters:
declarationStart
- - a source position corresponding to the first character
of this fieldjavaDocPositions
- - answer back an array of sourceStart/sourceEnd
positions of the available JavaDoc comments. The array is a flattened
structure: 2*n entries with consecutives start and end positions.
If no JavaDoc is available, then null is answered instead of an empty array.
e.g. { 10, 20, 25, 45 } --> javadoc1 from 10 to 20, javadoc2 from 25 to 45
The array is equals to null if there are no javadoc commentsmodifiers
- - the modifiers for this field converted to a flagmodifiersStart
- - a source position corresponding to the first character of the
textual modifierstype
- - the name of the field typetypeStart
- - a source position corresponding to the start of the fields typetypeEnd
- - a source position corresponding to the end of the fields typetypeDimensionCount
- - the array dimension indicated on the type (for example, 'int[] v')name
- - the name of this constructornameStart
- - a source position corresponding to the first character of the namenameEnd
- - a source position corresponding to the last character of the nameextendedTypeDimensionCount
- - the array dimension indicated on the variable,
(for example, 'int v[]')extendedTypeDimensionEnd
- - a source position corresponding to the end of
the extened type dimension. This position should be -1 in case there is no extended
dimension for the type.
enterInterface
void enterInterface(int declarationStart,
int[] javaDocPositions,
int modifiers,
int modifiersStart,
int interfaceStart,
char[] name,
int nameStart,
int nameEnd,
char[][] superinterfaces,
int[] superinterfaceStarts,
int[] superinterfaceEnds,
int bodyStart)
- Parameters:
declarationStart
- - a source position corresponding to the start
of this class.javaDocPositions
- - answer back an array of sourceStart/sourceEnd
positions of the available JavaDoc comments. The array is a flattened
structure: 2*n entries with consecutives start and end positions.
If no JavaDoc is available, then null is answered instead of an empty array.
e.g. { 10, 20, 25, 45 } --> javadoc1 from 10 to 20, javadoc2 from 25 to 45
The array is equals to null if there are no javadoc commentsmodifiers
- - the modifiers for this classmodifiersStart
- - a source position corresponding to the start
of the textual modifiers, is < 0 if there are no textual modifiersinterfaceStart
- - a source position corresponding to the start
of the keyword 'interface'name
- - the name of the classnameStart
- - a source position corresponding to the start of the namenameEnd
- - a source position corresponding to the end of the namesuperinterfaces
- - the name of the superinterfacessuperinterfaceStarts
- - an array of source positions corresponding
to the start of their respective superinterface namessuperinterfaceEnds
- - an array of source positions corresponding
to the end of their respective superinterface namesbodyStart
- - a source position corresponding to the open bracket
of the class body
enterMethod
void enterMethod(int declarationStart,
int[] javaDocPositions,
int modifiers,
int modifiersStart,
char[] returnType,
int returnTypeStart,
int returnTypeEnd,
int returnTypeDimensionCount,
char[] name,
int nameStart,
int nameEnd,
char[][] parameterTypes,
int[] parameterTypeStarts,
int[] parameterTypeEnds,
char[][] parameterNames,
int[] parameterNameStarts,
int[] parameterNameEnds,
int parametersEnd,
int extendedReturnTypeDimensionCount,
int extendedReturnTypeDimensionEnd,
char[][] exceptionTypes,
int[] exceptionTypeStarts,
int[] exceptionTypeEnds,
int bodyStart)
- Parameters:
declarationStart
- - a source position corresponding to the first character
of this constructor declarationjavaDocPositions
- - answer back an array of sourceStart/sourceEnd
positions of the available JavaDoc comments. The array is a flattened
structure: 2*n entries with consecutives start and end positions.
If no JavaDoc is available, then null is answered instead of an empty array.
e.g. { 10, 20, 25, 45 } --> javadoc1 from 10 to 20, javadoc2 from 25 to 45
The array is equals to null if there are no javadoc commentsmodifiers
- - the modifiers for this constructor converted to a flagmodifiersStart
- - a source position corresponding to the first character of the
textual modifiersreturnType
- - the name of the return typereturnTypeStart
- - a source position corresponding to the first character
of the return typereturnTypeEnd
- - a source position corresponding to the last character
of the return typereturnTypeDimensionCount
- - the array dimension count as supplied on the
return type (for example, 'public int[] foo() {}')name
- - the name of this constructornameStart
- - a source position corresponding to the first character of the namenameEnd
- - a source position corresponding to the last character of the nameparameterTypes
- - a list of parameter type namesparameterTypeStarts
- - a list of source positions corresponding to the
first character of each parameter type nameparameterTypeEnds
- - a list of source positions corresponding to the
last character of each parameter type nameparameterNames
- - a list of the names of the parametersparametersEnd
- - a source position corresponding to the last character of the
parameter listextendedReturnTypeDimensionCount
- - the array dimension count as supplied on the
end of the parameter list (for example, 'public int foo()[] {}')extendedReturnTypeDimensionEnd
- - a source position corresponding to the last character
of the extended return type dimension. This position should be -1 in case there is no extended
dimension for the type.exceptionTypes
- - a list of the exception typesexceptionTypeStarts
- - a list of source positions corresponding to the first
character of the respective exception typesexceptionTypeEnds
- - a list of source positions corresponding to the last
character of the respective exception typesbodyStart
- - a source position corresponding to the start of this
method's body
exitClass
void exitClass(int bodyEnd,
int declarationEnd)
- Parameters:
bodyEnd
- - a source position corresponding to the closing bracket of the classdeclarationEnd
- - a source position corresponding to the end of the class
declaration. This can include whitespace and comments following the closing bracket.
exitCompilationUnit
void exitCompilationUnit(int declarationEnd)
- Parameters:
declarationEnd
- - a source position corresponding to the end of the compilation unit
exitConstructor
void exitConstructor(int bodyEnd,
int declarationEnd)
- Parameters:
bodyEnd
- - a source position corresponding to the closing bracket of the methoddeclarationEnd
- - a source position corresponding to the end of the method
declaration. This can include whitespace and comments following the closing bracket.
exitField
void exitField(int bodyEnd,
int declarationEnd)
- Parameters:
bodyEnd
- - a source position corresponding to the end of the field.declarationEnd
- - a source position corresponding to the end of the field.
This can include whitespace and comments following the semi-colon.
exitInterface
void exitInterface(int bodyEnd,
int declarationEnd)
- Parameters:
bodyEnd
- - a source position corresponding to the closing bracket of the interfacedeclarationEnd
- - a source position corresponding to the end of the interface
declaration. This can include whitespace and comments following the closing bracket.
exitMethod
void exitMethod(int bodyEnd,
int declarationEnd)
- Parameters:
bodyEnd
- - a source position corresponding to the closing bracket of the methoddeclarationEnd
- - a source position corresponding to the end of the method
declaration. This can include whitespace and comments following the closing bracket.