FileDocCategorySizeDatePackage
NCName.javaAPI DocApache Axis 1.42830Sat Apr 22 18:57:26 BST 2006org.apache.axis.types

NCName

public class NCName extends Name
Custom class for supporting XSD data type NCName NCName represents XML "non-colonized" Names The base type of NCName is Name.
author
Chris Haddad
see
XML Schema 3.3.7
see
NCName Production

Fields Summary
Constructors Summary
public NCName()

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

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("badNCNameType00") + "data=[" +
                    stValue + "]");
        }
    
Methods Summary
public static booleanisValid(java.lang.String stValue)
validate the value against the xsd definition NCName ::= (Letter | '_') (NCNameChar)* NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender

        int scan;
        boolean bValid = true;

        for (scan=0; scan < stValue.length(); scan++) {
            if (scan == 0)
              bValid = XMLChar.isNCNameStart(stValue.charAt(scan));
            else
              bValid = XMLChar.isNCName(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 (NCName.isValid(stValue) == false)
            throw new IllegalArgumentException(
               Messages.getMessage("badNCNameType00") +
               " data=[" + stValue + "]");
        m_value = stValue;