Package org.apache.ws.commons.schema

Examples of org.apache.ws.commons.schema.XmlSchemaEnumerationFacet


        // Create enumeration facets for each value
        for (int i = 0; i < enums.length; i++) {

            String enumeration = enums[i].trim();
            XmlSchemaEnumerationFacet enumerationFacet = new XmlSchemaEnumerationFacet();
            enumerationFacet.setValue(enumeration);
            simpleTypeRestriction.getFacets().add(enumerationFacet);
        }

        return simpleType;
    }
View Full Code Here


        corbaEnum.setRepositoryID(REPO_STRING + name.getLocalPart().replace('.', '/') + IDL_VERSION);
        Iterator enums = restrictionType.getFacets().getIterator();

        while (enums.hasNext()) {
            XmlSchemaEnumerationFacet val = (XmlSchemaEnumerationFacet)enums.next();
            Enumerator enumerator = new Enumerator();
            enumerator.setValue(val.getValue().toString());
            corbaEnum.getEnumerator().add(enumerator);
        }
        return corbaEnum;
    }
View Full Code Here

                }
                metaInfHolder.setPatternFacet(patternString);
            }

            else if (obj instanceof XmlSchemaEnumerationFacet) {
                XmlSchemaEnumerationFacet enumeration = (XmlSchemaEnumerationFacet) obj;
                if (restriction.getBaseTypeName().equals(SchemaConstants.XSD_QNAME)) {
                    // we have to process the qname here and shoud find the local part and namespace uri
                    String value = enumeration.getValue().toString();
                    String prefix = value.substring(0, value.indexOf(":"));
                    String localPart = value.substring(value.indexOf(":") + 1);

                    String namespaceUri = parentSchema.getNamespaceContext().getNamespaceURI(prefix);
                    // set the string to suite for the convertQname method
                    String qNameString = value + "\", \"" + namespaceUri;
                    metaInfHolder.addEnumFacet(qNameString);
                } else {
                    metaInfHolder.addEnumFacet(enumeration.getValue().toString());
                }

            }

            else if (obj instanceof XmlSchemaLengthFacet) {
View Full Code Here

        Object[] constants = getTypeClass().getEnumConstants();

        List<XmlSchemaFacet> facets = restriction.getFacets();
        for (Object constant : constants) {
            XmlSchemaEnumerationFacet f = new XmlSchemaEnumerationFacet();
            f.setValue(((Enum<?>)constant).name());
            facets.add(f);
        }
    }
View Full Code Here

        XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction)type.getContent();
        List<XmlSchemaFacet> facets = restriction.getFacets();

        assertEquals(2, facets.size());

        XmlSchemaEnumerationFacet facet1 = (XmlSchemaEnumerationFacet)facets.get(0);
        XmlSchemaEnumerationFacet facet2 = (XmlSchemaEnumerationFacet)facets.get(1);

        final Map externalAttributes1 = (Map)facet1.getMetaInfoMap()
            .get(Constants.MetaDataConstants.EXTERNAL_ATTRIBUTES);
        final Map externalAttributes2 = (Map)facet2.getMetaInfoMap()
            .get(Constants.MetaDataConstants.EXTERNAL_ATTRIBUTES);

        assertNotNull(externalAttributes1);
        assertNotNull(externalAttributes2);
View Full Code Here

        corbaEnum.setQName(name);

        corbaEnum.setRepositoryID(REPO_STRING + name.getLocalPart().replace('.', '/') + IDL_VERSION);

        for (XmlSchemaFacet f : restrictionType.getFacets()) {
            XmlSchemaEnumerationFacet val = (XmlSchemaEnumerationFacet)f;
            Enumerator enumerator = new Enumerator();
            enumerator.setValue(val.getValue().toString());
            corbaEnum.getEnumerator().add(enumerator);
        }
        return corbaEnum;
    }
View Full Code Here

        Object[] constants = getTypeClass().getEnumConstants();

        List<XmlSchemaFacet> facets = restriction.getFacets();
        for (Object constant : constants) {
            XmlSchemaEnumerationFacet f = new XmlSchemaEnumerationFacet();
            f.setValue(((Enum)constant).name());
            facets.add(f);
        }
    }
View Full Code Here

        corbaEnum.setQName(name);

        corbaEnum.setRepositoryID(REPO_STRING + name.getLocalPart().replace('.', '/') + IDL_VERSION);

        for (XmlSchemaFacet f : restrictionType.getFacets()) {
            XmlSchemaEnumerationFacet val = (XmlSchemaEnumerationFacet)f;
            Enumerator enumerator = new Enumerator();
            enumerator.setValue(val.getValue().toString());
            corbaEnum.getEnumerator().add(enumerator);
        }
        return corbaEnum;
    }
View Full Code Here

        XmlSchemaSimpleTypeContent content = type.getContent();
        XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
        List<XmlSchemaFacet> facets = restriction.getFacets();
        List<String> values = new ArrayList<String>();
        for (XmlSchemaFacet facet : facets) {
            XmlSchemaEnumerationFacet enumFacet = (XmlSchemaEnumerationFacet) facet;
            values.add(enumFacet.getValue().toString());
        }
        return values;
    }
View Full Code Here

                }
                metaInfHolder.setPatternFacet(patternString);
            }

            else if (obj instanceof XmlSchemaEnumerationFacet) {
                XmlSchemaEnumerationFacet enumeration = (XmlSchemaEnumerationFacet) obj;
                if (restriction.getBaseTypeName().equals(SchemaConstants.XSD_QNAME)) {
                    // we have to process the qname here and shoud find the local part and namespace uri
                    String value = enumeration.getValue().toString();
                    String prefix = value.substring(0, value.indexOf(":"));
                    String localPart = value.substring(value.indexOf(":") + 1);

                    String namespaceUri = parentSchema.getNamespaceContext().getNamespaceURI(prefix);
                    // set the string to suite for the convertQname method
                    String qNameString = value + "\", \"" + namespaceUri;
                    metaInfHolder.addEnumFacet(qNameString);
                } else {
                    metaInfHolder.addEnumFacet(enumeration.getValue().toString());
                }

            }

            else if (obj instanceof XmlSchemaLengthFacet) {
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.schema.XmlSchemaEnumerationFacet

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.