Package org.apache.ws.jaxme.xs.xml

Examples of org.apache.ws.jaxme.xs.xml.XsERestriction


              qName = XSNotation.getInstance().getName();
            } else {
              qName = XSNMToken.getInstance().getName();
            }
            XsTLocalSimpleType simpleType = attr.createSimpleType();
            XsERestriction restriction = simpleType.createRestriction();
            restriction.setBase(new XsQName(qName.getNamespaceURI(), qName.getLocalName(), "xs"));
            if (type.startsWith("(")) {
              type = type.substring(1).trim();
            } else {
              throw new SAXParseException("The enumeration in the type of attribute "
                                            + pAttribute.getName()
                                            + " must begin with an '('.",
                                            pAttribute.getLocator());
            }
            if (type.endsWith(")")) {
                type = type.substring(0, type.length()-1).trim();
            } else {
                throw new SAXParseException("The enumeration in the type of attribute "
                                            + pAttribute.getName()
                                            + " must begin with an '('.",
                                            pAttribute.getLocator());
            }
            StringTokenizer st = new StringTokenizer(type, "|");
            if (!st.hasMoreTokens()) {
              throw new SAXParseException("The enumeration in the type of attribute "
                                            + pAttribute.getName()
                                            + " contains no tokens.",
                                            pAttribute.getLocator());
            }
            while (st.hasMoreTokens()) {
                String token = st.nextToken().trim();
                if ("".equals(token)) {
                  throw new SAXParseException("The enumeration in the type of attribute "
                                                + pAttribute.getName()
                                                + " contains an empty token.",
                                                pAttribute.getLocator());
                }
                XsEEnumeration enumeration = restriction.createEnumeration();
                enumeration.setValue(token);
            }
            qName = null;
        }
        if (qName != null) {
View Full Code Here


              qName = XSNotation.getInstance().getName();
            } else {
              qName = XSNMToken.getInstance().getName();
            }
            XsTLocalSimpleType simpleType = attr.createSimpleType();
            XsERestriction restriction = simpleType.createRestriction();
            restriction.setBase(new XsQName(qName.getNamespaceURI(), qName.getLocalName(), "xs"));
            if (type.startsWith("(")) {
              type = type.substring(1).trim();
            } else {
              throw new SAXParseException("The enumeration in the type of attribute "
                                            + pAttribute.getName()
                                            + " must begin with an '('.",
                                            pAttribute.getLocator());
            }
            if (type.endsWith(")")) {
                type = type.substring(0, type.length()-1).trim();
            } else {
                throw new SAXParseException("The enumeration in the type of attribute "
                                            + pAttribute.getName()
                                            + " must begin with an '('.",
                                            pAttribute.getLocator());
            }
            StringTokenizer st = new StringTokenizer(type, "|");
            if (!st.hasMoreTokens()) {
              throw new SAXParseException("The enumeration in the type of attribute "
                                            + pAttribute.getName()
                                            + " contains no tokens.",
                                            pAttribute.getLocator());
            }
            while (st.hasMoreTokens()) {
                String token = st.nextToken().trim();
                if ("".equals(token)) {
                  throw new SAXParseException("The enumeration in the type of attribute "
                                                + pAttribute.getName()
                                                + " contains an empty token.",
                                                pAttribute.getLocator());
                }
                XsEEnumeration enumeration = restriction.createEnumeration();
                enumeration.setValue(token);
            }
            qName = null;
        }
        if (qName != null) {
View Full Code Here

              qName = XSNotation.getInstance().getName();
            } else {
              qName = XSNMToken.getInstance().getName();
            }
            XsTLocalSimpleType simpleType = attr.createSimpleType();
            XsERestriction restriction = simpleType.createRestriction();
            restriction.setBase(new XsQName(qName.getNamespaceURI(), qName.getLocalName(), "xs"));
            if (type.startsWith("(")) {
              type = type.substring(1).trim();
            } else {
              throw new SAXParseException("The enumeration in the type of attribute "
                                            + pAttribute.getName()
                                            + " must begin with an '('.",
                                            pAttribute.getLocator());
            }
            if (type.endsWith(")")) {
                type = type.substring(0, type.length()-1).trim();
            } else {
                throw new SAXParseException("The enumeration in the type of attribute "
                                            + pAttribute.getName()
                                            + " must begin with an '('.",
                                            pAttribute.getLocator());
            }
            StringTokenizer st = new StringTokenizer(type, "|");
            if (!st.hasMoreTokens()) {
              throw new SAXParseException("The enumeration in the type of attribute "
                                            + pAttribute.getName()
                                            + " contains no tokens.",
                                            pAttribute.getLocator());
            }
            while (st.hasMoreTokens()) {
                String token = st.nextToken().trim();
                if ("".equals(token)) {
                  throw new SAXParseException("The enumeration in the type of attribute "
                                                + pAttribute.getName()
                                                + " contains an empty token.",
                                                pAttribute.getLocator());
                }
                XsEEnumeration enumeration = restriction.createEnumeration();
                enumeration.setValue(token);
            }
            qName = null;
        }
        if (qName != null) {
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.xs.xml.XsERestriction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.