Top Description Fields Constructors Methods
com.sun.beans.decoder

public Class StringElementHandler

extends ElementHandler
Class Inheritance
Known Direct Subclasses
com.sun.beans.decoder.BooleanElementHandler, com.sun.beans.decoder.ByteElementHandler, com.sun.beans.decoder.CharElementHandler, com.sun.beans.decoder.ClassElementHandler, com.sun.beans.decoder.DoubleElementHandler, com.sun.beans.decoder.FloatElementHandler, com.sun.beans.decoder.IntElementHandler, com.sun.beans.decoder.LongElementHandler, com.sun.beans.decoder.ShortElementHandler

This class is intended to handle <string> element. This element specifies String values. The result value is created from text of the body of this element. For example:
<string>description</string>
is equivalent to "description" in Java code. The value of inner element is calculated before adding to the string using String#valueOf(Object). Note that all characters are used including whitespaces (' ', '\t', '\n', '\r'). So the value of the element
<string><true></string>
is not equal to the value of the element
<string>
    <true>
</string>

The following attribute is supported:

id
the identifier of the variable that is intended to store the result
Author
Sergey A. Malenkov
Since
1.7

Field Summary

Modifier and TypeField and Description
private StringBuilder
private ValueObject

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Overrides com.sun.beans.decoder.ElementHandler.addArgument.

Adds the string value of the argument to the string value of this element.
public final void
addCharacter(char
the character
ch
)

Overrides com.sun.beans.decoder.ElementHandler.addCharacter.

Adds the character that contained in this element.
protected Object

Returns:

evaluated value
getValue
(String
the text of the body
argument
)

Returns the text of the body of this element.

protected final ValueObject

Returns:

the value of this element
getValueObject
()

Implements abstract com.sun.beans.decoder.ElementHandler.getValueObject.

Returns the value of this element.
Inherited from com.sun.beans.decoder.ElementHandler:
addAttributeendElementgetContextBeangetOwnergetParentgetVariableisArgumentsetOwnersetParentstartElement

Field Detail

sbback to summary
private StringBuilder sb
valueback to summary
private ValueObject value

Constructor Detail

StringElementHandlerback to summary
public StringElementHandler()

Method Detail

addArgumentback to summary
protected final void addArgument(Object argument)

Overrides com.sun.beans.decoder.ElementHandler.addArgument.

Adds the string value of the argument to the string value of this element.

Parameters
argument:Object

the value of the element that contained in this one

Annotations
@Override
addCharacterback to summary
public final void addCharacter(char ch)

Overrides com.sun.beans.decoder.ElementHandler.addCharacter.

Adds the character that contained in this element.

Parameters
ch:char

the character

Annotations
@Override
getValueback to summary
protected Object getValue(String argument)

Returns the text of the body of this element. This method evaluates value from text of the body, and should be overridden in those handlers that extend behavior of this element.

Parameters
argument:String

the text of the body

Returns:Object

evaluated value

getValueObjectback to summary
protected final ValueObject getValueObject()

Implements abstract com.sun.beans.decoder.ElementHandler.getValueObject.

Returns the value of this element.

Returns:ValueObject

the value of this element

Annotations
@Override