Package org.jibx.binding.model
Class ElementBase
- java.lang.Object
-
- org.jibx.binding.model.ElementBase
-
- Direct Known Subclasses:
FormatElement,NamespaceElement,NestingElementBase,ValueElement
public abstract class ElementBase extends java.lang.ObjectBase class for all element structures in binding definition model. This just provides the linkages for the binding definition tree structure and related validation hooks.- Version:
- 1.0
- Author:
- Dennis M. Sosnoski
-
-
Field Summary
Fields Modifier and Type Field Description static intBINDING_ELEMENTstatic intCOLLECTION_ELEMENTstatic java.lang.String[]ELEMENT_NAMESstatic intFORMAT_ELEMENTstatic intINCLUDE_ELEMENTstatic intINPUT_ELEMENTprivate java.lang.Stringm_commentComment associated with element.private intm_typeElement type.static intMAPPING_ELEMENTstatic intNAMESPACE_ELEMENTstatic intOUTPUT_ELEMENTstatic intSPLIT_ELEMENTstatic intSTRUCTURE_ELEMENTstatic intTEMPLATE_ELEMENTstatic intVALUE_ELEMENT
-
Constructor Summary
Constructors Modifier Constructor Description protectedElementBase(int type)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetComment()Get element comment.java.lang.Stringname()Get element name.voidprevalidate(ValidationContext vctx)Prevalidate element information.voidsetComment(java.lang.String text)Set element comment.java.lang.StringtoString()Simple text representation of binding definition element.inttype()Get element type.voidvalidate(ValidationContext vctx)Validate element information.protected voidvalidateAttributes(IUnmarshallingContext ictx, StringArray attrs)Validate attributes of element.
-
-
-
Field Detail
-
BINDING_ELEMENT
public static final int BINDING_ELEMENT
- See Also:
- Constant Field Values
-
COLLECTION_ELEMENT
public static final int COLLECTION_ELEMENT
- See Also:
- Constant Field Values
-
FORMAT_ELEMENT
public static final int FORMAT_ELEMENT
- See Also:
- Constant Field Values
-
MAPPING_ELEMENT
public static final int MAPPING_ELEMENT
- See Also:
- Constant Field Values
-
NAMESPACE_ELEMENT
public static final int NAMESPACE_ELEMENT
- See Also:
- Constant Field Values
-
STRUCTURE_ELEMENT
public static final int STRUCTURE_ELEMENT
- See Also:
- Constant Field Values
-
TEMPLATE_ELEMENT
public static final int TEMPLATE_ELEMENT
- See Also:
- Constant Field Values
-
VALUE_ELEMENT
public static final int VALUE_ELEMENT
- See Also:
- Constant Field Values
-
INCLUDE_ELEMENT
public static final int INCLUDE_ELEMENT
- See Also:
- Constant Field Values
-
SPLIT_ELEMENT
public static final int SPLIT_ELEMENT
- See Also:
- Constant Field Values
-
INPUT_ELEMENT
public static final int INPUT_ELEMENT
- See Also:
- Constant Field Values
-
OUTPUT_ELEMENT
public static final int OUTPUT_ELEMENT
- See Also:
- Constant Field Values
-
ELEMENT_NAMES
public static final java.lang.String[] ELEMENT_NAMES
-
m_type
private final int m_type
Element type.
-
m_comment
private java.lang.String m_comment
Comment associated with element.
-
-
Method Detail
-
type
public final int type()
Get element type.- Returns:
- type code for this element
-
name
public final java.lang.String name()
Get element name.- Returns:
- type code for this element
-
getComment
public final java.lang.String getComment()
Get element comment.- Returns:
- comment for this element
-
setComment
public final void setComment(java.lang.String text)
Set element comment.- Parameters:
text- comment for this element
-
validateAttributes
protected void validateAttributes(IUnmarshallingContext ictx, StringArray attrs)
Validate attributes of element. This is designed to be called during unmarshalling as part of the pre-set method processing when a subclass instance is being created.- Parameters:
ictx- unmarshalling contextattrs- attributes array
-
prevalidate
public void prevalidate(ValidationContext vctx)
Prevalidate element information. The prevalidation step is used to check isolated aspects of an element, such as the settings for enumerated values on the element and attributes. This empty base class implementation should be overridden by each subclass that requires prevalidation handling.- Parameters:
vctx- validation context
-
validate
public void validate(ValidationContext vctx)
Validate element information. The validation step is used for checking the interactions between elements, such as name references to other elements. Theprevalidate(org.jibx.binding.model.ValidationContext)method will always be called for every element in the binding definition before this method is called for any element. This empty base class implementation should be overridden by each subclass that requires validation handling.- Parameters:
vctx- validation context
-
toString
public java.lang.String toString()
Simple text representation of binding definition element. This uses the element name, along with position information if present.- Overrides:
toStringin classjava.lang.Object- Returns:
- text representation
-
-