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 Details

    • m_componentClassMap

      private final Map m_componentClassMap
      Map from schema components with separate classes to the class information.
    • m_className

      private final 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 String[] 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 information
      clasname - fully-qualified class name to be stripped from class references
      comp - top-level component for documentation
      dropanno - delete annotations from schema documentation flag
      ref - reference component with separate class flag
      indexes - namespace indexes for use on marshalling root element
      prefixes - namespace prefixes for use on marshalling root element
  • Method Details

    • exit

      public void exit(SchemaBase node)
      Exit a schema node. This just writes the end tag for the node.
      Overrides:
      exit in class SchemaVisitor
      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 class SchemaVisitor
      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 class SchemaVisitor
      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 class SchemaVisitor
      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 class SchemaVisitor
      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 class SchemaVisitor
      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 class SchemaVisitor
      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 returns false, since the identity constraint elements are handled in-line in the binding.
      Overrides:
      visit in class SchemaVisitor
      Parameters:
      node -
      Returns:
      false to block further expansion