CollapsedStringAdapter (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


javax.xml.bind.annotation.adapters Class CollapsedStringAdapter

java.lang.Object
  extended by javax.xml.bind.annotation.adapters.XmlAdapter<String,String>
      extended by javax.xml.bind.annotation.adapters.CollapsedStringAdapter

public class CollapsedStringAdapter
extends XmlAdapter<String,String>

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

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

从以下版本开始:
JAXB 2.0
作者:
Kohsuke Kawaguchi

构造器摘要
CollapsedStringAdapter()
           
 
方法摘要
protected static boolean isWhiteSpace(char ch)
          returns true if the specified char is a white space character.
 String marshal(String s)
          No-op.
 String unmarshal(String text)
          Removes leading and trailing whitespaces of the string given as the parameter, then truncate any sequnce of tab, CR, LF, and SP by a single whitespace character ' '.
 
类方法继承 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造器详细信息

CollapsedStringAdapter

public CollapsedStringAdapter()
方法详细信息

unmarshal

public String unmarshal(String text)
Removes leading and trailing whitespaces of the string given as the parameter, then truncate any sequnce of tab, CR, LF, and SP by a single whitespace character ' '.

规范说明:
unmarshal in class XmlAdapter<String,String>
参数:
text - The value to be converted. Can be null.

marshal

public String marshal(String s)
No-op. Just return the same string given as the parameter.

规范说明:
marshal in class XmlAdapter<String,String>
参数:
s - The value to be convereted. Can be null.

isWhiteSpace

protected static boolean isWhiteSpace(char ch)
returns true if the specified char is a white space character.


Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.