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

Name

public class Name extends Token
Custom class for supporting XSD data type Name Name represents XML Names. The value space of Name is the set of all strings which match the Name production of [XML 1.0 (Second Edition)]. The base type of Name is token.
author
Chris Haddad
see
XML Schema 3.3.6

Fields Summary
Constructors Summary
public Name()

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

exception
IllegalArgumentException will be thrown if validation fails

        try {
            setValue(stValue);
        }
        catch (IllegalArgumentException e) {
            // recast normalizedString exception as token exception
            throw new IllegalArgumentException(
                 Messages.getMessage("badNameType00") + "data=[" +
                 stValue + "]");
        }
    
Methods Summary
public static booleanisValid(java.lang.String stValue)
validate the value against the xsd definition Name ::= (Letter | '_' | ':') ( NameChar)* NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender

        int scan;
        boolean bValid = true;

        for (scan=0; scan < stValue.length(); scan++) {
          if (scan == 0)
             bValid = XMLChar.isNameStart(stValue.charAt(scan));
          else
             bValid = XMLChar.isName(stValue.charAt(scan));
          if (bValid == false)
              break;
        }

        return bValid;
    
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 (Name.isValid(stValue) == false)
            throw new IllegalArgumentException(
               Messages.getMessage("badNameType00") +
               " data=[" + stValue + "]");
        m_value = stValue;