FileDocCategorySizeDatePackage
NormalizedString.javaAPI DocApache Axis 1.43199Sat Apr 22 18:57:28 BST 2006org.apache.axis.types

NormalizedString

public class NormalizedString extends Object implements Serializable
Custom class for supporting XSD data type NormalizedString. normalizedString represents white space normalized strings. The base type of normalizedString is string.
author
Chris Haddad
see
XML Schema Part 2: Datatypes 3.3.1

Fields Summary
String
m_value
Constructors Summary
public NormalizedString()

   // JAX-RPC maps xsd:string to java.lang.String

      
        super();
    
public NormalizedString(String stValue)
ctor for NormalizedString

param
stValue is the String value
throws
IllegalArgumentException if invalid format

        setValue(stValue);
    
Methods Summary
public booleanequals(java.lang.Object object)

        String s1 = object.toString();
        return s1.equals(m_value);
    
public inthashCode()

        return m_value.hashCode();
    
public static booleanisValid(java.lang.String stValue)
validate the value against the xsd definition for the object The value space of normalizedString is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters. The lexical space of normalizedString is the set of strings that do not contain the carriage return (#xD) nor tab (#x9) characters.

param
stValue the String to test
returns
true if valid normalizedString

        int scan;

        for (scan = 0; scan < stValue.length(); scan++) {
            char cDigit = stValue.charAt(scan);
            switch (cDigit) {
                case 0x09:
                case 0x0A:
                case 0x0D:
                    return false;
                default:
                    break;
            }
        }
        return true;
    
public voidsetValue(java.lang.String stValue)
validates the data and sets the value for the object.

param
stValue String value
throws
IllegalArgumentException if invalid format

        if (NormalizedString.isValid(stValue) == false)
            throw new IllegalArgumentException(
               Messages.getMessage("badNormalizedString00") +
               " data=[" + stValue + "]");
        m_value = stValue;
    
public java.lang.StringtoString()

        return m_value;