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,
javax.jcr.Node parentNode)
Annotation:
NormalAnnotation
MarkerAnnotation
SingleMemberAnnotation
NormalAnnotation:
\@ TypeName ( [ MemberValuePair { , MemberValuePair } ] )
MarkerAnnotation:
\@ TypeName
SingleMemberAnnotation:
\@ TypeName ( Expression )
MemberValuePair:
SimpleName = Expression
|
protected javax.jcr.Node |
record(org.eclipse.jdt.core.dom.AnnotationTypeDeclaration annotationType,
javax.jcr.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,
javax.jcr.Node parentNode)
AnnotationTypeMemberDeclaration:
[ Javadoc ] { ExtendedModifier }
Type Identifier ( ) [ default Expression ] ;
|
protected void |
record(org.eclipse.jdt.core.dom.Block block,
javax.jcr.Node blockNode)
Block:
{ { Statement } }
|
protected void |
record(org.eclipse.jdt.core.dom.Comment comment,
javax.jcr.Node parentNode)
Comment:
LineComment
BlockComment
Javadoc
|
protected void |
record(org.eclipse.jdt.core.dom.CompilationUnit unit,
javax.jcr.Node compilationUnitNode)
CompilationUnit:
[ PackageDeclaration ]
{ ImportDeclaration }
{ TypeDeclaration | EnumDeclaration | AnnotationTypeDeclaration | ; }
|
protected void |
record(org.eclipse.jdt.core.dom.EnumConstantDeclaration enumConstant,
javax.jcr.Node parentNode)
EnumConstantDeclaration:
[ Javadoc ] { ExtendedModifier } Identifier
[ ( [ Expression { , Expression } ] ) ]
[ AnonymousClassDeclaration ]
|
protected javax.jcr.Node |
record(org.eclipse.jdt.core.dom.EnumDeclaration enumType,
javax.jcr.Node parentNode)
EnumDeclaration:
[ Javadoc ] { ExtendedModifier } enum Identifier
[ implements Type { , Type } ]
{
[ EnumConstantDeclaration { , EnumConstantDeclaration } ] [ , ]
[ ; { ClassBodyDeclaration | ; } ]
}
|
protected void |
record(org.eclipse.jdt.core.dom.FieldDeclaration field,
javax.jcr.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,
javax.jcr.Node parentNode)
Initializer:
[ static ] Block
Block:
{ { Statement } }
|
protected void |
record(org.eclipse.jdt.core.dom.MethodDeclaration method,
javax.jcr.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,
javax.jcr.Node outputNode)
Convert the compilation unit into JCR nodes.
|
void |
record(Sequencer.Context context,
InputStream inputStream,
long length,
String encoding,
javax.jcr.Node outputNode)
Records a source file.
|
protected void |
record(org.eclipse.jdt.core.dom.SingleVariableDeclaration variable,
javax.jcr.Node parentNode)
SingleVariableDeclaration:
{ ExtendedModifier } Type [ ... ] Identifier { [] } [ = Expression ]
|
protected javax.jcr.Node |
record(org.eclipse.jdt.core.dom.TypeDeclaration type,
javax.jcr.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,
javax.jcr.Node parentNode)
TypeParameter:
TypeVariable [ extends Type { & Type } ]
|
protected void |
record(org.eclipse.jdt.core.dom.Type type,
String typeNodeName,
javax.jcr.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,
javax.jcr.Node parentNode) |
protected void |
recordAnnotations(List<org.eclipse.jdt.core.dom.IExtendedModifier> extendedModifiers,
javax.jcr.Node node) |
protected void |
recordBodyDeclarations(org.eclipse.jdt.core.dom.AbstractTypeDeclaration type,
javax.jcr.Node typeNode) |
protected void |
recordBodyDeclarations(org.eclipse.jdt.core.dom.AnonymousClassDeclaration anonClass,
javax.jcr.Node enumConstantNode) |
protected void |
recordComments(org.eclipse.jdt.core.dom.CompilationUnit compilationUnit,
javax.jcr.Node outputNode)
Comment:
LineComment
BlockComment
Javadoc
|
protected void |
recordCompilerMessages(org.eclipse.jdt.core.dom.CompilationUnit unit,
javax.jcr.Node parentNode) |
protected void |
recordExpression(org.eclipse.jdt.core.dom.Expression expression,
String nodeName,
javax.jcr.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,
javax.jcr.Node outputNode)
ImportDeclaration:
import [ static ] Name [ . * ] ;
|
protected javax.jcr.Node |
recordPackage(org.eclipse.jdt.core.dom.CompilationUnit compilationUnit,
javax.jcr.Node outputNode)
PackageDeclaration:
[ Javadoc ] { Annotation } package Name ;
|
protected void |
recordSourceReference(org.eclipse.jdt.core.dom.ASTNode astNode,
javax.jcr.Node jcrNode) |
protected void |
recordTypes(org.eclipse.jdt.core.dom.CompilationUnit unit,
javax.jcr.Node compilationUnitNode,
javax.jcr.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, javax.jcr.Node parentNode) throws Exception
Annotation: NormalAnnotation MarkerAnnotation SingleMemberAnnotation NormalAnnotation: \@ TypeName ( [ MemberValuePair { , MemberValuePair } ] ) MarkerAnnotation: \@ TypeName SingleMemberAnnotation: \@ TypeName ( Expression ) MemberValuePair: SimpleName = Expression
annotation
- the annotation
being recorded (cannot be null
)parentNode
- the parent node
where the annotation will be created (cannot be null
)Exception
- if there is a problemprotected javax.jcr.Node record(org.eclipse.jdt.core.dom.AnnotationTypeDeclaration annotationType, javax.jcr.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, javax.jcr.Node parentNode) throws Exception
AnnotationTypeMemberDeclaration: [ Javadoc ] { ExtendedModifier } Type Identifier ( ) [ default Expression ] ;
annotationTypeMember
- the annotation type member
being recorded (cannot be
null
)parentNode
- the parent node
where the annotation type members will be added (cannot be null
)Exception
- if there is a problemprotected void record(org.eclipse.jdt.core.dom.Block block, javax.jcr.Node blockNode) throws Exception
Block: { { Statement } }
block
- the block
being recorded (cannot be null
)blockNode
- the parent node
where the statements will be added (cannot be null
)Exception
- if there is a problemprotected void record(org.eclipse.jdt.core.dom.Comment comment, javax.jcr.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, javax.jcr.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, javax.jcr.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, javax.jcr.Node parentNode) throws Exception
EnumConstantDeclaration: [ Javadoc ] { ExtendedModifier } Identifier [ ( [ Expression { , Expression } ] ) ] [ AnonymousClassDeclaration ]
enumConstant
- the enum constant being processed (cannot be null
)parentNode
- the node
where the enum constant node will be created (cannot be null
)Exception
- if there is a problemprotected javax.jcr.Node record(org.eclipse.jdt.core.dom.EnumDeclaration enumType, javax.jcr.Node parentNode) throws Exception
EnumDeclaration: [ Javadoc ] { ExtendedModifier } enum Identifier [ implements Type { , Type } ] { [ EnumConstantDeclaration { , EnumConstantDeclaration } ] [ , ] [ ; { ClassBodyDeclaration | ; } ] }
enumType
- the enum
being recorded (cannot be null
)parentNode
- the parent node
(cannot be null
)null
)Exception
- if there is a problemprotected void record(org.eclipse.jdt.core.dom.FieldDeclaration field, javax.jcr.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.
field
- the field
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.Initializer initializer, String nodeName, javax.jcr.Node parentNode) throws Exception
Initializer: [ static ] Block Block: { { Statement } }
initializer
- the initializer
being recorded (cannot be null
)nodeName
- the name of the node being created that represents the initializer (cannot be null
or empty)parentNode
- the parent node
(cannot be null
)Exception
- if there is a problemprotected void record(org.eclipse.jdt.core.dom.MethodDeclaration method, javax.jcr.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
method
- the method
being recorded (cannot be null
)parentNode
- the parent node
(cannot be null
)Exception
- if there is a problemprotected void record(Sequencer.Context context, char[] sourceCode, javax.jcr.Node outputNode) throws Exception
context
- the sequencer contextsourceCode
- the source code being recorded (can be null
if there is no source code)outputNode
- the node
where the output will be saved (cannot be null
)Exception
- if there is a problemprotected void record(org.eclipse.jdt.core.dom.SingleVariableDeclaration variable, javax.jcr.Node parentNode) throws Exception
SingleVariableDeclaration: { ExtendedModifier } Type [ ... ] Identifier { [] } [ = Expression ]
variable
- the variable
being recorded (cannot be null
)parentNode
- the parent node
where the variable is being recorded (cannot be null
)Exception
- if there is a problemprotected void record(org.eclipse.jdt.core.dom.Type type, String typeNodeName, javax.jcr.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 ]
type
- the type type
being recorded (cannot be null
)typeNodeName
- the name of the type node being recorded (cannot be null
or empty)parentNode
- the parent node
where the type will be recorded (cannot be null
)Exception
- if there is a problemprotected javax.jcr.Node record(org.eclipse.jdt.core.dom.TypeDeclaration type, javax.jcr.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 | ; } }
type
- the type
being recorded (cannot be null
)parentNode
- the parent node
where the new type will be created (cannot be null
)null
)Exception
- if there is a problemprotected void record(org.eclipse.jdt.core.dom.TypeParameter param, javax.jcr.Node parentNode) throws Exception
TypeParameter: TypeVariable [ extends Type { & Type } ]
param
- the type parameter
being recorded (cannot be null
)parentNode
- the parent node
where the type parameter will be recorded (cannot be null
)Exception
- if there is a problemprotected void recordAnnotationMember(String memberName, org.eclipse.jdt.core.dom.Expression expression, javax.jcr.Node parentNode) throws Exception
Exception
protected void recordAnnotations(List<org.eclipse.jdt.core.dom.IExtendedModifier> extendedModifiers, javax.jcr.Node node) throws Exception
Exception
protected void recordBodyDeclarations(org.eclipse.jdt.core.dom.AbstractTypeDeclaration type, javax.jcr.Node typeNode) throws Exception
Exception
protected void recordBodyDeclarations(org.eclipse.jdt.core.dom.AnonymousClassDeclaration anonClass, javax.jcr.Node enumConstantNode) throws Exception
Exception
protected void recordComments(org.eclipse.jdt.core.dom.CompilationUnit compilationUnit, javax.jcr.Node outputNode) throws Exception
Comment: LineComment BlockComment Javadoc
compilationUnit
- the compilation unit
being recorded (cannot be null
)outputNode
- the parent node
(cannot be null
)Exception
- if there is a problemprotected void recordCompilerMessages(org.eclipse.jdt.core.dom.CompilationUnit unit, javax.jcr.Node parentNode) throws Exception
Exception
protected void recordExpression(org.eclipse.jdt.core.dom.Expression expression, String nodeName, javax.jcr.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
expression
- the expression
being recorded (cannot be null
)nodeName
- the name of the expression node that is created (cannot be null
or empty)parentNode
- the parent node
where the expression is being recorded (cannot be null
)Exception
- if there is a problemprotected void recordImports(org.eclipse.jdt.core.dom.CompilationUnit compilationUnit, javax.jcr.Node outputNode) throws Exception
ImportDeclaration: import [ static ] Name [ . * ] ;
compilationUnit
- the compilation unit
being recorded (cannot be null
)outputNode
- the parent node
(cannot be null
)Exception
- if there is a problemprotected javax.jcr.Node recordPackage(org.eclipse.jdt.core.dom.CompilationUnit compilationUnit, javax.jcr.Node outputNode) throws Exception
PackageDeclaration: [ Javadoc ] { Annotation } package Name ;
compilationUnit
- the compilation unit
whose package is being recorded (cannot be
null
)outputNode
- the output node (cannot be null
)node
or the passed in outputNode
if a package is not foundException
- if there is a problemprotected void recordSourceReference(org.eclipse.jdt.core.dom.ASTNode astNode, javax.jcr.Node jcrNode) throws Exception
Exception
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.