Top Description Constructors Methods
jakarta.xml.bind.annotation.adapters

public Class CollapsedStringAdapter

extends XmlAdapter<String, String>
Class Inheritance

Built-in XmlAdapter to handle xs:token and its derived types.

This adapter removes leading and trailing whitespaces, then truncate any sequence of tab, CR, LF, and SP by a single whitespace character ' '.

Author
Kohsuke Kawaguchi
Since
1.6, JAXB 2.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected static boolean
isWhiteSpace(char ch)

returns true if the specified char is a white space character.

public String
marshal(String
The value to be convereted. Can be null.
s
)

Implements abstract jakarta.xml.bind.annotation.adapters.XmlAdapter.marshal.

No-op.
public String
unmarshal(String
The value to be converted. Can be null.
text
)

Implements abstract jakarta.xml.bind.annotation.adapters.XmlAdapter.unmarshal.

Removes leading and trailing whitespaces of the string given as the parameter, then truncate any sequence of tab, CR, LF, and SP by a single whitespace character ' '.

Constructor Detail

CollapsedStringAdapterback to summary
public CollapsedStringAdapter()

Method Detail

isWhiteSpaceback to summary
protected static boolean isWhiteSpace(char ch)

returns true if the specified char is a white space character.

marshalback to summary
public String marshal(String s)

Implements abstract jakarta.xml.bind.annotation.adapters.XmlAdapter.marshal.

No-op. Just return the same string given as the parameter.

Parameters
s:String

Doc from jakarta.xml.bind.annotation.adapters.XmlAdapter.marshal.

The value to be convereted. Can be null.

Annotations
@Override
unmarshalback to summary
public String unmarshal(String text)

Implements abstract jakarta.xml.bind.annotation.adapters.XmlAdapter.unmarshal.

Removes leading and trailing whitespaces of the string given as the parameter, then truncate any sequence of tab, CR, LF, and SP by a single whitespace character ' '.

Parameters
text:String

Doc from jakarta.xml.bind.annotation.adapters.XmlAdapter.unmarshal.

The value to be converted. Can be null.

Annotations
@Override