org.jibx.schema.codegen.custom
Class ComponentCustom

java.lang.Object
  extended by org.jibx.schema.codegen.custom.CustomBase
      extended by org.jibx.schema.codegen.custom.NestingCustomBase
          extended by org.jibx.schema.codegen.custom.ComponentCustom
All Implemented Interfaces:
TypeReplacer

public class ComponentCustom
extends NestingCustomBase

Class for all schema component elements, with the exception of the <schema> element itself. Almost all of these schema elements can contain other elements, so this extends the nesting base to handle inherited values.

Author:
Dennis M. Sosnoski

Field Summary
static int INLINE_BLOCK
           
static int INLINE_DEFAULT
           
static int INLINE_PREFER
           
private  java.lang.String m_baseName
          Base name for corresponding property in generated code (null if not specified).
private  java.lang.String m_className
          Corresponding generated class name (null if not specified).
private  java.lang.String m_componentName
          Component name, if relevant.
private  java.lang.String m_elementName
          Schema element name.
private  boolean m_exclude
          Exclude component flag.
private  boolean m_ignore
          Ignore component flag.
private  int m_inline
          Code for inlining.
private  java.lang.String m_path
          Path to component (null if not specified).
private  java.lang.String m_position
          Component position in siblings of same type (null if not specified).
private  QName m_type
          Actual type to be used.
static EnumSet s_inlineValues
           
 
Fields inherited from class org.jibx.schema.codegen.custom.NestingCustomBase
ANY_DISCARD, ANY_DOM, ANY_MAPPED, s_allowedAttributes, s_anyValues, s_selectionValues, SELECTION_CHECKEDBOTH, SELECTION_CHECKEDSET, SELECTION_OVERRIDEBOTH, SELECTION_OVERRIDESET, SELECTION_UNCHECKED
 
Constructor Summary
ComponentCustom(java.lang.String name, NestingCustomBase parent)
          Constructor.
 
Method Summary
 void apply(ComponentExtension exten, ValidationContext vctx)
          Apply customizations to a schema extension.
 SchemaPath buildPath(ValidationContext vctx)
          Build the schema path for this customization.
 java.lang.String getBaseName()
          Get base name for corresponding property.
 java.lang.String getClassName()
          Get name to be used for generated class.
 java.lang.String getElementName()
          Get the schema element name for the component.
 boolean isExcluded()
          Check if schema component is to be excluded.
 boolean isIgnored()
          Check if schema component is to be ignored (allowed, but not processed, in unmarshalling).
 boolean isInlined()
          Check if schema component is to be generated inline.
 boolean isSeparateClass()
          Check if schema component is to be generated as a separate class.
private  void setInline(java.lang.String text, IUnmarshallingContext ictx)
          Set the inline text value.
 
Methods 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, setUnionType, validate
 
Methods inherited from class org.jibx.schema.codegen.custom.CustomBase
getContainingObject, getParent, getSchemaRoot, setParent, validateAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INLINE_DEFAULT

public static final int INLINE_DEFAULT
See Also:
Constant Field Values

INLINE_BLOCK

public static final int INLINE_BLOCK
See Also:
Constant Field Values

INLINE_PREFER

public static final int INLINE_PREFER
See Also:
Constant Field Values

s_inlineValues

public static final EnumSet s_inlineValues

m_elementName

private final java.lang.String m_elementName
Schema element name.


m_path

private java.lang.String m_path
Path to component (null if not specified).


m_position

private java.lang.String m_position
Component position in siblings of same type (null if not specified).


m_componentName

private java.lang.String m_componentName
Component name, if relevant.


m_ignore

private boolean m_ignore
Ignore component flag.


m_exclude

private boolean m_exclude
Exclude component flag.


m_inline

private int m_inline
Code for inlining.


m_className

private java.lang.String m_className
Corresponding generated class name (null if not specified).


m_baseName

private java.lang.String m_baseName
Base name for corresponding property in generated code (null if not specified).


m_type

private QName m_type
Actual type to be used.

Constructor Detail

ComponentCustom

public ComponentCustom(java.lang.String name,
                       NestingCustomBase parent)
Constructor.

Parameters:
name - schema element name
parent -
Method Detail

getElementName

public final java.lang.String getElementName()
Get the schema element name for the component.

Returns:
name

buildPath

public final SchemaPath buildPath(ValidationContext vctx)
Build the schema path for this customization.

Parameters:
vctx - validation context
Returns:
path constructed path, or null if error

isIgnored

public boolean isIgnored()
Check if schema component is to be ignored (allowed, but not processed, in unmarshalling). This is only applicable to element definitions.

Returns:
true if ignored, false if not

isExcluded

public boolean isExcluded()
Check if schema component is to be excluded.

Returns:
true if ignored, false if not

isInlined

public boolean isInlined()
Check if schema component is to be generated inline.

Returns:
true if inlined, false if not

isSeparateClass

public boolean isSeparateClass()
Check if schema component is to be generated as a separate class.

Returns:
true if separate class, false if not

getClassName

public java.lang.String getClassName()
Get name to be used for generated class.

Returns:
class name (null if not set)

getBaseName

public java.lang.String getBaseName()
Get base name for corresponding property.

Returns:
property name (null if not set)

setInline

private void setInline(java.lang.String text,
                       IUnmarshallingContext ictx)
Set the inline text value. This method is provided only for use when unmarshalling.

Parameters:
text - (null if not set)
ictx -

apply

public final void apply(ComponentExtension exten,
                        ValidationContext vctx)
Apply customizations to a schema extension. This also finds matches for any child customizations, and applies the child customizations recursively. The method may be called multiple times for different component extensions, so it must not modify the customization information itself.

Parameters:
exten - target schema extension
vctx - validation context


Project Web Site