Package org.jibx.schema.codegen
Class SchemaDocumentationGenerator
- java.lang.Object
-
- org.jibx.schema.codegen.SchemaDocumentationGenerator
-
public class SchemaDocumentationGenerator extends java.lang.ObjectVisitor 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classSchemaDocumentationGenerator.DocumentationVisitorVisitor to write the filtered view of a schema definition matching the data structure of a class.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCOMMENT_LEAD_TEXTLeading text for comment lines.private MarshallingContextm_contextMarshaller instance for writing schema fragments.private IBindingFactorym_factoryExtract binding factory.private java.util.Setm_namespaceSetSet of namespace URIs defined in binding.private intm_schemaIndexSchema definitions namespace index.private java.lang.Stringm_schemaPrefixSchema definitions namespace prefix.private static Loggers_loggerLogger for class.private static java.lang.StringSCHEMA_DEFINITIONS_NSSchema definitions namespace URI.
-
Constructor Summary
Constructors Constructor Description SchemaDocumentationGenerator()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidescapeText(char chr, java.lang.String escape, java.lang.String text, java.lang.StringBuffer buff)Escape a special character in a text string.java.lang.Stringgenerate(GroupItem group, boolean dropanno)Generate documentation from the schema component corresponding to a class.private voidscanItemTree(GroupItem group, java.util.Map comptoclas, java.util.Set refcomps, java.util.Map uritoprefix)Scan schema component references from item tree.
-
-
-
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 JiBXExceptionConstructor.- 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 processedcomptoclas- map from schema component to correspondingClassHolderrefcomps- set of schema global definitions incorporated into this treeuritoprefix- 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 classdropanno- delete annotations from schema documentation flag- Returns:
- schema extract documentation
-
-