Package org.apache.ws.commons.schema

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


                                         Resource metadata) throws RegistryException {

        List associations = new ArrayList();
        if (processIncludes) {
            // first process the imports and includes
            XmlSchemaObjectCollection includes = xmlSchema.getIncludes();
            // set this as an visited schema to stop recursion
            visitedSchemas.add(xmlSchema.getSourceURI());
            if (includes != null) {
                for (Iterator iter = includes.getIterator(); iter.hasNext();) {
                    Object externalComponent = iter.next();
                    if (externalComponent instanceof XmlSchemaExternal) {
                        XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal)externalComponent;
                        String sourceURI = xmlSchemaExternal.getSchema().getSourceURI();
                        if (!visitedSchemas.contains(sourceURI)) {
View Full Code Here


                                             OMFactory fac, boolean json,
                                             boolean isInnerParam) throws AxisFault {
        XmlSchemaParticle particle = complexType.getParticle();
        if (particle instanceof XmlSchemaSequence) {
            XmlSchemaSequence xmlSchemaSequence = (XmlSchemaSequence) particle;
            XmlSchemaObjectCollection schemaObjectCollection = xmlSchemaSequence.getItems();
            int count = schemaObjectCollection.getCount();
            Iterator iterator = schemaObjectCollection.getIterator();
            // now we need to know some information from the binding operation.
            while (iterator.hasNext()) {
                XmlSchemaElement innerElement = (XmlSchemaElement) iterator.next();
                String name = innerElement.getName();
                XmlSchemaType schemaType = innerElement.getSchemaType();
View Full Code Here

                                (XmlSchemaSimpleTypeRestriction) content;
                        String elementName = innerElement.getName();
                        Object object = handleSimpleElement(payload, engine, elementName,
                                innerElement.getMinOccurs(),
                                simpleTypeRestriction.getBaseTypeName());
                        XmlSchemaObjectCollection facets = simpleTypeRestriction.getFacets();
                        Iterator iterator1 = facets.getIterator();
                        // Used to check whether the incoming value of the enumeration matches one thats defined in the
                        // schema.
                        boolean valueFound = false;
                        while (iterator1.hasNext()) {
                            XmlSchemaEnumerationFacet enumerationFacet =
View Full Code Here

   * @param schema The target schema to be checked
   * @param schemaImport The schema import
   * @return true if the schema import is there in the given schema
   */
  private static boolean containsSchemaImport(XmlSchema schema, XmlSchemaImport schemaImport) {
    XmlSchemaObjectCollection list = schema.getItems();
    int c = list.getCount();
    XmlSchemaObject obj;
    for (int i = 0; i < c; i++) {
      obj = list.getItem(i);
      if (obj instanceof XmlSchemaImport) {
        if (((XmlSchemaImport) obj).getNamespace().equals(schemaImport.getNamespace())) {
          return true;
        }
      }
View Full Code Here

            }
        }
    }

  private void updateSchemaLocation(XmlSchema schema) throws AxisFault {
        XmlSchemaObjectCollection includes = schema.getIncludes();
        for (int j = 0; j < includes.getCount(); j++) {
            Object item = includes.getItem(j);
            if (item instanceof XmlSchemaExternal) {
                XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal) item;
                XmlSchema s = xmlSchemaExternal.getSchema();
                updateSchemaLocation(s, xmlSchemaExternal);
            }
View Full Code Here

  private void calculateSchemaNames(List schemas, Hashtable nameTable,
      Hashtable sourceURIToNewLocationMap, boolean overrideAbsoluteAddress) {
    // first traversal - fill the hashtable
    for (int i = 0; i < schemas.size(); i++) {
      XmlSchema schema = (XmlSchema) schemas.get(i);
      XmlSchemaObjectCollection includes = schema.getIncludes();

      for (int j = 0; j < includes.getCount(); j++) {
        Object item = includes.getItem(j);
        XmlSchema s;
        if (item instanceof XmlSchemaExternal) {
          XmlSchemaExternal externalSchema = (XmlSchemaExternal) item;
          s = externalSchema.getSchema();
View Full Code Here

   * @param parentSchema
   * @param nameTable
   */
  private void adjustSchemaName(XmlSchema parentSchema, Hashtable nameTable,
      Hashtable importedScheams, Hashtable sourceURIToNewLocationMap) {
    XmlSchemaObjectCollection includes = parentSchema.getIncludes();
    for (int j = 0; j < includes.getCount(); j++) {
      Object item = includes.getItem(j);
      if (item instanceof XmlSchemaExternal) {
        XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal) item;
        XmlSchema s = xmlSchemaExternal.getSchema();
        adjustSchemaLocation(s, xmlSchemaExternal, nameTable,
            importedScheams, sourceURIToNewLocationMap);
View Full Code Here

        XmlSchemaElement xmlSchemaElement = null;
        if (schema != null) {
            xmlSchemaElement = schema.getElementByName(this.elementQname);
            if (xmlSchemaElement == null) {
                // try to find in an import or an include
                XmlSchemaObjectCollection includes = schema.getIncludes();
                if (includes != null) {
                    Iterator includesIter = includes.getIterator();
                    Object object;
                    while (includesIter.hasNext()) {
                        object = includesIter.next();
                        if (object instanceof XmlSchemaImport) {
                            XmlSchema schema1 = ((XmlSchemaImport) object).getSchema();
View Full Code Here

    }
   
    Result result = new Result(elementName, rowName, namespace, null, DBConstants.ResultTypes.XML);
    OutputElementGroup defGroup = new OutputElementGroup(null, null, null);
   
    XmlSchemaObjectCollection dataSchemaObjects = getSchemaObjectsFromComplexType(dataFieldsType);
   
    int count = dataSchemaObjects.getCount();   
    XmlSchemaObject sequenceDataObject;
    XmlSchemaElement sequenceDataElement;
    XmlSchemaAttribute sequenceDataAttr;
    for (int i = 0; i < count; i++) {
      sequenceDataObject = dataSchemaObjects.getItem(i);
      if (sequenceDataObject instanceof XmlSchemaElement) {
        sequenceDataElement = (XmlSchemaElement) sequenceDataObject;
        if (!(sequenceDataElement.getSchemaType() instanceof XmlSchemaSimpleType)) {
          throw new DataServiceFault(
              "Xmlschema sequence's data fields at the out message of the operation '"
View Full Code Here

    // a single sequence must be there
    if (!(wrapperSchemaParticle instanceof XmlSchemaSequence)) {
      return false;
    }
    XmlSchemaSequence wrapperSchemaSequence = (XmlSchemaSequence) wrapperSchemaParticle;
    XmlSchemaObjectCollection objects = wrapperSchemaSequence.getItems();
    if (objects.getCount() != 1) {
      return false;
    }
    XmlSchemaObject schemaObject = objects.getItem(0);
    if (!(schemaObject instanceof XmlSchemaElement)) {
      return false;
    }
    XmlSchemaElement schemaElement = (XmlSchemaElement) schemaObject;
    if (!((((XmlSchemaComplexType) schemaElement.getSchemaType())
View Full Code Here

TOP

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

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.