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 Object
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
Fields Modifier and Type Field Description static int
BINDING_ELEMENT
static int
COLLECTION_ELEMENT
static String[]
ELEMENT_NAMES
static int
FORMAT_ELEMENT
static int
INCLUDE_ELEMENT
static int
INPUT_ELEMENT
static int
MAPPING_ELEMENT
static int
NAMESPACE_ELEMENT
static int
OUTPUT_ELEMENT
static int
SPLIT_ELEMENT
static int
STRUCTURE_ELEMENT
static int
TEMPLATE_ELEMENT
static int
VALUE_ELEMENT
-
Constructor Summary
Constructors Modifier Constructor Description protected
ElementBase(int type)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getComment()
Get element comment.String
name()
Get element name.void
prevalidate(ValidationContext vctx)
Prevalidate element information.void
setComment(String text)
Set element comment.String
toString()
Simple text representation of binding definition element.int
type()
Get element type.void
validate(ValidationContext vctx)
Validate element information.protected void
validateAttributes(org.jibx.runtime.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 String[] ELEMENT_NAMES
-
-
Method Detail
-
type
public final int type()
Get element type.- Returns:
- type code for this element
-
name
public final String name()
Get element name.- Returns:
- type code for this element
-
getComment
public final String getComment()
Get element comment.- Returns:
- comment for this element
-
setComment
public final void setComment(String text)
Set element comment.- Parameters:
text
- comment for this element
-
validateAttributes
protected void validateAttributes(org.jibx.runtime.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
-
-