JavaTM 2 Platform
Standard Ed. 6

javax.xml.bind.annotation.adapters
类 NormalizedStringAdapter

java.lang.Object
  继承者 javax.xml.bind.annotation.adapters.XmlAdapter<String,String>
      继承者 javax.xml.bind.annotation.adapters.NormalizedStringAdapter

public final class NormalizedStringAdapter
extends XmlAdapter<String,String>

处理 xs:normalizedStringXmlAdapter

此适配器移除前导空白和尾部空白,然后用单个空白字符“ ”截断所有制表符、CR 和 LF。

从以下版本开始:
JAXB 2.0

构造方法摘要
NormalizedStringAdapter()
           
 
方法摘要
protected static boolean isWhiteSpaceExceptSpace(char ch)
          如果指定的 char 是空白字符但不是 0x20,则返回 true。
 String marshal(String s)
          无任何操作。
 String unmarshal(String text)
          移除作为参数给定的字符串的前导空白和尾部空白,然后用单个空白字符“ ”替换所有制表符、CR 和 LF。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

NormalizedStringAdapter

public NormalizedStringAdapter()
方法详细信息

unmarshal

public String unmarshal(String text)
移除作为参数给定的字符串的前导空白和尾部空白,然后用单个空白字符“ ”替换所有制表符、CR 和 LF。

指定者:
XmlAdapter<String,String> 中的 unmarshal
参数:
text - 要转换的值。可以为 null。

marshal

public String marshal(String s)
无任何操作。仅返回作为参数提供的字符串。

指定者:
XmlAdapter<String,String> 中的 marshal
参数:
s - 要转换的值。可以为 null。

isWhiteSpaceExceptSpace

protected static boolean isWhiteSpaceExceptSpace(char ch)
如果指定的 char 是空白字符但不是 0x20,则返回 true。


JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only