Package org.jibx.schema.codegen.custom
Class SchemasetCustom
java.lang.Object
org.jibx.schema.codegen.custom.CustomBase
org.jibx.schema.codegen.custom.NestingCustomBase
org.jibx.schema.codegen.custom.SchemaRootBase
org.jibx.schema.codegen.custom.SchemasetCustom
- All Implemented Interfaces:
TypeReplacer
Customization information for a set of schemas.
- Author:
- Dennis M. Sosnoski
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jibx.schema.codegen.custom.SchemaRootBase
SchemaRootBase.ClassDecoratorUnmarshaller, SchemaRootBase.ExtensionUnmarshaller, SchemaRootBase.NameConverterUnmarshaller, SchemaRootBase.SchemaTypeUnmarshaller -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String[]Schema name patterns.private String[]Schema namespace patterns.private final MapMap from schema identifier to customization.static final StringArrayEnumeration of allowed attribute namesprivate static final LoggerLogger for class.Fields inherited from class org.jibx.schema.codegen.custom.SchemaRootBase
ENUM_JAVA5, ENUM_SIMPLE, REPEAT_ARRAY, REPEAT_LIST, REPEAT_TYPED, s_enumValues, s_repeatValuesFields inherited from class org.jibx.schema.codegen.custom.NestingCustomBase
ANY_DISCARD, ANY_DOM, ANY_MAPPED, s_anyValues, s_selectionValues, SELECTION_CHECKEDBOTH, SELECTION_CHECKEDSET, SELECTION_OVERRIDEBOTH, SELECTION_OVERRIDESET, SELECTION_UNCHECKED -
Constructor Summary
ConstructorsConstructorDescriptionSchemasetCustom(SchemaCustom child) Constructor with single schema customization as content.SchemasetCustom(SchemasetCustom parent) Normal constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidRecursively check that each schema customization has been matched to a schema.private static SchemasetCustomfactory(IUnmarshallingContext ictx) Factory used during unmarshalling.forceCustomization(String name, String id, SchemaElement schema, ValidationContext vctx) Get schema customization information, creating it if it doesn't already exist.Get existing schema customization information.String[]getNames()Get schema name match patterns.booleanisInSet(String name, SchemaElement schema) Check if a schema is included in this set.static SchemasetCustomloadCustomizations(String path, ProblemHandler handler) Load a customizations file.private voidpreSet(IUnmarshallingContext uctx) Make sure all attributes are defined.booleanvalidate(ValidationContext vctx) Validate and finalize customization information.Methods inherited from class org.jibx.schema.codegen.custom.SchemaRootBase
getBindingFileName, getClassDecorators, getEnumerationTypeText, getEnumType, getLineWidth, getNameConverter, getPackage, getPrefix, getRepeatedTypeText, getRepeatType, getRootParent, getSchemaTypes, isBindingPerSchema, isDeleteAnnotations, isGenerateAll, isInlineGroups, isJavaDocDocumentation, isNullCollectionAllowed, isPreferInline, isSchemaFragmentDocumentation, isStructureOptional, isUseInner, setEnumType, setPackage, setRepeatTypeMethods inherited from class org.jibx.schema.codegen.custom.NestingCustomBase
getActiveFacetsMask, getAnyHandling, getAnyType, getChildren, getChoiceHandling, getChoiceType, getReplacement, getSubstitutions, getUnionHandling, getUnionType, isAttributeInlined, isChoiceExposed, isUnionExposed, setAnyType, setChoiceType, setEnforcedFacets, setIgnoredFacets, setReplacement, setSubstitutions, setUnionTypeMethods inherited from class org.jibx.schema.codegen.custom.CustomBase
getContainingObject, getParent, getSchemaRoot, setParent, validateAttributes
-
Field Details
-
s_logger
private static final Logger s_loggerLogger for class. -
s_allowedAttributes
Enumeration of allowed attribute names -
m_names
Schema name patterns. -
m_namespaces
Schema namespace patterns. -
m_schemaMap
Map from schema identifier to customization.
-
-
Constructor Details
-
SchemasetCustom
Normal constructor.- Parameters:
parent-
-
SchemasetCustom
Constructor with single schema customization as content.- Parameters:
child-
-
-
Method Details
-
getNames
Get schema name match patterns.- Returns:
- names (
nullif not set)
-
preSet
Make sure all attributes are defined.- Parameters:
uctx- unmarshalling context
-
isInSet
Check if a schema is included in this set.- Parameters:
name- schema file nameschema- actual schema- Returns:
trueif in set,falseif not
-
getCustomization
Get existing schema customization information.- Parameters:
id- schema identifier- Returns:
- customization
-
forceCustomization
public SchemaCustom forceCustomization(String name, String id, SchemaElement schema, ValidationContext vctx) Get schema customization information, creating it if it doesn't already exist.- Parameters:
name- schema file nameid- unique identifier for schemaschema- actual schemavctx- validation context for reporting errors- Returns:
- customization
-
factory
Factory used during unmarshalling.- Parameters:
ictx-- Returns:
- instance
-
checkSchemas
Recursively check that each schema customization has been matched to a schema. A warning is generated for any customization without a matching schema.- Parameters:
vctx-
-
validate
Validate and finalize customization information. This override of the base class implementation also invokes the same method on any nested schemasets in order to make sure that the type substitution map and active facets mask will be available for use by nested schemas.- Overrides:
validatein classNestingCustomBase- Parameters:
vctx- validation context- Returns:
trueif valid,falseif not
-
loadCustomizations
public static SchemasetCustom loadCustomizations(String path, ProblemHandler handler) throws JiBXException, IOException Load a customizations file. The specified file must exist and have as root element either a <schema-set> or <schema> element.- Parameters:
path- customization file path (nullif none)handler- validation problem handler- Returns:
- unmarshalled customizations, or
nullif errors - Throws:
JiBXExceptionIOException
-