JavaTM 2 Platform
Standard Ed. 6

javax.xml.bind.annotation.adapters
類別 CollapsedStringAdapter

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

public class CollapsedStringAdapter
extends XmlAdapter<String,String>

用來處理 xs:token 及其派生型別的內置 XmlAdapter

此適配器移除前導空白和尾部空白,然後用單個空白字元“ ”截斷任何製表符、CR、LF 和 SP 序列。

從以下版本開始:
JAXB 2.0

建構子摘要
CollapsedStringAdapter()
           
 
方法摘要
protected static boolean isWhiteSpace(char ch)
          如果指定的 char 是空白字元,則返回 true。
 String marshal(String s)
          無任何操作。
 String unmarshal(String text)
          移除作為參數提供的字元串的前導空白和尾部空白,然後用單個空白字元“ ”截斷任何製表符、CR、LF 和 SP 序列。
 
從類別 java.lang.Object 繼承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

建構子詳細資訊

CollapsedStringAdapter

public CollapsedStringAdapter()
方法詳細資訊

unmarshal

public String unmarshal(String text)
移除作為參數提供的字元串的前導空白和尾部空白,然後用單個空白字元“ ”截斷任何製表符、CR、LF 和 SP 序列。

指定者:
類別 XmlAdapter<String,String> 中的 unmarshal
參數:
text - 要轉換的值。可以為 null。

marshal

public String marshal(String s)
無任何操作。僅返回作為參數提供的字元串。

指定者:
類別 XmlAdapter<String,String> 中的 marshal
參數:
s - 要轉換的值。可以為 null。

isWhiteSpace

protected static boolean isWhiteSpace(char ch)
如果指定的 char 是空白字元,則返回 true。


JavaTM 2 Platform
Standard Ed. 6

提交錯誤或意見

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