com.opensymphony.xwork2.validator
Class DefaultValidatorFileParser

java.lang.Object
  extended by com.opensymphony.xwork2.validator.DefaultValidatorFileParser
All Implemented Interfaces:
ValidatorFileParser

public class DefaultValidatorFileParser
extends java.lang.Object
implements ValidatorFileParser

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, Martin Gilday
See Also:
ValidatorConfig

Constructor Summary
DefaultValidatorFileParser()
           
 
Method Summary
 java.lang.String getMultiTextvalueSeparator()
           
 java.lang.String getTextValue(org.w3c.dom.Element valueEle)
          Extract trimmed text value from the given DOM element, ignoring XML comments.
 java.util.List<ValidatorConfig> parseActionValidatorConfigs(ValidatorFactory validatorFactory, java.io.InputStream is, java.lang.String resourceName)
          Parse resource for a list of ValidatorConfig objects (configuring which validator(s) are being applied to a particular field etc.)
 void parseValidatorDefinitions(java.util.Map<java.lang.String,java.lang.String> validators, java.io.InputStream is, java.lang.String resourceName)
          Parses validator definitions (register various validators with XWork).
 void setMultiTextvalueSeparator(java.lang.String type)
           
 void setObjectFactory(ObjectFactory fac)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultValidatorFileParser

public DefaultValidatorFileParser()
Method Detail

setMultiTextvalueSeparator

public void setMultiTextvalueSeparator(java.lang.String type)

getMultiTextvalueSeparator

public java.lang.String getMultiTextvalueSeparator()

setObjectFactory

public void setObjectFactory(ObjectFactory fac)

parseActionValidatorConfigs

public java.util.List<ValidatorConfig> parseActionValidatorConfigs(ValidatorFactory validatorFactory,
                                                                   java.io.InputStream is,
                                                                   java.lang.String resourceName)
Description copied from interface: ValidatorFileParser
Parse resource for a list of ValidatorConfig objects (configuring which validator(s) are being applied to a particular field etc.)

Specified by:
parseActionValidatorConfigs in interface ValidatorFileParser
is - input stream to the resource
resourceName - file name of the resource
Returns:
List list of ValidatorConfig

parseValidatorDefinitions

public void parseValidatorDefinitions(java.util.Map<java.lang.String,java.lang.String> validators,
                                      java.io.InputStream is,
                                      java.lang.String resourceName)
Description copied from interface: ValidatorFileParser
Parses validator definitions (register various validators with XWork).

Specified by:
parseValidatorDefinitions in interface ValidatorFileParser
is - The input stream
resourceName - The location of the input stream

getTextValue

public java.lang.String getTextValue(org.w3c.dom.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


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