Package org.jibx.binding.model
Class ElementBase
java.lang.Object
org.jibx.binding.model.ElementBase
- Direct Known Subclasses:
FormatElement
,NamespaceElement
,NestingElementBase
,ValueElement
Base 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
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final String[]
static final int
static final int
static final int
private String
Comment associated with element.private final int
Element type.static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal String
Get element comment.final String
name()
Get element name.void
prevalidate
(ValidationContext vctx) Prevalidate element information.final void
setComment
(String text) Set element comment.toString()
Simple text representation of binding definition element.final int
type()
Get element type.void
validate
(ValidationContext vctx) Validate element information.protected void
validateAttributes
(IUnmarshallingContext ictx, StringArray attrs) Validate attributes of element.
-
Field Details
-
BINDING_ELEMENT
public static final int BINDING_ELEMENT- See Also:
-
COLLECTION_ELEMENT
public static final int COLLECTION_ELEMENT- See Also:
-
FORMAT_ELEMENT
public static final int FORMAT_ELEMENT- See Also:
-
MAPPING_ELEMENT
public static final int MAPPING_ELEMENT- See Also:
-
NAMESPACE_ELEMENT
public static final int NAMESPACE_ELEMENT- See Also:
-
STRUCTURE_ELEMENT
public static final int STRUCTURE_ELEMENT- See Also:
-
TEMPLATE_ELEMENT
public static final int TEMPLATE_ELEMENT- See Also:
-
VALUE_ELEMENT
public static final int VALUE_ELEMENT- See Also:
-
INCLUDE_ELEMENT
public static final int INCLUDE_ELEMENT- See Also:
-
SPLIT_ELEMENT
public static final int SPLIT_ELEMENT- See Also:
-
INPUT_ELEMENT
public static final int INPUT_ELEMENT- See Also:
-
OUTPUT_ELEMENT
public static final int OUTPUT_ELEMENT- See Also:
-
ELEMENT_NAMES
-
m_type
private final int m_typeElement type. -
m_comment
Comment associated with element.
-
-
Constructor Details
-
ElementBase
protected ElementBase(int type) Constructor.- Parameters:
type
- element type code
-
-
Method Details
-
type
public final int type()Get element type.- Returns:
- type code for this element
-
name
Get element name.- Returns:
- type code for this element
-
getComment
Get element comment.- Returns:
- comment for this element
-
setComment
Set element comment.- Parameters:
text
- comment for this element
-
validateAttributes
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
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
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
Simple text representation of binding definition element. This uses the element name, along with position information if present.
-