com.sun.tools.xjc.generator.util
Class WhitespaceNormalizer

java.lang.Object
  extended by com.sun.tools.xjc.generator.util.WhitespaceNormalizer

public abstract class WhitespaceNormalizer
extends java.lang.Object

Generates code that performs the whitespace normalization.


Field Summary
static WhitespaceNormalizer COLLAPSE
           
static WhitespaceNormalizer PRESERVE
           
static WhitespaceNormalizer REPLACE
           
 
Constructor Summary
WhitespaceNormalizer()
           
 
Method Summary
abstract  com.sun.codemodel.JExpression generate(com.sun.codemodel.JCodeModel codeModel, com.sun.codemodel.JExpression literal)
          Generates the expression that normalizes the given expression (which evaluates to java.lang.String).
static WhitespaceNormalizer parse(java.lang.String method)
          Parses "preserve","replace" or "collapse" into the corresponding WhitespaceNormalizer object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRESERVE

public static final WhitespaceNormalizer PRESERVE

REPLACE

public static final WhitespaceNormalizer REPLACE

COLLAPSE

public static final WhitespaceNormalizer COLLAPSE
Constructor Detail

WhitespaceNormalizer

public WhitespaceNormalizer()
Method Detail

generate

public abstract com.sun.codemodel.JExpression generate(com.sun.codemodel.JCodeModel codeModel,
                                                       com.sun.codemodel.JExpression literal)
Generates the expression that normalizes the given expression (which evaluates to java.lang.String).

Parameters:
codeModel - The owner code model object under which a new expression will be created.

parse

public static WhitespaceNormalizer parse(java.lang.String method)
Parses "preserve","replace" or "collapse" into the corresponding WhitespaceNormalizer object.

Parameters:
method - Either "preserve", "replace", or "collapse"
Throws:
java.lang.IllegalArgumentException - when the specified method is invalid.