Public Member Functions

org.exolab.castor.xml.validators.StringValidator Class Reference

Inheritance diagram for org.exolab.castor.xml.validators.StringValidator:
org.exolab.castor.xml.validators.PatternValidator org.exolab.castor.xml.TypeValidator org.exolab.castor.xml.validators.NameValidator

List of all members.

Public Member Functions

 StringValidator ()
void setFixed (String fixedValue)
void setFixedValue (String fixedValue)
void setMaxLength (int maxLength)
void setMinLength (int minLength)
void setLength (int length)
void setRequired (boolean required)
void setWhiteSpace (String value)
String normalize (String value)
void validate (String value, ValidationContext context) throws ValidationException
void validate (Object object) throws ValidationException
void validate (Object object, ValidationContext context) throws ValidationException

Detailed Description

The String Validation class

Author:
Keith Visco
Version:
Revision:
1.4
Date:
2004/12/11 09:13:52

Constructor & Destructor Documentation

org.exolab.castor.xml.validators.StringValidator.StringValidator (  ) 

Creates a new StringValidator with no restrictions


Member Function Documentation

String org.exolab.castor.xml.validators.StringValidator.normalize ( String  value  ) 

NOTE: THIS METHOD SHOULD NOT BE HERE..SHOULD BE MOVED TO A FieldHandler or to the Unmarshaller...but not here!!! (kvisco 20030125)

Normalizes the given string according to the whiteSpace facet used

Parameters:
value the String to normalize

Referenced by org.exolab.castor.xml.validators.StringValidator.validate().

void org.exolab.castor.xml.validators.StringValidator.setFixed ( String  fixedValue  ) 

Sets the fixed value in which all valid Strings must match.

Parameters:
fixedValue the fixed value that all Strings must match

Referenced by org.exolab.castor.xml.validators.StringValidator.setFixedValue().

void org.exolab.castor.xml.validators.StringValidator.setFixedValue ( String  fixedValue  ) 

Only used for backward compatibility for object model generated with an old version of Castor

Deprecated:
since 0.9.4_beta

References org.exolab.castor.xml.validators.StringValidator.setFixed().

void org.exolab.castor.xml.validators.StringValidator.setLength ( int  length  ) 

Sets the length that valid Strings must be

Parameters:
length the length that valid Strings must be

References org.exolab.castor.xml.validators.StringValidator.setMaxLength(), and org.exolab.castor.xml.validators.StringValidator.setMinLength().

void org.exolab.castor.xml.validators.StringValidator.setMaxLength ( int  maxLength  ) 

Sets the maximum length of that a valid String must be. To remove the max length facet, use a negative value.

Parameters:
maxLength the maximum length for valid Strings

Referenced by org.exolab.castor.xml.validators.StringValidator.setLength().

void org.exolab.castor.xml.validators.StringValidator.setMinLength ( int  minLength  ) 

Sets the minimum length that valid Strings must be

Parameters:
minLength the minimum length that valid Strings must be

Referenced by org.exolab.castor.xml.validators.StringValidator.setLength().

void org.exolab.castor.xml.validators.StringValidator.setRequired ( boolean  required  ) 

Sets whether or not a String is required (non null)

Parameters:
required the flag indicating whether Strings are required

Reimplemented in org.exolab.castor.xml.validators.NameValidator.

void org.exolab.castor.xml.validators.StringValidator.setWhiteSpace ( String  value  ) 

Sets the whiteSpace facet of the validator

The value of the whiteSpace facet must be one of the following:

  • preserve
  • replace
  • collapse

any other value will generate a Warning and set the whiteSpace to preserved

Parameters:
whiteSpace the whiteSpace value

Referenced by org.exolab.castor.mapping.xml.BindXmlDescriptor.BindXmlDescriptor(), org.exolab.castor.mapping.xml.CacheTypeMappingDescriptor.CacheTypeMappingDescriptor(), org.exolab.castor.mapping.xml.ClassMappingDescriptor.ClassMappingDescriptor(), org.exolab.castor.builder.binding.ClassTypeDescriptor.ClassTypeDescriptor(), org.exolab.castor.builder.binding.ComponentBindingTypeDescriptor.ComponentBindingTypeDescriptor(), alma.acs.tools.comphelpergen.generated.ComponentHelperInfoDescriptor.ComponentHelperInfoDescriptor(), alma.acs.tools.comphelpergen.generated.ComponentInterfaceDescriptor.ComponentInterfaceDescriptor(), org.exolab.castor.mapping.xml.ContainerDescriptor.ContainerDescriptor(), alma.tools.entitybuilder.generated.EntitySchemaDescriptor.EntitySchemaDescriptor(), org.exolab.castor.mapping.xml.FieldMappingDescriptor.FieldMappingDescriptor(), org.exolab.castor.builder.binding.FieldTypeDescriptor.FieldTypeDescriptor(), org.exolab.castor.mapping.xml.IncludeDescriptor.IncludeDescriptor(), org.exolab.castor.builder.binding.InterfaceDescriptor.InterfaceDescriptor(), org.exolab.castor.mapping.xml.KeyGeneratorDefDescriptor.KeyGeneratorDefDescriptor(), org.exolab.castor.mapping.xml.MappingRootDescriptor.MappingRootDescriptor(), org.exolab.castor.mapping.xml.MapToDescriptor.MapToDescriptor(), org.exolab.castor.builder.binding.NamingTypeDescriptor.NamingTypeDescriptor(), org.exolab.castor.builder.binding.PackageTypeChoiceDescriptor.PackageTypeChoiceDescriptor(), org.exolab.castor.builder.binding.PackageTypeDescriptor.PackageTypeDescriptor(), org.exolab.castor.mapping.xml.ParamDescriptor.ParamDescriptor(), org.exolab.castor.mapping.xml.PropertyTypeDescriptor.PropertyTypeDescriptor(), org.exolab.castor.mapping.xml.SqlDescriptor.SqlDescriptor(), and alma.tools.entitybuilder.generated.XmlNamespace2JPackageDescriptor.XmlNamespace2JPackageDescriptor().

void org.exolab.castor.xml.validators.StringValidator.validate ( Object  object,
ValidationContext  context 
) throws ValidationException

Validates the given Object

Parameters:
object the Object to validate
context the ValidationContext

Implements org.exolab.castor.xml.TypeValidator.

Reimplemented in org.exolab.castor.xml.validators.NameValidator.

References org.exolab.castor.xml.validators.StringValidator.validate().

void org.exolab.castor.xml.validators.StringValidator.validate ( Object  object  )  throws ValidationException

Validates the given Object

Parameters:
object the Object to validate

Reimplemented in org.exolab.castor.xml.validators.NameValidator.

References org.exolab.castor.xml.validators.StringValidator.validate().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties