org.jibx.binding.model
Class ElementBase

java.lang.Object
  extended by org.jibx.binding.model.ElementBase
Direct Known Subclasses:
FormatElement, NamespaceElement, NestingElementBase, ValueElement

public abstract class ElementBase
extends java.lang.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
static int BINDING_ELEMENT
           
static int COLLECTION_ELEMENT
           
static java.lang.String[] ELEMENT_NAMES
           
static int FORMAT_ELEMENT
           
static int INCLUDE_ELEMENT
           
static int INPUT_ELEMENT
           
private  java.lang.String m_comment
          Comment associated with element.
private  int m_type
          Element type.
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
protected ElementBase(int type)
          Constructor.
 
Method Summary
 java.lang.String getComment()
          Get element comment.
 java.lang.String name()
          Get element name.
 void prevalidate(ValidationContext vctx)
          Prevalidate element information.
 void setComment(java.lang.String text)
          Set element comment.
 java.lang.String toString()
          Simple text representation of binding definition element.
 int type()
          Get element type.
 void validate(ValidationContext vctx)
          Validate element information.
protected  void validateAttributes(IUnmarshallingContext ictx, StringArray attrs)
          Validate attributes of element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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.

Constructor Detail

ElementBase

protected ElementBase(int type)
Constructor.

Parameters:
type - element type code
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 context
attrs - 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. The prevalidate(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:
toString in class java.lang.Object
Returns:
text representation


Project Web Site