NormalizedStringAdapter (Java EE 5)

Java EE API


javax.xml.bind.annotation.adapters Class NormalizedStringAdapter

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

public final class NormalizedStringAdapter
extends XmlAdapter<String,String>

Extends: ">XmlAdapter

处理 xs:normalizedStringXmlAdapter

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

英文文档:

XmlAdapter to handle xs:normalizedString.

This adapter removes leading and trailing whitespaces, then replace any tab, CR, and LF by a whitespace character ' '.

Since:
JAXB 2.0
Author:
Kohsuke Kawaguchi

Constructor Summary
 
Method Summary
protected static boolean
 String
 String
 
Methods inherited from class java.lang.Object
 

Constructor Detail

public NormalizedStringAdapter()
英文文档:

NormalizedStringAdapter

public NormalizedStringAdapter()
Method Detail

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

unmarshal

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

Specified by:
unmarshal in class XmlAdapter<String,String>
Parameters:
text - The value to be converted. Can be null.

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

marshal

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

Specified by:
marshal in class XmlAdapter<String,String>
Parameters:
s - The value to be convereted. Can be null.

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

isWhiteSpaceExceptSpace

protected static boolean isWhiteSpaceExceptSpace(char ch)
Returns true if the specified char is a white space character but not 0x20.



Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!