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

NMToken

public class NMToken extends Token
Custom class for supporting XSD data type NMToken NMTOKEN represents the NMTOKEN attribute type from [XML 1.0(Second Edition)]. The value space of NMTOKEN is the set of tokens that match the Nmtoken production in [XML 1.0 (Second Edition)]. The base type of NMTOKEN is token.
author
Chris Haddad
see
XML Schema 3.3.4

Fields Summary
Constructors Summary
public NMToken()

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

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

        int scan;

        for (scan=0; scan < stValue.length(); scan++) {
          if (XMLChar.isName(stValue.charAt(scan)) == false)
            return false;
        }

        return true;