com.opensymphony.xwork2.validator
Class ValidatorFileParser

java.lang.Object
  extended by com.opensymphony.xwork2.validator.ValidatorFileParser

public class ValidatorFileParser
extends Object

Parse the validation file. (eg. MyAction-validation.xml, MyAction-actionAlias-validation.xml) to return a List of ValidatorConfig encapsulating the validator information.

Author:
Jason Carreira, James House, tm_jee ( tm_jee (at) yahoo.co.uk ), Rob Harrop, Rene Gielen
See Also:
ValidatorConfig

Field Summary
(package private) static String DEFAULT_MULTI_TEXTVALUE_SEPARATOR
           
(package private) static String MULTI_TEXTVALUE_SEPARATOR_CONFIG_KEY
           
(package private) static String multiTextvalueSeparator
           
 
Constructor Summary
ValidatorFileParser()
           
 
Method Summary
private static void addValidatorConfigs(NodeList validatorNodes, Map extraParams, List validatorCfgs)
           
static String getMultiTextvalueSeparator()
           
static String getTextValue(Element valueEle)
          Extract trimmed text value from the given DOM element, ignoring XML comments.
static List parseActionValidatorConfigs(InputStream is, String resourceName)
          Parse resource for a list of ValidatorConfig objects.
static void parseValidatorDefinitions(InputStream is)
          Deprecated. Use parseValidatorDefinitions(InputStream, String)
static void parseValidatorDefinitions(InputStream is, String resourceName)
          Deprecated.  
static void parseValidatorDefinitions(InputStream is, String resourceName, ObjectFactory objectFactory)
          Parses validator definitions
static void setMultiTextvalueSeparator(String type)
           
private static void verifyObjectFactory(ObjectFactory objectFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MULTI_TEXTVALUE_SEPARATOR

static final String DEFAULT_MULTI_TEXTVALUE_SEPARATOR
See Also:
Constant Field Values

MULTI_TEXTVALUE_SEPARATOR_CONFIG_KEY

static final String MULTI_TEXTVALUE_SEPARATOR_CONFIG_KEY
See Also:
Constant Field Values

multiTextvalueSeparator

static String multiTextvalueSeparator
Constructor Detail

ValidatorFileParser

public ValidatorFileParser()
Method Detail

setMultiTextvalueSeparator

public static void setMultiTextvalueSeparator(String type)

getMultiTextvalueSeparator

public static String getMultiTextvalueSeparator()

parseActionValidatorConfigs

public static List parseActionValidatorConfigs(InputStream is,
                                               String resourceName)
Parse resource for a list of ValidatorConfig objects.

Parameters:
is - input stream to the resource
resourceName - file name of the resource
Returns:
List list of ValidatorConfig

parseValidatorDefinitions

public static void parseValidatorDefinitions(InputStream is)
Deprecated. Use parseValidatorDefinitions(InputStream, String)

Parses validator definitions

Parameters:
is - The input stream

parseValidatorDefinitions

public static void parseValidatorDefinitions(InputStream is,
                                             String resourceName)
Deprecated. 

Parses validator definitions

Parameters:
is - The input stream
resourceName - The location of the input stream

verifyObjectFactory

private static void verifyObjectFactory(ObjectFactory objectFactory)

parseValidatorDefinitions

public static void parseValidatorDefinitions(InputStream is,
                                             String resourceName,
                                             ObjectFactory objectFactory)
Parses validator definitions

Parameters:
is - The input stream
resourceName - The location of the input stream
Since:
1.2

getTextValue

public static String getTextValue(Element valueEle)
Extract trimmed text value from the given DOM element, ignoring XML comments. Appends all CharacterData nodes and EntityReference nodes into a single String value, excluding Comment nodes. This method is based on a method originally found in DomUtils class of Springframework.

See Also:
CharacterData, EntityReference, Comment

addValidatorConfigs

private static void addValidatorConfigs(NodeList validatorNodes,
                                        Map extraParams,
                                        List validatorCfgs)


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.