Class SchemaDocumentationGenerator

java.lang.Object
org.jibx.schema.codegen.SchemaDocumentationGenerator

public class SchemaDocumentationGenerator extends Object
Visitor to write a filtered view of a schema definition matching the data structure of a class. This is used when schema fragments are included in class documentation.
  • Field Details

    • COMMENT_LEAD_TEXT

      public static final String COMMENT_LEAD_TEXT
      Leading text for comment lines.
      See Also:
    • SCHEMA_DEFINITIONS_NS

      private static final String SCHEMA_DEFINITIONS_NS
      Schema definitions namespace URI.
      See Also:
    • s_logger

      private static final Logger s_logger
      Logger for class.
    • m_factory

      private final IBindingFactory m_factory
      Extract binding factory.
    • m_schemaIndex

      private final int m_schemaIndex
      Schema definitions namespace index.
    • m_schemaPrefix

      private final String m_schemaPrefix
      Schema definitions namespace prefix.
    • m_namespaceSet

      private final Set m_namespaceSet
      Set of namespace URIs defined in binding.
    • m_context

      private final MarshallingContext m_context
      Marshaller instance for writing schema fragments.
  • Constructor Details

    • SchemaDocumentationGenerator

      public SchemaDocumentationGenerator() throws JiBXException
      Constructor.
      Throws:
      JiBXException - on error loading binding information
  • Method Details

    • scanItemTree

      private void scanItemTree(GroupItem group, Map comptoclas, Set refcomps, Map uritoprefix)
      Scan schema component references from item tree. This recursively constructs (1) a map from schema components represented by separate classes to the corresponding class information, (2) a set of schema global definitions included in the item tree, and (3) a set of namespace URIs for referenced components.
      Parameters:
      group - item grouping to be processed
      comptoclas - map from schema component to corresponding ClassHolder
      refcomps - set of schema global definitions incorporated into this tree
      uritoprefix - map from namespaces used by referenced definitions to the corresponding prefixes
    • escapeText

      private void escapeText(char chr, String escape, String text, StringBuffer buff)
      Escape a special character in a text string.
      Parameters:
      chr -
      escape -
      text -
      buff -
    • generate

      public String generate(GroupItem group, boolean dropanno)
      Generate documentation from the schema component corresponding to a class.
      Parameters:
      group - item group for class
      dropanno - delete annotations from schema documentation flag
      Returns:
      schema extract documentation