org.geotools.xs.facets
Class Whitespace

java.lang.Object
  extended by org.geotools.xs.facets.Whitespace
All Implemented Interfaces:
java.lang.Comparable

public abstract class Whitespace
extends java.lang.Object
implements java.lang.Comparable

Captures the whitespace facet.

Constants and utility method for old fashion facet goodness. See BooleanXOHandler for an example.

Here is an example use:


 <simpleType name='token'>
   <restriction base='normalizedString'>
     <whiteSpace value='collapse'/>
   </restriction>
 </simpleType>
 

Since:
1.0.0
Author:
jgarnett
See Also:
longing for Java 5 Enum construct, This web page

Field Summary
static Whitespace COLLAPSE
          All occurrences of tab, line feed and carriage return are replaced with space.
static Whitespace PRESERVE
          No normalization is done, the value is not changed
static Whitespace REPLACE
          All occurrences of tab, line feed and carriage return are replaced with space.
 
Method Summary
protected  java.lang.Object clone()
           
 int compareTo(java.lang.Object other)
           
 boolean equals(java.lang.Object other)
           
 java.lang.Class getDeclaringClass()
          Returns the Class object corresponding to this enum constant's enum type.
 int hashCode()
           
 java.lang.String name()
           
 int ordinal()
           
abstract  java.lang.String preparse(java.lang.String text)
          Handle whitespace
static Whitespace valueOf(java.lang.String whitespace)
          Returns the enum constant of the specified enum type with the specified name.
static java.util.List values()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRESERVE

public static final Whitespace PRESERVE
No normalization is done, the value is not changed

Simon the spec says: No normalization is done, the value is not changed (this is the behavior required by [XML 1.0 (Second Edition)] for element content)


REPLACE

public static final Whitespace REPLACE
All occurrences of tab, line feed and carriage return are replaced with space.

Simon the spec says: All occurrences of #x9 (tab), #xA (line feed) and #xD (carriage return) are replaced with #x20 (space)


COLLAPSE

public static final Whitespace COLLAPSE
All occurrences of tab, line feed and carriage return are replaced with space.

Simon the spec says: All occurrences of #x9 (tab), #xA (line feed) and #xD (carriage return) are replaced with #x20 (space)

Method Detail

preparse

public abstract java.lang.String preparse(java.lang.String text)
Handle whitespace


name

public java.lang.String name()

ordinal

public int ordinal()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(java.lang.Object other)
Specified by:
compareTo in interface java.lang.Comparable

valueOf

public static Whitespace valueOf(java.lang.String whitespace)
Returns the enum constant of the specified enum type with the specified name. The name must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
whitespace -

getDeclaringClass

public java.lang.Class getDeclaringClass()
Returns the Class object corresponding to this enum constant's enum type.

Returns:
Whitespace.class

values

public static java.util.List values()


Copyright © 1996-2010 Geotools. All Rights Reserved.