Package org.jibx.schema.codegen
Class SchemaDocumentationGenerator.DocumentationVisitor
java.lang.Object
org.jibx.schema.SchemaVisitor
org.jibx.schema.codegen.SchemaDocumentationGenerator.DocumentationVisitor
- Enclosing class:
SchemaDocumentationGenerator
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
FieldsModifier and TypeFieldDescriptionprivate final String
Fully-qualified name of class containing documentation.private final AnnotatedBase
Root component to be documented.private final Map
Map from schema components with separate classes to the class information.private final boolean
Delete annotations from schema documentation flag.private final int[]
Namespace indexes for use on marshalling root element.private final String[]
Namespace prefixes for use on marshalling root element.private final boolean
Reference component with separate class flag. -
Constructor Summary
ConstructorsConstructorDescriptionDocumentationVisitor
(Map comptoclas, String clasname, AnnotatedBase comp, boolean dropanno, boolean ref, int[] indexes, String[] prefixes) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
exit
(AnnotationElement node) Exit an annotation element.void
exit
(ElementElement node) Exit an element element.void
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 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 Details
-
m_componentClassMap
Map from schema components with separate classes to the class information. -
m_className
Fully-qualified name of class containing documentation. -
m_component
Root component to be documented. -
m_dropAnnotations
private final boolean m_dropAnnotationsDelete annotations from schema documentation flag. -
m_reference
private final boolean m_referenceReference component with separate class flag. -
m_nsIndexes
private final int[] m_nsIndexesNamespace indexes for use on marshalling root element. -
m_nsPrefixes
Namespace prefixes for use on marshalling root element.
-
-
Constructor Details
-
DocumentationVisitor
public DocumentationVisitor(Map comptoclas, String clasname, AnnotatedBase comp, boolean dropanno, boolean ref, int[] indexes, 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 Details
-
exit
Exit a schema node. This just writes the end tag for the node.- Overrides:
exit
in classSchemaVisitor
- Parameters:
node
-
-
exit
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
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
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
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
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
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
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
-