public class JPatternDictionary extends FacadeVisitor
JNode
s.Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,JAbstractType> |
abstractTypeMap |
protected java.util.Map<java.lang.String,JAnnotation> |
annotationMap |
protected java.util.Map<java.lang.String,JAnnotationTypeMember> |
annotationTypeMemberMap |
protected static java.util.regex.Pattern |
COMMENT |
protected JControlModel |
controlModel |
protected static boolean |
DEBUG |
protected java.util.Map<java.lang.String,JEnumConstant> |
enumConstantMap |
protected java.util.Map<java.lang.String,JField> |
fieldMap |
protected java.util.Map<java.lang.String,JImport> |
importMap |
protected java.util.Map<java.lang.String,JInitializer> |
initializerMap |
protected JPackage |
jPackage |
protected java.util.Map<java.lang.String,java.util.Collection<JNode>> |
markupMap |
protected java.util.Map<java.lang.String,JMethod> |
methodMap |
protected static java.lang.Object[] |
NO_ARGUMENTS |
protected java.util.Map<JNode,java.lang.String> |
nodeIdentifierMap |
protected java.util.Set<java.lang.String> |
noImportSet |
rootNode
Constructor and Description |
---|
JPatternDictionary(JCompilationUnit compilationUnit,
JControlModel controlModel) |
Modifier and Type | Method and Description |
---|---|
protected void |
beforeVisit(JNode node) |
protected java.lang.String |
checkSelection(java.lang.String selection,
JControlModel.DictionaryPattern dictionaryPattern,
JNode node)
Checks the selection to fix the problem with facade implementations that assign
wrong javadoc to the node.
|
protected static <K,V> java.lang.String |
dumpMap(java.lang.String lineIndent,
java.util.Map<K,V> map) |
protected void |
dumpMaps() |
java.util.Map<java.lang.String,JAbstractType> |
getAbstractTypeMap() |
java.util.Map<java.lang.String,JAnnotation> |
getAnnotationMap() |
java.util.Map<java.lang.String,JAnnotationTypeMember> |
getAnnotationTypeMemberMap() |
protected java.lang.String |
getDefaultNodeIdentifier(JNode node) |
java.util.Map<java.lang.String,JEnumConstant> |
getEnumConstantMap() |
java.util.Map<java.lang.String,JField> |
getFieldMap() |
java.util.Map<java.lang.String,JImport> |
getImportMap() |
java.util.Map<java.lang.String,JInitializer> |
getInitializerMap() |
JPackage |
getJPackage() |
java.util.Map<java.lang.String,java.util.Collection<JNode>> |
getMarkupMap() |
java.util.Map<java.lang.String,JMethod> |
getMethodMap() |
JNode |
getNode(java.lang.String nodeIdentifier) |
java.lang.String |
getNodeIdentifier(JNode node) |
java.util.Map<java.lang.String,? extends JNode> |
getNodeMap(JNode node) |
protected java.util.Set<java.lang.String> |
getNoImporterSet() |
boolean |
isMarkedUp(java.util.regex.Pattern markupPattern,
JNode node) |
boolean |
isMarkedUp(java.util.regex.Pattern markupPattern,
java.util.regex.Pattern parentMarkupPattern,
JNode node)
Determines if the node is marked up based on the node and parent markup.
|
boolean |
isNoImport(JImport jImport) |
protected void |
markupNode(java.lang.String selection,
JControlModel.DictionaryPattern dictionaryPattern,
JNode node)
Matches pattern in dictionary pattern against selection, and marks up node
with all matching groups.
|
protected void |
markupNode(java.lang.String markup,
JNode node)
Marks up node with the given markup string.
|
void |
reset()
Resets this JPatternDictionary.
|
protected boolean |
visit(JAbstractType abstractType) |
protected boolean |
visit(JAnnotation annotation) |
protected boolean |
visit(JAnnotationTypeMember annotationTypeMember) |
protected boolean |
visit(JCompilationUnit compilationUnit) |
protected boolean |
visit(JEnumConstant enumConstant) |
protected boolean |
visit(JField field) |
protected boolean |
visit(JImport jImport) |
protected boolean |
visit(JInitializer initializer) |
protected boolean |
visit(JMethod method) |
protected boolean |
visit(JPackage jPackage) |
afterVisit, afterVisitChildren, basicVisit, dispatch, getRootNode, start, visit, visitChildren
protected static final java.util.regex.Pattern COMMENT
protected static final java.lang.Object[] NO_ARGUMENTS
protected static final boolean DEBUG
protected JControlModel controlModel
protected JPackage jPackage
protected java.util.Map<java.lang.String,JAnnotation> annotationMap
protected java.util.Map<java.lang.String,JAnnotationTypeMember> annotationTypeMemberMap
protected java.util.Map<java.lang.String,JEnumConstant> enumConstantMap
protected java.util.Map<java.lang.String,JImport> importMap
protected java.util.Map<java.lang.String,JAbstractType> abstractTypeMap
protected java.util.Map<java.lang.String,JInitializer> initializerMap
protected java.util.Map<java.lang.String,JField> fieldMap
protected java.util.Map<java.lang.String,JMethod> methodMap
protected java.util.Map<java.lang.String,java.util.Collection<JNode>> markupMap
protected java.util.Set<java.lang.String> noImportSet
protected java.util.Map<JNode,java.lang.String> nodeIdentifierMap
public JPatternDictionary(JCompilationUnit compilationUnit, JControlModel controlModel)
public void reset()
FacadeVisitor.start(JNode)
passing a compilation unit to reuse this instance.public JPackage getJPackage()
public java.util.Map<java.lang.String,JImport> getImportMap()
public java.util.Map<java.lang.String,JAbstractType> getAbstractTypeMap()
public java.util.Map<java.lang.String,JInitializer> getInitializerMap()
public java.util.Map<java.lang.String,JField> getFieldMap()
public java.util.Map<java.lang.String,JMethod> getMethodMap()
public java.util.Map<java.lang.String,JAnnotation> getAnnotationMap()
public java.util.Map<java.lang.String,JAnnotationTypeMember> getAnnotationTypeMemberMap()
public java.util.Map<java.lang.String,JEnumConstant> getEnumConstantMap()
public java.util.Map<java.lang.String,java.util.Collection<JNode>> getMarkupMap()
public boolean isMarkedUp(java.util.regex.Pattern markupPattern, java.util.regex.Pattern parentMarkupPattern, JNode node)
If both patterns are null
, the node is marked up.
If both patterns are not null
, the node is marked up if the node itself and its
parent is marked up. If the node does not have a parent, the node is marked up if the node itself is marked up.
If only markupPattern
or parentMarkupPattern
is set, the node is marked up
if the node or its parent is marked up respectively.
markupPattern
- parentMarkupPattern
- node
- isMarkedUp(Pattern, JNode)
public boolean isMarkedUp(java.util.regex.Pattern markupPattern, JNode node)
protected java.util.Set<java.lang.String> getNoImporterSet()
public boolean isNoImport(JImport jImport)
protected boolean visit(JCompilationUnit compilationUnit)
visit
in class FacadeVisitor
protected boolean visit(JPackage jPackage)
visit
in class FacadeVisitor
protected boolean visit(JAbstractType abstractType)
visit
in class FacadeVisitor
protected boolean visit(JImport jImport)
visit
in class FacadeVisitor
protected boolean visit(JInitializer initializer)
visit
in class FacadeVisitor
protected boolean visit(JField field)
visit
in class FacadeVisitor
protected boolean visit(JMethod method)
visit
in class FacadeVisitor
protected boolean visit(JAnnotation annotation)
visit
in class FacadeVisitor
protected boolean visit(JAnnotationTypeMember annotationTypeMember)
visit
in class FacadeVisitor
protected boolean visit(JEnumConstant enumConstant)
visit
in class FacadeVisitor
protected void beforeVisit(JNode node)
beforeVisit
in class FacadeVisitor
protected java.lang.String checkSelection(java.lang.String selection, JControlModel.DictionaryPattern dictionaryPattern, JNode node)
selection
- dictionaryPattern
- node
- null
if the node should be skippedprotected void markupNode(java.lang.String selection, JControlModel.DictionaryPattern dictionaryPattern, JNode node)
If pattern matches selection, but no groups are defined, node is marked up with dictionary pattern name.
selection
- dictionaryPattern
- node
- protected void markupNode(java.lang.String markup, JNode node)
markup
- node
- protected void dumpMaps()
protected static <K,V> java.lang.String dumpMap(java.lang.String lineIndent, java.util.Map<K,V> map)
public java.lang.String getNodeIdentifier(JNode node)
protected java.lang.String getDefaultNodeIdentifier(JNode node)
public JNode getNode(java.lang.String nodeIdentifier)