public abstract class SchemaRootBase extends NestingCustomBase
Modifier and Type | Class and Description |
---|---|
static class |
SchemaRootBase.ClassDecoratorUnmarshaller
Unmarshaller for class decorator extension elements.
|
static class |
SchemaRootBase.ExtensionUnmarshaller
Unmarshaller for extension elements.
|
static class |
SchemaRootBase.NameConverterUnmarshaller
Unmarshaller for name converter extension elements.
|
static class |
SchemaRootBase.SchemaTypeUnmarshaller
Unmarshaller for schema-type elements.
|
Modifier and Type | Field and Description |
---|---|
private static ClassDecorator[] |
EMPTY_DECORATORS_ARRAY |
static int |
ENUM_JAVA5 |
static int |
ENUM_SIMPLE |
private java.lang.String |
m_bindingFileName
Binding file name (only allowed if single namespace,
null if derived from schema name). |
private java.lang.Boolean |
m_bindingPerSchema
Generate one binding for each schema flag (binding per namespace if
false ). |
private java.util.List |
m_classDecorators
Decorators to be used in code generation (
null if none set at level). |
private java.lang.Boolean |
m_deleteAnnotations
Delete annotations flag.
|
private int |
m_enumCode
Code for enumeration representation (
-1 if not set at level). |
private java.lang.Boolean |
m_generateAll
Generate even unused global definitions.
|
private java.lang.Boolean |
m_importDocs
Convert schema documentation to JavaDocs in generated code flag.
|
private java.lang.Boolean |
m_inheritDecorators
Inherit code generation class decorators from parent flag.
|
private java.lang.Boolean |
m_inlineGroups
Inline xs:group and xs:attributeGroup definitions by default.
|
private java.lang.Integer |
m_lineWidth
Preferred maximum line width for generated code.
|
private NameConverter |
m_nameConverter
Name converter instance (
null if none set at level). |
private java.lang.Boolean |
m_nullCollection
Force separate class for collection flag.
|
private java.lang.String |
m_package
Fully-qualified package name.
|
private java.lang.Boolean |
m_preferInline
Prefer inline definitions (separate classes for all if
false ). |
private java.lang.String |
m_prefix
Prefix used for namespace (only allowed if single namespace,
null if from schema). |
private int |
m_repeatCode
Code for repeated value representation (
-1 if not set at level). |
private java.util.Map |
m_schemaTypes
Map from schema type name to Java type information (lazy create,
null if not used at level). |
private java.lang.Boolean |
m_showSchema
Include schema fragments in generated class JavaDocs flag.
|
private java.lang.Boolean |
m_structureOptional
Set references as optional structure where possible flag.
|
private java.lang.Boolean |
m_useInner
Use inner classes for substructures (top-level classes for all if
false ). |
static int |
REPEAT_ARRAY |
static int |
REPEAT_LIST |
static int |
REPEAT_TYPED |
static StringArray |
s_allowedAttributes
Enumeration of allowed attribute names
|
private static NameConverter |
s_defaultNameConverter
Default converter used if none set.
|
static EnumSet |
s_enumValues |
private static java.util.Map |
s_nameToFormat
Default format name to definition map.
|
static EnumSet |
s_repeatValues |
ANY_DISCARD, ANY_DOM, ANY_MAPPED, s_anyValues, s_selectionValues, SELECTION_CHECKEDBOTH, SELECTION_CHECKEDSET, SELECTION_OVERRIDEBOTH, SELECTION_OVERRIDESET, SELECTION_UNCHECKED
Constructor and Description |
---|
SchemaRootBase(SchemaRootBase parent)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
addClassDecorator(ClassDecorator decor)
Add a class decorator to the current list.
|
private void |
addSchemaType(JavaType type)
Add schema type handling override.
|
private static ClassDecorator |
classDecoratorFactory(IUnmarshallingContext ictx)
Create an instance of the appropriate class decorator class, to be used for unmarshalling.
|
java.lang.String |
getBindingFileName()
Get binding definition file name.
|
(package private) ClassDecorator[] |
getClassDecorators()
Get class decorators.
|
java.lang.String |
getEnumerationTypeText()
Get the enumeration representation text value set specifically for this element.
|
int |
getEnumType()
Get the enumeration representation type code to be applied for this schema or set of schemas.
|
int |
getLineWidth()
Get the preferred maximum line width used for generated classes.
|
(package private) NameConverter |
getNameConverter()
Get name converter.
|
java.lang.String |
getPackage()
Get fully-qualified package name.
|
java.lang.String |
getPrefix()
Get prefix used for namespace.
|
java.lang.String |
getRepeatedTypeText()
Get the repeated value representation text value set specifically for this element.
|
int |
getRepeatType()
Get the repeated value representation type code to be applied for this schema or set of schemas.
|
SchemaRootBase |
getRootParent()
Get parent customization (which will either be
null , or another instance of this class). |
(package private) java.util.Map |
getSchemaTypes()
Get map from schema type local name to type information.
|
boolean |
isBindingPerSchema()
Check if a separate binding should be generated for each schema.
|
boolean |
isDeleteAnnotations()
Check whether annotations are to be deleted.
|
boolean |
isGenerateAll()
Check whether unused definitions should be included in code generation.
|
boolean |
isInlineGroups()
Check whether xs:group and xs:attributeGroup definitions should be inlined by default.
|
boolean |
isJavaDocDocumentation()
Check whether schema documentation is to be used for JavaDocs in the generated code.
|
boolean |
isNullCollectionAllowed()
Check whether collection holder (array, list, etc.) can be
null . |
boolean |
isPreferInline()
Check whether inlining of components is preferred.
|
boolean |
isSchemaFragmentDocumentation()
Check whether schema fragments matching a generated class are to be included in the class JavaDocs.
|
boolean |
isStructureOptional()
Check whether references to classes with no associated element and all components optional should be made
optional in the generated binding.
|
boolean |
isUseInner()
Check whether inner classes are preferred for components used only by one definition.
|
private void |
setEnumerationTypeText(java.lang.String text,
IUnmarshallingContext ictx)
Set the enumeration representation text value.
|
void |
setEnumType(int code)
Set the enumeration representation type code.
|
private void |
setNameConverter(NameConverter nconv,
IUnmarshallingContext ictx)
Set name converter to be used.
|
void |
setPackage(java.lang.String pack)
Set fully-qualified package name.
|
private void |
setRepeatedTypeText(java.lang.String text,
IUnmarshallingContext ictx)
Set the repeated value representation text value.
|
void |
setRepeatType(int code)
Set the repeated value representation type code.
|
getActiveFacetsMask, getAnyHandling, getAnyType, getChildren, getChoiceHandling, getChoiceType, getReplacement, getSubstitutions, getUnionHandling, getUnionType, isAttributeInlined, isChoiceExposed, isUnionExposed, setAnyType, setChoiceType, setEnforcedFacets, setIgnoredFacets, setReplacement, setSubstitutions, setUnionType, validate
getContainingObject, getParent, getSchemaRoot, setParent, validateAttributes
private static final ClassDecorator[] EMPTY_DECORATORS_ARRAY
public static final StringArray s_allowedAttributes
private static final NameConverter s_defaultNameConverter
private static final java.util.Map s_nameToFormat
public static final int REPEAT_ARRAY
public static final int REPEAT_LIST
public static final int REPEAT_TYPED
public static final EnumSet s_repeatValues
public static final int ENUM_JAVA5
public static final int ENUM_SIMPLE
public static final EnumSet s_enumValues
private java.lang.String m_package
private java.lang.Boolean m_bindingPerSchema
false
).private java.lang.String m_bindingFileName
null
if derived from schema name).private java.lang.String m_prefix
null
if from schema).private java.lang.Boolean m_generateAll
private java.lang.Boolean m_inlineGroups
private java.lang.Boolean m_preferInline
false
).private java.lang.Boolean m_useInner
false
).private java.lang.Boolean m_deleteAnnotations
private java.lang.Boolean m_importDocs
private java.lang.Boolean m_showSchema
private java.lang.Boolean m_nullCollection
private java.lang.Boolean m_structureOptional
private java.util.Map m_schemaTypes
null
if not used at level).private NameConverter m_nameConverter
null
if none set at level).private java.lang.Boolean m_inheritDecorators
private java.util.List m_classDecorators
null
if none set at level).private java.lang.Integer m_lineWidth
private int m_repeatCode
-1
if not set at level).private int m_enumCode
-1
if not set at level).public SchemaRootBase(SchemaRootBase parent)
parent
- public SchemaRootBase getRootParent()
null
, or another instance of this class).null
if nonepublic boolean isBindingPerSchema()
false
if not
overridden at any level.public boolean isGenerateAll()
true
if not
overridden at any level.public boolean isInlineGroups()
false
if not overridden at any level.public boolean isPreferInline()
false
if not overridden at any
level.public boolean isUseInner()
true
if not overridden at any level.public boolean isDeleteAnnotations()
true
if not overridden at any level.public boolean isJavaDocDocumentation()
true
if not overridden at any level.public boolean isSchemaFragmentDocumentation()
true
if not overridden at any level.public boolean isNullCollectionAllowed()
null
. This is only relevant to
collections using an optional wrapper element: If this flag is true
a null
collection
holder indicates the element is missing; otherwise a class is created to wrap the collection holder, and a
null
for that class indicates the element is missing. The default is true
if not
overridden at any level.
TODO: currently unsupportedpublic boolean isStructureOptional()
null
when unmarshalling if none of the components are present, and will be checked for
null
when marshalling. The default is true
if not overridden at any level.public int getLineWidth()
public int getRepeatType()
REPEAT_TYPED
if not overridden at any level.public void setRepeatType(int code)
code
- type code, -1
if to be unsetpublic java.lang.String getRepeatedTypeText()
null
if not set)private void setRepeatedTypeText(java.lang.String text, IUnmarshallingContext ictx)
text
- (null
if not set)ictx
- public int getEnumType()
ENUM_JAVA5
if not overridden at any level.public void setEnumType(int code)
code
- type code, -1
if to be unsetpublic java.lang.String getEnumerationTypeText()
null
if not set)private void setEnumerationTypeText(java.lang.String text, IUnmarshallingContext ictx)
text
- (null
if not set)ictx
- public java.lang.String getPackage()
null
if none set)public void setPackage(java.lang.String pack)
pack
- (null
if none)public java.lang.String getBindingFileName()
null
if to be derived from schema namepublic java.lang.String getPrefix()
null
if to be found from schemaprivate void addSchemaType(JavaType type)
type
- java.util.Map getSchemaTypes()
private void setNameConverter(NameConverter nconv, IUnmarshallingContext ictx)
nconv
- ictx
- NameConverter getNameConverter()
null
if none defined)private void addClassDecorator(ClassDecorator decor)
decor
- ClassDecorator[] getClassDecorators()
private static ClassDecorator classDecoratorFactory(IUnmarshallingContext ictx)
ictx
- null
if error