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.String
m_className
Fully-qualified name of class containing documentation.private AnnotatedBase
m_component
Root component to be documented.private java.util.Map
m_componentClassMap
Map from schema components with separate classes to the class information.private boolean
m_dropAnnotations
Delete annotations from schema documentation flag.private int[]
m_nsIndexes
Namespace indexes for use on marshalling root element.private java.lang.String[]
m_nsPrefixes
Namespace prefixes for use on marshalling root element.private boolean
m_reference
Reference 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 void
exit(AnnotationElement node)
Exit an annotation element.void
exit(ElementElement node)
Exit an element element.void
exit(KeyBase node)
Exit an identity constraint element.void
exit(SchemaBase node)
Exit a schema node.boolean
visit(AnnotationElement node)
Visit an annotation element.boolean
visit(ElementElement node)
Visit an element element.boolean
visit(KeyBase node)
Visit an identity constraint element.boolean
visit(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:
exit
in 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:
exit
in 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:
exit
in 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:
exit
in 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:
visit
in classSchemaVisitor
- Parameters:
node
-- Returns:
true
if expanding content,false
if 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:
visit
in classSchemaVisitor
- Parameters:
node
-- Returns:
false
if 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:
visit
in classSchemaVisitor
- Parameters:
node
-- Returns:
false
if 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:
visit
in classSchemaVisitor
- Parameters:
node
-- Returns:
false
to block further expansion
-
-