Class SchemaDocumentationGenerator


  • public class SchemaDocumentationGenerator
    extends java.lang.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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void escapeText​(char chr, java.lang.String escape, java.lang.String text, java.lang.StringBuffer buff)
      Escape a special character in a text string.
      java.lang.String generate​(GroupItem group, boolean dropanno)
      Generate documentation from the schema component corresponding to a class.
      private void scanItemTree​(GroupItem group, java.util.Map comptoclas, java.util.Set refcomps, java.util.Map uritoprefix)
      Scan schema component references from item tree.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COMMENT_LEAD_TEXT

        public static final java.lang.String COMMENT_LEAD_TEXT
        Leading text for comment lines.
        See Also:
        Constant Field Values
      • SCHEMA_DEFINITIONS_NS

        private static final java.lang.String SCHEMA_DEFINITIONS_NS
        Schema definitions namespace URI.
        See Also:
        Constant Field Values
      • 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 java.lang.String m_schemaPrefix
        Schema definitions namespace prefix.
      • m_namespaceSet

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

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

      • SchemaDocumentationGenerator

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

      • scanItemTree

        private void scanItemTree​(GroupItem group,
                                  java.util.Map comptoclas,
                                  java.util.Set refcomps,
                                  java.util.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,
                                java.lang.String escape,
                                java.lang.String text,
                                java.lang.StringBuffer buff)
        Escape a special character in a text string.
        Parameters:
        chr -
        escape -
        text -
        buff -
      • generate

        public java.lang.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