Package org.jibx.schema.codegen.custom
Class GlobalExtension
java.lang.Object
org.jibx.schema.codegen.custom.BaseExtension
org.jibx.schema.codegen.custom.ComponentExtension
org.jibx.schema.codegen.custom.GlobalExtension
Extension information for a schema global definition component. This adds reference tracking to the basic extension
information, along with a map for child components of the definition.
- Author:
- Dennis M. Sosnoski
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DefinitionItem
Definition item for this global definition.private ArrayList
List of global definitions used by this definition (one entry per reference, may contain duplicates).private boolean
Component to be specifically included in code generation (requiring a separate class).private int
Number of references to this definition.private ArrayList
List of extensions for components referencing this definition.private final SchemaExtension
Containing schema extension.(package private) static final Logger
Logger for class.Fields inherited from class org.jibx.schema.codegen.custom.BaseExtension
ARITY_OPTIONAL_COLLECTION, ARITY_OPTIONAL_SINGLETON, ARITY_REQUIRED_COLLECTION, ARITY_REQUIRED_SINGLETON
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add dependency extension.void
Add reference extension.void
Check if the global definition can be removed from the schema.Get code generation decorators used for this component.Get definition item.getDependency
(int index) Get dependency extension by index position.int
Get the number of dependencies for this component.Get name converter used for this component.Get package for class generation.getReference
(int index) Get referencing extension by index position.Get map from schema type local name to type information.boolean
Check if component specifically included in code generation (requiring a separate class).boolean
Check if inlining of definition preferred.boolean
Check if inlining of definition is pushed (even when multiple values are involved).boolean
Check if inner classes should be used for substructures.void
Normalize the schema definition component.void
Reset the dependencies and references of this component.void
setDefinition
(DefinitionItem item) Set definition item.void
setIncluded
(boolean included) Set flag for component specifically included in code generation (requiring a separate class).Methods inherited from class org.jibx.schema.codegen.custom.ComponentExtension
applyAndCountUsage, getAnyType, getBaseName, getChoiceType, getClassName, getCustom, getGlobal, getOverrideType, getUnionType, getUseCount, incrementUseCount, isChoiceExposed, isIgnored, isInlined, isOptional, isRemoved, isRepeated, isSeparateClass, isUnionExposed, normalize, setCustom, setOptional, setOverrideType, setRemoved, setRepeated
Methods inherited from class org.jibx.schema.codegen.custom.BaseExtension
getComponent, getReplacementType, setTypeReplacer
-
Field Details
-
s_logger
static final Logger s_loggerLogger for class. -
m_schemaExtension
Containing schema extension. -
m_included
private boolean m_includedComponent to be specifically included in code generation (requiring a separate class). -
m_referenceCount
private int m_referenceCountNumber of references to this definition. -
m_references
List of extensions for components referencing this definition. -
m_dependencies
List of global definitions used by this definition (one entry per reference, may contain duplicates). -
m_definition
Definition item for this global definition.
-
-
Constructor Details
-
GlobalExtension
Constructor.- Parameters:
schemext
- extension for containing schemacomp
- actual component
-
-
Method Details
-
getSchemaTypes
Get map from schema type local name to type information.- Returns:
- map
-
getNameConverter
Get name converter used for this component.- Returns:
- converter
-
getClassDecorators
Get code generation decorators used for this component.- Returns:
- converter
-
getPackage
Get package for class generation.- Returns:
- package
-
isPushInline
public boolean isPushInline()Check if inlining of definition is pushed (even when multiple values are involved).- Returns:
- inline
-
isPreferInline
public boolean isPreferInline()Check if inlining of definition preferred. Inlining of xs:attributeGroup and xs:group definitions is always preferred.- Returns:
- inline
-
isUseInnerClasses
public boolean isUseInnerClasses()Check if inner classes should be used for substructures.- Returns:
- inner
-
isIncluded
public boolean isIncluded()Check if component specifically included in code generation (requiring a separate class).- Returns:
- included
-
setIncluded
public void setIncluded(boolean included) Set flag for component specifically included in code generation (requiring a separate class).- Parameters:
included
-
-
addReference
Add reference extension.- Parameters:
anno
-
-
getReference
Get referencing extension by index position.- Parameters:
index
-- Returns:
- reference
-
addDependency
Add dependency extension.- Parameters:
anno
-
-
getDependencyCount
public int getDependencyCount()Get the number of dependencies for this component.- Returns:
- count
-
getDependency
Get dependency extension by index position.- Parameters:
index
-- Returns:
- reference
-
resetDependencies
public void resetDependencies()Reset the dependencies and references of this component. This must be called before beginning a reference tracking pass, to clear any information from prior passes. -
checkRemovable
public void checkRemovable()Check if the global definition can be removed from the schema. If it can, this adjusts the usage counts for all dependencies of the definition, forcing a check of each dependency as the counts are adjusted. -
getDefinition
Get definition item.- Returns:
- item
-
setDefinition
Set definition item.- Parameters:
item
-
-
normalize
public void normalize()Normalize the schema definition component. This recursively traverses the schema model tree rooted in the global component, normalizing each child component.
-