Package org.jibx.schema.codegen
Class SchemaDocumentationGenerator.DocumentationVisitor
- java.lang.Object
-
- org.jibx.schema.SchemaVisitor
-
- org.jibx.schema.codegen.SchemaDocumentationGenerator.DocumentationVisitor
-
- Enclosing class:
- SchemaDocumentationGenerator
private class SchemaDocumentationGenerator.DocumentationVisitor extends SchemaVisitor
Visitor to write the filtered view of a schema definition matching the data structure of a class. This uses a supplied map for components which are represented by separate classes, which need to be replaced in the filtered view by a reference to the appropriate class.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringm_classNameFully-qualified name of class containing documentation.private AnnotatedBasem_componentRoot component to be documented.private java.util.Mapm_componentClassMapMap from schema components with separate classes to the class information.private booleanm_dropAnnotationsDelete annotations from schema documentation flag.private int[]m_nsIndexesNamespace indexes for use on marshalling root element.private java.lang.String[]m_nsPrefixesNamespace prefixes for use on marshalling root element.private booleanm_referenceReference component with separate class flag.
-
Constructor Summary
Constructors Constructor Description DocumentationVisitor(java.util.Map comptoclas, java.lang.String clasname, AnnotatedBase comp, boolean dropanno, boolean ref, int[] indexes, java.lang.String[] prefixes)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexit(AnnotationElement node)Exit an annotation element.voidexit(ElementElement node)Exit an element element.voidexit(KeyBase node)Exit an identity constraint element.voidexit(SchemaBase node)Exit a schema node.booleanvisit(AnnotationElement node)Visit an annotation element.booleanvisit(ElementElement node)Visit an element element.booleanvisit(KeyBase node)Visit an identity constraint element.booleanvisit(SchemaBase node)Visit a schema node.-
Methods inherited from class org.jibx.schema.SchemaVisitor
exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
-
-
-
Field Detail
-
m_componentClassMap
private final java.util.Map m_componentClassMap
Map from schema components with separate classes to the class information.
-
m_className
private final java.lang.String m_className
Fully-qualified name of class containing documentation.
-
m_component
private final AnnotatedBase m_component
Root component to be documented.
-
m_dropAnnotations
private final boolean m_dropAnnotations
Delete annotations from schema documentation flag.
-
m_reference
private final boolean m_reference
Reference component with separate class flag.
-
m_nsIndexes
private final int[] m_nsIndexes
Namespace indexes for use on marshalling root element.
-
m_nsPrefixes
private final java.lang.String[] m_nsPrefixes
Namespace prefixes for use on marshalling root element.
-
-
Constructor Detail
-
DocumentationVisitor
public DocumentationVisitor(java.util.Map comptoclas, java.lang.String clasname, AnnotatedBase comp, boolean dropanno, boolean ref, int[] indexes, java.lang.String[] prefixes)Constructor.- Parameters:
comptoclas- map from schema components to class informationclasname- fully-qualified class name to be stripped from class referencescomp- top-level component for documentationdropanno- delete annotations from schema documentation flagref- reference component with separate class flagindexes- namespace indexes for use on marshalling root elementprefixes- namespace prefixes for use on marshalling root element
-
-
Method Detail
-
exit
public void exit(SchemaBase node)
Exit a schema node. This just writes the end tag for the node.- Overrides:
exitin classSchemaVisitor- Parameters:
node-
-
exit
public void exit(AnnotationElement node)
Exit an annotation element. If annotations are being deleted, this just returns without calling the next-level method, so that no close tag will be written.- Overrides:
exitin classSchemaVisitor- Parameters:
node-
-
exit
public void exit(ElementElement node)
Exit an element element. If the extension says the element is excluded, this just returns without calling the next-level method, so that no close tag will be written.- Overrides:
exitin classSchemaVisitor- Parameters:
node-
-
exit
public void exit(KeyBase node)
Exit an identity constraint element. This just always returns immediately, since the identity constraint elements are handled in-line in the binding.- Overrides:
exitin classSchemaVisitor- Parameters:
node-
-
visit
public boolean visit(SchemaBase node)
Visit a schema node. This first writes the start tag for the node. If the schema node is represented by a separate class this then just writes text content referencing that class, and returns blocking further expansion; otherwise, it just returns for further expansion requested.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
trueif expanding content,falseif content replaced by reference
-
visit
public boolean visit(AnnotationElement node)
Visit an annotation element. If annotations are being deleted this just returns without calling the next-level method, so that the element will be ignored.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
falseif annotations to be deleted, otherwise the result of the next-level method
-
visit
public boolean visit(ElementElement node)
Visit an element element. If the extension says this is excluded the element is dropped from the generated schema fragment.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
falseif element excluded, otherwise the result of the next-level method
-
visit
public boolean visit(KeyBase node)
Visit an identity constraint element. This just always returnsfalse, since the identity constraint elements are handled in-line in the binding.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
falseto block further expansion
-
-