public class JdtRecorder extends Object implements SourceFileRecorder
CompilationUnit: [ PackageDeclaration ] { ImportDeclaration } { TypeDeclaration | EnumDeclaration | AnnotationTypeDeclaration | ; } PackageDeclaration: [ Javadoc ] { Annotation } package Name ; ImportDeclaration: import [ static ] Name [ . * ] ; TypeDeclaration: ClassDeclaration InterfaceDeclaration ClassDeclaration: [ Javadoc ] { ExtendedModifier } class Identifier [ < TypeParameter { , TypeParameter } > ] [ extends Type ] [ implements Type { , Type } ] { { ClassBodyDeclaration | ; } } InterfaceDeclaration: [ Javadoc ] { ExtendedModifier } interface Identifier [ < TypeParameter { , TypeParameter } > ] [ extends Type { , Type } ] { { InterfaceBodyDeclaration | ; } }
Constructor and Description |
---|
JdtRecorder() |
Modifier and Type | Method and Description |
---|---|
protected String |
getSourceCode(int startPosition,
int length) |
protected String |
getTypeName(org.eclipse.jdt.core.dom.Type type) |
protected String |
getVisibility(int modifiers) |
protected void |
record(org.eclipse.jdt.core.dom.Annotation annotation,
Node parentNode)
Annotation:
NormalAnnotation
MarkerAnnotation
SingleMemberAnnotation
NormalAnnotation:
\@ TypeName ( [ MemberValuePair { , MemberValuePair } ] )
MarkerAnnotation:
\@ TypeName
SingleMemberAnnotation:
\@ TypeName ( Expression )
MemberValuePair:
SimpleName = Expression
|
protected Node |
record(org.eclipse.jdt.core.dom.AnnotationTypeDeclaration annotationType,
Node outputNode)
AnnotationTypeDeclaration:
[ Javadoc ] { ExtendedModifier } @ interface Identifier
{ { AnnotationTypeBodyDeclaration | ; } }
AnnotationTypeBodyDeclaration:
AnnotationTypeMemberDeclaration
FieldDeclaration
TypeDeclaration
EnumDeclaration
AnnotationTypeDeclaration
AnnotationTypeMemberDeclaration:
[ Javadoc ] { ExtendedModifier }
Type Identifier ( ) [ default Expression ] ;
|
protected void |
record(org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration annotationTypeMember,
Node parentNode)
AnnotationTypeMemberDeclaration:
[ Javadoc ] { ExtendedModifier }
Type Identifier ( ) [ default Expression ] ;
|
protected void |
record(org.eclipse.jdt.core.dom.Block block,
Node blockNode)
Block:
{ { Statement } }
|
protected void |
record(org.eclipse.jdt.core.dom.Comment comment,
Node parentNode)
Comment:
LineComment
BlockComment
Javadoc
|
protected void |
record(org.eclipse.jdt.core.dom.CompilationUnit unit,
Node compilationUnitNode)
CompilationUnit:
[ PackageDeclaration ]
{ ImportDeclaration }
{ TypeDeclaration | EnumDeclaration | AnnotationTypeDeclaration | ; }
|
protected void |
record(org.eclipse.jdt.core.dom.EnumConstantDeclaration enumConstant,
Node parentNode)
EnumConstantDeclaration:
[ Javadoc ] { ExtendedModifier } Identifier
[ ( [ Expression { , Expression } ] ) ]
[ AnonymousClassDeclaration ]
|
protected Node |
record(org.eclipse.jdt.core.dom.EnumDeclaration enumType,
Node parentNode)
EnumDeclaration:
[ Javadoc ] { ExtendedModifier } enum Identifier
[ implements Type { , Type } ]
{
[ EnumConstantDeclaration { , EnumConstantDeclaration } ] [ , ]
[ ; { ClassBodyDeclaration | ; } ]
}
|
protected void |
record(org.eclipse.jdt.core.dom.FieldDeclaration field,
Node parentNode)
FieldDeclaration:
[Javadoc] { ExtendedModifier } Type VariableDeclarationFragment
{ , VariableDeclarationFragment } ;
VariableDeclarationFragment:
Identifier { [] } [ = Expression ]
A field container node will be created if one does not exist under
node. |
protected void |
record(org.eclipse.jdt.core.dom.Initializer initializer,
String nodeName,
Node parentNode)
Initializer:
[ static ] Block
Block:
{ { Statement } }
|
protected void |
record(org.eclipse.jdt.core.dom.MethodDeclaration method,
Node parentNode)
MethodDeclaration:
[ Javadoc ] { ExtendedModifier }
[ < TypeParameter { , TypeParameter } > ]
( Type | void ) Identifier (
[ FormalParameter
{ , FormalParameter } ] ) {[ ] }
[ throws TypeName { , TypeName } ] ( Block | ; )
ConstructorDeclaration:
[ Javadoc ] { ExtendedModifier }
[ < TypeParameter { , TypeParameter } > ]
Identifier (
[ FormalParameter
{ , FormalParameter } ] )
[throws TypeName { , TypeName } ] Block
|
protected void |
record(Sequencer.Context context,
char[] sourceCode,
Node outputNode)
Convert the compilation unit into JCR nodes.
|
void |
record(Sequencer.Context context,
InputStream inputStream,
long length,
String encoding,
Node outputNode)
Records a source file.
|
protected void |
record(org.eclipse.jdt.core.dom.SingleVariableDeclaration variable,
Node parentNode)
SingleVariableDeclaration:
{ ExtendedModifier } Type [ ... ] Identifier { [] } [ = Expression ]
|
protected Node |
record(org.eclipse.jdt.core.dom.TypeDeclaration type,
Node parentNode)
TypeDeclaration:
ClassDeclaration
InterfaceDeclaration
ClassDeclaration:
[ Javadoc ] { ExtendedModifier } class Identifier
[ < TypeParameter { , TypeParameter } > ]
[ extends Type ]
[ implements Type { , Type } ]
{ { ClassBodyDeclaration | ; } }
InterfaceDeclaration:
[ Javadoc ] { ExtendedModifier } interface Identifier
[ < TypeParameter { , TypeParameter } > ]
[ extends Type { , Type } ]
{ { InterfaceBodyDeclaration | ; } }
|
protected void |
record(org.eclipse.jdt.core.dom.TypeParameter param,
Node parentNode)
TypeParameter:
TypeVariable [ extends Type { & Type } ]
|
protected void |
record(org.eclipse.jdt.core.dom.Type type,
String typeNodeName,
Node parentNode)
Type:
PrimitiveType
ArrayType
SimpleType
QualifiedType
ParameterizedType
WildcardType
PrimitiveType:
byte
short
char
int
long
float
double
boolean
void
ArrayType:
Type [ ]
SimpleType:
TypeName
ParameterizedType:
Type < Type { , Type } >
QualifiedType:
Type .
|
protected void |
recordAnnotationMember(String memberName,
org.eclipse.jdt.core.dom.Expression expression,
Node parentNode) |
protected void |
recordAnnotations(List<org.eclipse.jdt.core.dom.IExtendedModifier> extendedModifiers,
Node node) |
protected void |
recordBodyDeclarations(org.eclipse.jdt.core.dom.AbstractTypeDeclaration type,
Node typeNode) |
protected void |
recordBodyDeclarations(org.eclipse.jdt.core.dom.AnonymousClassDeclaration anonClass,
Node enumConstantNode) |
protected void |
recordComments(org.eclipse.jdt.core.dom.CompilationUnit compilationUnit,
Node outputNode)
Comment:
LineComment
BlockComment
Javadoc
|
protected void |
recordCompilerMessages(org.eclipse.jdt.core.dom.CompilationUnit unit,
Node parentNode) |
protected void |
recordExpression(org.eclipse.jdt.core.dom.Expression expression,
String nodeName,
Node parentNode)
Expression:
Annotation,
ArrayAccess,
ArrayCreation,
ArrayInitializer,
Assignment,
BooleanLiteral,
CastExpression,
CharacterLiteral,
ClassInstanceCreation,
ConditionalExpression,
FieldAccess,
InfixExpression,
InstanceofExpression,
MethodInvocation,
Name,
NullLiteral,
NumberLiteral,
ParenthesizedExpression,
PostfixExpression,
PrefixExpression,
StringLiteral,
SuperFieldAccess,
SuperMethodInvocation,
ThisExpression,
TypeLiteral,
VariableDeclarationExpression
|
protected void |
recordImports(org.eclipse.jdt.core.dom.CompilationUnit compilationUnit,
Node outputNode)
ImportDeclaration:
import [ static ] Name [ . * ] ;
|
protected Node |
recordPackage(org.eclipse.jdt.core.dom.CompilationUnit compilationUnit,
Node outputNode)
PackageDeclaration:
[ Javadoc ] { Annotation } package Name ;
|
protected void |
recordSourceReference(org.eclipse.jdt.core.dom.ASTNode astNode,
Node jcrNode) |
protected void |
recordTypes(org.eclipse.jdt.core.dom.CompilationUnit unit,
Node compilationUnitNode,
Node pkgNode) |
protected String getSourceCode(int startPosition, int length)
protected String getTypeName(org.eclipse.jdt.core.dom.Type type)
protected String getVisibility(int modifiers)
protected void record(org.eclipse.jdt.core.dom.Annotation annotation, Node parentNode) throws Exception
Annotation: NormalAnnotation MarkerAnnotation SingleMemberAnnotation NormalAnnotation: \@ TypeName ( [ MemberValuePair { , MemberValuePair } ] ) MarkerAnnotation: \@ TypeName SingleMemberAnnotation: \@ TypeName ( Expression ) MemberValuePair: SimpleName = Expression
protected Node record(org.eclipse.jdt.core.dom.AnnotationTypeDeclaration annotationType, Node outputNode) throws Exception
AnnotationTypeDeclaration: [ Javadoc ] { ExtendedModifier } @ interface Identifier { { AnnotationTypeBodyDeclaration | ; } } AnnotationTypeBodyDeclaration: AnnotationTypeMemberDeclaration FieldDeclaration TypeDeclaration EnumDeclaration AnnotationTypeDeclaration AnnotationTypeMemberDeclaration: [ Javadoc ] { ExtendedModifier } Type Identifier ( ) [ default Expression ] ;
annotationType
- the annotation type
being recorded (cannot be null
)outputNode
- the output node where the annotation type should be created (cannot be null
)null
)Exception
- if there is a problemprotected void record(org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration annotationTypeMember, Node parentNode) throws Exception
AnnotationTypeMemberDeclaration: [ Javadoc ] { ExtendedModifier } Type Identifier ( ) [ default Expression ] ;
protected void record(org.eclipse.jdt.core.dom.Block block, Node blockNode) throws Exception
Block: { { Statement } }
protected void record(org.eclipse.jdt.core.dom.Comment comment, Node parentNode) throws Exception
Comment: LineComment BlockComment Javadoc
comment
- the comment being recorded (cannot be null
)parentNode
- the parent node
(cannot be null
)Exception
- if there is a problemprotected void record(org.eclipse.jdt.core.dom.CompilationUnit unit, Node compilationUnitNode) throws Exception
CompilationUnit: [ PackageDeclaration ] { ImportDeclaration } { TypeDeclaration | EnumDeclaration | AnnotationTypeDeclaration | ; }
unit
- the compilation unit
being recorded (cannot be null
)compilationUnitNode
- the output node associated with the compilation unit (cannot be null
)Exception
- if there is a problempublic void record(Sequencer.Context context, InputStream inputStream, long length, String encoding, Node outputNode) throws Exception
record
in interface SourceFileRecorder
context
- the sequencer context (cannot be null
)inputStream
- the stream being processed (cannot be null
)length
- the length of the java fileencoding
- the encoding to use (can be null
)outputNode
- the Node
output (cannot be null
)Exception
- if anything fails during the sequencing processSourceFileRecorder.record(org.modeshape.jcr.api.sequencer.Sequencer.Context,
java.io.InputStream, long, java.lang.String, javax.jcr.Node)
protected void record(org.eclipse.jdt.core.dom.EnumConstantDeclaration enumConstant, Node parentNode) throws Exception
EnumConstantDeclaration: [ Javadoc ] { ExtendedModifier } Identifier [ ( [ Expression { , Expression } ] ) ] [ AnonymousClassDeclaration ]
protected Node record(org.eclipse.jdt.core.dom.EnumDeclaration enumType, Node parentNode) throws Exception
EnumDeclaration: [ Javadoc ] { ExtendedModifier } enum Identifier [ implements Type { , Type } ] { [ EnumConstantDeclaration { , EnumConstantDeclaration } ] [ , ] [ ; { ClassBodyDeclaration | ; } ] }
protected void record(org.eclipse.jdt.core.dom.FieldDeclaration field, Node parentNode) throws Exception
FieldDeclaration: [Javadoc] { ExtendedModifier } Type VariableDeclarationFragment { , VariableDeclarationFragment } ; VariableDeclarationFragment: Identifier { [] } [ = Expression ]A field container node will be created if one does not exist under
node.
protected void record(org.eclipse.jdt.core.dom.Initializer initializer, String nodeName, Node parentNode) throws Exception
Initializer: [ static ] Block Block: { { Statement } }
protected void record(org.eclipse.jdt.core.dom.MethodDeclaration method, Node parentNode) throws Exception
MethodDeclaration: [ Javadoc ] { ExtendedModifier } [ < TypeParameter { , TypeParameter } > ] ( Type | void ) Identifier ( [ FormalParameter { , FormalParameter } ] ) {[ ] } [ throws TypeName { , TypeName } ] ( Block | ; ) ConstructorDeclaration: [ Javadoc ] { ExtendedModifier } [ < TypeParameter { , TypeParameter } > ] Identifier ( [ FormalParameter { , FormalParameter } ] ) [throws TypeName { , TypeName } ] Block
protected void record(Sequencer.Context context, char[] sourceCode, Node outputNode) throws Exception
protected void record(org.eclipse.jdt.core.dom.SingleVariableDeclaration variable, Node parentNode) throws Exception
SingleVariableDeclaration: { ExtendedModifier } Type [ ... ] Identifier { [] } [ = Expression ]
protected void record(org.eclipse.jdt.core.dom.Type type, String typeNodeName, Node parentNode) throws Exception
Type: PrimitiveType ArrayType SimpleType QualifiedType ParameterizedType WildcardType PrimitiveType: byte short char int long float double boolean void ArrayType: Type [ ] SimpleType: TypeName ParameterizedType: Type < Type { , Type } > QualifiedType: Type . SimpleName WildcardType: ? [ ( extends | super) Type ]
protected Node record(org.eclipse.jdt.core.dom.TypeDeclaration type, Node parentNode) throws Exception
TypeDeclaration: ClassDeclaration InterfaceDeclaration ClassDeclaration: [ Javadoc ] { ExtendedModifier } class Identifier [ < TypeParameter { , TypeParameter } > ] [ extends Type ] [ implements Type { , Type } ] { { ClassBodyDeclaration | ; } } InterfaceDeclaration: [ Javadoc ] { ExtendedModifier } interface Identifier [ < TypeParameter { , TypeParameter } > ] [ extends Type { , Type } ] { { InterfaceBodyDeclaration | ; } }
protected void record(org.eclipse.jdt.core.dom.TypeParameter param, Node parentNode) throws Exception
TypeParameter: TypeVariable [ extends Type { & Type } ]
protected void recordAnnotationMember(String memberName, org.eclipse.jdt.core.dom.Expression expression, Node parentNode) throws Exception
Exception
protected void recordAnnotations(List<org.eclipse.jdt.core.dom.IExtendedModifier> extendedModifiers, Node node) throws Exception
Exception
protected void recordBodyDeclarations(org.eclipse.jdt.core.dom.AbstractTypeDeclaration type, Node typeNode) throws Exception
Exception
protected void recordBodyDeclarations(org.eclipse.jdt.core.dom.AnonymousClassDeclaration anonClass, Node enumConstantNode) throws Exception
Exception
protected void recordComments(org.eclipse.jdt.core.dom.CompilationUnit compilationUnit, Node outputNode) throws Exception
Comment: LineComment BlockComment Javadoc
protected void recordCompilerMessages(org.eclipse.jdt.core.dom.CompilationUnit unit, Node parentNode) throws Exception
Exception
protected void recordExpression(org.eclipse.jdt.core.dom.Expression expression, String nodeName, Node parentNode) throws Exception
Expression: Annotation, ArrayAccess, ArrayCreation, ArrayInitializer, Assignment, BooleanLiteral, CastExpression, CharacterLiteral, ClassInstanceCreation, ConditionalExpression, FieldAccess, InfixExpression, InstanceofExpression, MethodInvocation, Name, NullLiteral, NumberLiteral, ParenthesizedExpression, PostfixExpression, PrefixExpression, StringLiteral, SuperFieldAccess, SuperMethodInvocation, ThisExpression, TypeLiteral, VariableDeclarationExpression
protected void recordImports(org.eclipse.jdt.core.dom.CompilationUnit compilationUnit, Node outputNode) throws Exception
ImportDeclaration: import [ static ] Name [ . * ] ;
protected Node recordPackage(org.eclipse.jdt.core.dom.CompilationUnit compilationUnit, Node outputNode) throws Exception
PackageDeclaration: [ Javadoc ] { Annotation } package Name ;
protected void recordSourceReference(org.eclipse.jdt.core.dom.ASTNode astNode, Node jcrNode) throws Exception
Exception
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.