Package org.jibx.schema.codegen.custom
Class BaseExtension
- java.lang.Object
-
- org.jibx.schema.codegen.custom.BaseExtension
-
- Direct Known Subclasses:
ComponentExtension
,SchemaExtension
public abstract class BaseExtension extends java.lang.Object
Base extension information for any schema component. This is the basic extension structure that applies to each schema component.- Author:
- Dennis M. Sosnoski
-
-
Field Summary
Fields Modifier and Type Field Description static int
ARITY_OPTIONAL_COLLECTION
static int
ARITY_OPTIONAL_SINGLETON
static int
ARITY_REQUIRED_COLLECTION
static int
ARITY_REQUIRED_SINGLETON
private OpenAttrBase
m_component
Annotated schema definition component.private TypeReplacer
m_typeReplacer
Type replacement implementation (null
if no replacements at this level).private static Logger
s_logger
Logger for class.
-
Constructor Summary
Constructors Constructor Description BaseExtension(OpenAttrBase comp)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OpenAttrBase
getComponent()
Get schema component.QName
getReplacementType(QName qname)
Get the replacement type to be substituted for a supplied type.void
setTypeReplacer(TypeReplacer replacer)
Set type replacer.
-
-
-
Field Detail
-
s_logger
private static final Logger s_logger
Logger for class.
-
ARITY_OPTIONAL_SINGLETON
public static final int ARITY_OPTIONAL_SINGLETON
- See Also:
- Constant Field Values
-
ARITY_REQUIRED_SINGLETON
public static final int ARITY_REQUIRED_SINGLETON
- See Also:
- Constant Field Values
-
ARITY_OPTIONAL_COLLECTION
public static final int ARITY_OPTIONAL_COLLECTION
- See Also:
- Constant Field Values
-
ARITY_REQUIRED_COLLECTION
public static final int ARITY_REQUIRED_COLLECTION
- See Also:
- Constant Field Values
-
m_component
private final OpenAttrBase m_component
Annotated schema definition component.
-
m_typeReplacer
private TypeReplacer m_typeReplacer
Type replacement implementation (null
if no replacements at this level).
-
-
Constructor Detail
-
BaseExtension
public BaseExtension(OpenAttrBase comp)
Constructor.- Parameters:
comp
-
-
-
Method Detail
-
getComponent
public OpenAttrBase getComponent()
Get schema component.- Returns:
- component
-
setTypeReplacer
public void setTypeReplacer(TypeReplacer replacer)
Set type replacer. This type replacer will apply to this extension and any child extensions which do not have their own type replacers.- Parameters:
replacer
-
-
getReplacementType
public QName getReplacementType(QName qname)
Get the replacement type to be substituted for a supplied type. This starts with this extension and then scans up the tree to find the first extension with a type replacer defined. If a type replacer is found at any level it is applied to the supplied type. If multiple extensions in the path up the tree have type replacers defined, only the first type replacer is used.- Parameters:
qname
- original type- Returns:
- substitute type (
null
if deletion; original type, if no substitution defined)
-
-