org.apache.xerces.impl.validation.datatypes.eTypes.Data
Class BasicStringProperty

java.lang.Object
  |
  +--org.apache.xerces.impl.validation.datatypes.eTypes.Models.AbstractProperty
        |
        +--org.apache.xerces.impl.validation.datatypes.eTypes.Models.PartialOrder
              |
              +--org.apache.xerces.impl.validation.datatypes.eTypes.Data.BasicStringProperty
Direct Known Subclasses:
uri, XMLString

public class BasicStringProperty
extends PartialOrder
implements StringProperty, Property

Supports constraints on length, range (using lexicographic order) and regular expression. Empty string ("") may be valid, null string always invalid!

Version:
$Id: BasicStringProperty.java,v 1.1.2.1 2000/10/28 00:04:41 jeffreyr Exp $
Author:
Leonard C. Berman, Jeffrey Rodriguez

Inner classes inherited from class org.apache.xerces.impl.validation.datatypes.eTypes.Models.AbstractProperty
AbstractProperty.AbstractSummary
 
Inner classes inherited from class org.apache.xerces.impl.validation.datatypes.eTypes.Interfaces.Property
Property.ValidationSummary
 
Field Summary
static int classNumberSubProperties
           
static java.lang.reflect.Method evalMaxLenClosed
           
static java.lang.reflect.Method evalMaxLenOpen
           
static java.lang.reflect.Method evalMinLenClosed
           
static java.lang.reflect.Method evalMinLenOpen
           
static java.lang.reflect.Method evalPattern
           
static int MAX_LEN
          length constraints are inclusive.
static int MIN_LEN
          length constraints are inclusive.
static int PATTERN
           
 java.lang.String sValue
           
 
Fields inherited from class org.apache.xerces.impl.validation.datatypes.eTypes.Models.PartialOrder
classNumberSubProperties, CLOSED_ABOVE, CLOSED_BELOW, MAX, MIN
 
Fields inherited from class org.apache.xerces.impl.validation.datatypes.eTypes.Models.AbstractProperty
classNumberSubProperties, ht, required
 
Fields inherited from interface org.apache.xerces.impl.validation.datatypes.eTypes.Interfaces.StringProperty
classNumberSubProperties, MAX_LEN, MIN_LEN, PATTERN
 
Fields inherited from interface org.apache.xerces.impl.validation.datatypes.eTypes.Interfaces.Property
accumulate, classNumberSubProperties, constraint, eval, instance, merge
 
Constructor Summary
BasicStringProperty()
           
BasicStringProperty(java.lang.Class cl, java.lang.String str)
           
BasicStringProperty(java.lang.String str)
           
 
Method Summary
 boolean accumulate(java.lang.String dt)
           
 java.lang.Integer compareTo(java.lang.Object other)
          Compare using java.lang.String.compareTo.
protected  void enableSubProp(java.lang.String name)
          The next method is included to remind developer's that they are responsible for setting the eval and merge functions for subProp's for classes which they define.
static java.lang.Object evalMaxLenClosed(java.lang.Object obj, java.lang.Object constraint)
          Determines whether obj (which is String) has length <= constraint (which is String or Integer) Returns length if yes, else null
static java.lang.Object evalMaxLenOpen(java.lang.Object obj, java.lang.Object constraint)
          Determines whether obj (which is String) has length < constraint (which is String or Integer) Returns length if yes, else null
static java.lang.Object evalMinLenClosed(java.lang.Object obj, java.lang.Object constraint)
          Determines whether obj (which is String) has length >> constraint (which is String or Integer).
static java.lang.Object evalMinLenOpen(java.lang.Object obj, java.lang.Object constraint)
          Determines whether obj (which is String) has length > constraint (which is String or Integer).
static java.lang.Object evalPattern(java.lang.Object obj, java.lang.Object constraint)
          Determines whether obj (which is String) matches Pattern contained in constraint.
 int getMaxLength(java.lang.Integer type)
          If > 0, length of longest string which may be valid
 int getMinLength(java.lang.Integer type)
          If > 0, length of shortest string which may be valid
 java.lang.String getPattern()
          Returns pattern (Perl 5 syntax) which restricts form of valid strings
 java.lang.String getPatternOptions()
          Returns options assoc with pattern (Perl 5 syntax) (regex.jar)
 java.lang.String getSValue()
           
 java.lang.String mapString(java.lang.String o)
           
 void setMaxLength(int newMaxLength, java.lang.Integer type)
          length constraints are inclusive
 void setMinLength(int newMinLength, java.lang.Integer type)
          length constraints are inclusive
 void setPattern(java.lang.String newPattern)
          Sets pattern which restricts form of valid strings
 void setPattern(java.lang.String newPattern, java.lang.String options)
           
 void setSValue(java.lang.String newSValue)
           
 Property twin()
          Regular expressions are mutable so 'clone' it
 boolean validate(java.lang.String val)
          Null string is always invalid!
 
Methods inherited from class org.apache.xerces.impl.validation.datatypes.eTypes.Models.PartialOrder
getBound, getClosed, glb, gt, isBounded, isClosed, lt, lub, merge, merge, setBound, setClosed
 
Methods inherited from class org.apache.xerces.impl.validation.datatypes.eTypes.Models.AbstractProperty
accumulate, add2Report, clone, getJClass, getName, getPossible, getReport, getSubProp, getSubPropEval, getSubPropMerge, getSubPropName, getSubPropNameIndex, merge, msg, resetAccumulator, resetConstraint, resetInstance, setJClass, setName, setPossible, setRequired, setSubProp, setSubProp, setSubPropEval, setSubPropMerge, setSubPropName, toString, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_LEN

public static final int MAX_LEN
length constraints are inclusive. If negative, no constraint

MIN_LEN

public static final int MIN_LEN
length constraints are inclusive. If negative, no constraint

PATTERN

public static final int PATTERN

classNumberSubProperties

public static final int classNumberSubProperties

evalMinLenOpen

public static final java.lang.reflect.Method evalMinLenOpen

evalMinLenClosed

public static final java.lang.reflect.Method evalMinLenClosed

evalMaxLenOpen

public static final java.lang.reflect.Method evalMaxLenOpen

evalMaxLenClosed

public static final java.lang.reflect.Method evalMaxLenClosed

evalPattern

public static final java.lang.reflect.Method evalPattern

sValue

public java.lang.String sValue
Constructor Detail

BasicStringProperty

public BasicStringProperty()

BasicStringProperty

public BasicStringProperty(java.lang.Class cl,
                           java.lang.String str)

BasicStringProperty

public BasicStringProperty(java.lang.String str)
Method Detail

accumulate

public boolean accumulate(java.lang.String dt)

compareTo

public java.lang.Integer compareTo(java.lang.Object other)
Compare using java.lang.String.compareTo. Will compare one a BasicStringProperty or a String
Overrides:
compareTo in class PartialOrder
Tags copied from interface: PO_IF
Parameters:
other - com.ibm.eTypes.Interfaces.PO_IF
Returns:
java.lang.Integer

enableSubProp

protected void enableSubProp(java.lang.String name)
Description copied from class: AbstractProperty
The next method is included to remind developer's that they are responsible for setting the eval and merge functions for subProp's for classes which they define.
Overrides:
enableSubProp in class AbstractProperty

evalMaxLenClosed

public static final java.lang.Object evalMaxLenClosed(java.lang.Object obj,
                                                      java.lang.Object constraint)
Determines whether obj (which is String) has length <= constraint (which is String or Integer) Returns length if yes, else null

evalMaxLenOpen

public static final java.lang.Object evalMaxLenOpen(java.lang.Object obj,
                                                    java.lang.Object constraint)
Determines whether obj (which is String) has length < constraint (which is String or Integer) Returns length if yes, else null

evalMinLenClosed

public static final java.lang.Object evalMinLenClosed(java.lang.Object obj,
                                                      java.lang.Object constraint)
Determines whether obj (which is String) has length >> constraint (which is String or Integer). Returns length if yes, else null This method works for maxLen, minLen, and Length

evalMinLenOpen

public static final java.lang.Object evalMinLenOpen(java.lang.Object obj,
                                                    java.lang.Object constraint)
Determines whether obj (which is String) has length > constraint (which is String or Integer). Returns length if yes, else null This method works for maxLen, minLen, and Length

evalPattern

public static final java.lang.Object evalPattern(java.lang.Object obj,
                                                 java.lang.Object constraint)
Determines whether obj (which is String) matches Pattern contained in constraint. If constraint instanceof RegularExpression it returns Boolean.TRUE or null. If constraint instanceof Object[] && constraint[0] instanceof RegularExpression && constraint[1] instanceof Match returns the match (after matching) or null

getMaxLength

public int getMaxLength(java.lang.Integer type)
If > 0, length of longest string which may be valid

getMinLength

public int getMinLength(java.lang.Integer type)
If > 0, length of shortest string which may be valid

getPattern

public java.lang.String getPattern()
Returns pattern (Perl 5 syntax) which restricts form of valid strings
Returns:
java.lang.String

getPatternOptions

public java.lang.String getPatternOptions()
Returns options assoc with pattern (Perl 5 syntax) (regex.jar)
Returns:
java.lang.String

getSValue

public java.lang.String getSValue()
Returns:
java.lang.String

mapString

public java.lang.String mapString(java.lang.String o)

setMaxLength

public void setMaxLength(int newMaxLength,
                         java.lang.Integer type)
length constraints are inclusive

setMinLength

public void setMinLength(int newMinLength,
                         java.lang.Integer type)
length constraints are inclusive

setPattern

public void setPattern(java.lang.String newPattern)
Sets pattern which restricts form of valid strings
Parameters:
newPattern - java.lang.String

setPattern

public void setPattern(java.lang.String newPattern,
                       java.lang.String options)

setSValue

public void setSValue(java.lang.String newSValue)
Parameters:
newSValue - java.lang.String

twin

public Property twin()
Regular expressions are mutable so 'clone' it
Specified by:
twin in interface Property
Overrides:
twin in class AbstractProperty

validate

public boolean validate(java.lang.String val)
Null string is always invalid!


Copyright © 1999-2001 Apache XML Project. All Rights Reserved.