APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.beans.decoder

public abstract Class ElementHandler

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.beans.decoder.JavaElementHandler, com.sun.beans.decoder.NewElementHandler, com.sun.beans.decoder.NullElementHandler, com.sun.beans.decoder.StringElementHandler, com.sun.beans.decoder.VarElementHandler, com.sun.beans.decoder.AccessorElementHandler

The base class for element handlers.
Author
Sergey A. Malenkov
Since
1.7
See Also
DocumentHandler

Field Summary

Modifier and TypeField and Description
private String
private DocumentHandler
private ElementHandler

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
addArgument(Object
the value of the element that contained in this one
argument
)

Adds the argument that is used to calculate the value of this element.

public void
addAttribute(String
the attribute name
name
,
String
the attribute value
value
)

Parses attributes of the element.

public void
addCharacter(char
the character
ch
)

Adds the character that contained in this element.

public void
endElement()

This method is called after parsing of the element's body.

protected Object

Returns:

the value of the parent element
getContextBean
()

Returns the value of the parent element.

public final DocumentHandler

Returns:

the owner document handler
getOwner
()

Returns the document handler that creates this element handler.

public final ElementHandler

Returns:

the parent element handler
getParent
()

Returns the element handler that contains this one.

protected abstract ValueObject

Returns:

the value of this element
getValueObject
()

Returns the value of this element.

protected final Object

Returns:

the value of the variable
getVariable
(String
the identifier
id
)

Returns the value of the variable with specified identifier.

protected boolean

Returns:

true if the value of this element can be used as an argument of the element that contained in this one, false otherwise
isArgument
()

Tests whether the value of this element can be used as an argument of the element that contained in this one.

pack-priv final void
setOwner(DocumentHandler
the owner document handler
owner
)

Sets the document handler that creates this element handler.

pack-priv final void
setParent(ElementHandler
the parent element handler
parent
)

Sets the element handler that contains this one.

public void
startElement()

This method is called before parsing of the element's body.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

idback to summary
private String id
ownerback to summary
private DocumentHandler owner
parentback to summary
private ElementHandler parent

Constructor Detail

ElementHandlerback to summary
public ElementHandler()

Method Detail

addArgumentback to summary
protected void addArgument(Object argument)

Adds the argument that is used to calculate the value of this element. By default, no arguments are acceptable.

Parameters
argument:Object

the value of the element that contained in this one

addAttributeback to summary
public void addAttribute(String name, String value)

Parses attributes of the element. By default, the following attribute is supported:

id
the identifier of the variable that is intended to store the result
Parameters
name:String

the attribute name

value:String

the attribute value

addCharacterback to summary
public void addCharacter(char ch)

Adds the character that contained in this element. By default, only whitespaces are acceptable.

Parameters
ch:char

the character

endElementback to summary
public void endElement()

This method is called after parsing of the element's body. By default, it calculates the value of this element. The following tasks are executing for any non-void value:

  1. If the id attribute is set the value of the variable with the specified identifier is set to the value of this element.
  2. This element is used as an argument of parent element if it is possible.
See Also
isArgument
getContextBeanback to summary
protected Object getContextBean()

Returns the value of the parent element.

Returns:Object

the value of the parent element

getOwnerback to summary
public final DocumentHandler getOwner()

Returns the document handler that creates this element handler.

Returns:DocumentHandler

the owner document handler

getParentback to summary
public final ElementHandler getParent()

Returns the element handler that contains this one.

Returns:ElementHandler

the parent element handler

getValueObjectback to summary
protected abstract ValueObject getValueObject()

Returns the value of this element.

Returns:ValueObject

the value of this element

getVariableback to summary
protected final Object getVariable(String id)

Returns the value of the variable with specified identifier.

Parameters
id:String

the identifier

Returns:Object

the value of the variable

isArgumentback to summary
protected boolean isArgument()

Tests whether the value of this element can be used as an argument of the element that contained in this one.

Returns:boolean

true if the value of this element can be used as an argument of the element that contained in this one, false otherwise

setOwnerback to summary
pack-priv final void setOwner(DocumentHandler owner)

Sets the document handler that creates this element handler. The owner document handler should be set after instantiation. Such approach is used to simplify the extensibility.

Parameters
owner:DocumentHandler

the owner document handler

See Also
DocumentHandler#startElement
setParentback to summary
pack-priv final void setParent(ElementHandler parent)

Sets the element handler that contains this one. The parent element handler should be set after instantiation. Such approach is used to simplify the extensibility.

Parameters
parent:ElementHandler

the parent element handler

See Also
DocumentHandler#startElement
startElementback to summary
public void startElement()

This method is called before parsing of the element's body. All attributes are parsed at this point. By default, do nothing.