Codota Logo
XmlSchemaObjectCollection.add
Code IndexAdd Codota to your IDE (free)

How to use
add
method
in
org.apache.ws.commons.schema.XmlSchemaObjectCollection

Best Java code snippets using org.apache.ws.commons.schema.XmlSchemaObjectCollection.add (Showing top 20 results out of 315)

  • Common ways to obtain XmlSchemaObjectCollection
private void myMethod () {
XmlSchemaObjectCollection x =
  • Codota Iconnew XmlSchemaObjectCollection()
  • Codota IconXmlSchema xmlSchema;xmlSchema.getItems()
  • Codota IconXmlSchema xmlSchema;xmlSchema.getIncludes()
  • Smart code suggestions by Codota
}
origin: org.apache.ws.commons.schema/XmlSchema

private XmlSchemaAttributeGroup handleAttributeGroup(XmlSchema schema,
    Element groupEl, Element schemaEl) {
  XmlSchemaAttributeGroup attrGroup = new XmlSchemaAttributeGroup();
  if (groupEl.hasAttribute("name"))
    attrGroup.name = new QName(schema.getTargetNamespace(), groupEl
        .getAttribute("name"));
  if (groupEl.hasAttribute("id"))
    attrGroup.id = groupEl.getAttribute("id");
  for (Element el = XDOMUtil.getFirstChildElementNS(groupEl,
      XmlSchema.SCHEMA_NS); el != null; el = XDOMUtil
      .getNextSiblingElementNS(el, XmlSchema.SCHEMA_NS)) {
    if (el.getLocalName().equals("attribute")) {
      XmlSchemaAttribute attr = handleAttribute(schema, el, schemaEl);
      attrGroup.attributes.add(attr);
    } else if (el.getLocalName().equals("attributeGroup")) {
      XmlSchemaAttributeGroupRef attrGroupRef = handleAttributeGroupRef(el);
      attrGroup.attributes.add(attrGroupRef);
    } else if (el.getLocalName().equals("anyAttribute")) {
      attrGroup.anyAttribute = handleAnyAttribute(schema, el,
          schemaEl);
    } else if (el.getLocalName().equals("annotation")) {
      XmlSchemaAnnotation ann = handleAnnotation(el);
      attrGroup.setAnnotation(ann);
    }
  }
  return attrGroup;
}
origin: org.apache.ws.commons.schema/XmlSchema

  choice.items.add(seq);
} else if (el.getLocalName().equals("element")) {
  XmlSchemaElement element = handleElement(schema, el, schemaEl,
      false);
  choice.items.add(element);
} else if (el.getLocalName().equals("group")) {
  XmlSchemaGroupRef group = handleGroupRef(schema, el, schemaEl);
  choice.items.add(group);
} else if (el.getLocalName().equals("choice")) {
  XmlSchemaChoice choiceItem = handleChoice(schema, el, schemaEl);
  choice.items.add(choiceItem);
} else if (el.getLocalName().equals("any")) {
  XmlSchemaAny any = handleAny(schema, el, schemaEl);
  choice.items.add(any);
} else if (el.getLocalName().equals("annotation")) {
  XmlSchemaAnnotation annotation = handleAnnotation(el);
origin: org.apache.ws.schema/XmlSchema

private XmlSchemaAttributeGroup handleAttributeGroup(XmlSchema schema,
    Element groupEl, Element schemaEl) {
  XmlSchemaAttributeGroup attrGroup = new XmlSchemaAttributeGroup();
  if (groupEl.hasAttribute("name"))
    attrGroup.name = new QName(schema.getTargetNamespace(), groupEl
        .getAttribute("name"));
  if (groupEl.hasAttribute("id"))
    attrGroup.id = groupEl.getAttribute("id");
  for (Element el = XDOMUtil.getFirstChildElementNS(groupEl,
      XmlSchema.SCHEMA_NS); el != null; el = XDOMUtil
      .getNextSiblingElementNS(el, XmlSchema.SCHEMA_NS)) {
    if (el.getLocalName().equals("attribute")) {
      XmlSchemaAttribute attr = handleAttribute(schema, el, schemaEl);
      attrGroup.attributes.add(attr);
    } else if (el.getLocalName().equals("attributeGroup")) {
      XmlSchemaAttributeGroupRef attrGroupRef = handleAttributeGroupRef(el);
      attrGroup.attributes.add(attrGroupRef);
    } else if (el.getLocalName().equals("anyAttribute")) {
      attrGroup.anyAttribute = handleAnyAttribute(schema, el,
          schemaEl);
    } else if (el.getLocalName().equals("annotation")) {
      XmlSchemaAnnotation ann = handleAnnotation(el);
      attrGroup.setAnnotation(ann);
    }
  }
  return attrGroup;
}
origin: org.apache.ws.schema/XmlSchema

private XmlSchemaSimpleContentExtension handleSimpleContentExtension(
    XmlSchema schema, Element extEl, Element schemaEl) {
  XmlSchemaSimpleContentExtension ext = new XmlSchemaSimpleContentExtension();
  if (extEl.hasAttribute("base")) {
    String name = extEl.getAttribute("base");
    ext.baseTypeName = getRefQName(name, extEl);
  }
  for (Element el = XDOMUtil.getFirstChildElementNS(extEl,
      XmlSchema.SCHEMA_NS); el != null; el = XDOMUtil
      .getNextSiblingElementNS(el, XmlSchema.SCHEMA_NS)) {
    if (el.getLocalName().equals("attribute")) {
      XmlSchemaAttribute attr = handleAttribute(schema, el, schemaEl);
      ext.attributes.add(attr);
    } else if (el.getLocalName().equals("attributeGroup")) {
      XmlSchemaAttributeGroupRef attrGroup = handleAttributeGroupRef(el);
      ext.attributes.add(attrGroup);
    } else if (el.getLocalName().equals("anyAttribute")) {
      ext.anyAttribute = handleAnyAttribute(schema, el, schemaEl);
    } else if (el.getLocalName().equals("annotation")) {
      XmlSchemaAnnotation ann = handleAnnotation(el);
      ext.setAnnotation(ann);
    }
  }
  return ext;
}
origin: org.apache.ws.commons.schema/XmlSchema

private XmlSchemaSimpleContentExtension handleSimpleContentExtension(
    XmlSchema schema, Element extEl, Element schemaEl) {
  XmlSchemaSimpleContentExtension ext = new XmlSchemaSimpleContentExtension();
  if (extEl.hasAttribute("base")) {
    String name = extEl.getAttribute("base");
    ext.baseTypeName = getRefQName(name, extEl);
  }
  for (Element el = XDOMUtil.getFirstChildElementNS(extEl,
      XmlSchema.SCHEMA_NS); el != null; el = XDOMUtil
      .getNextSiblingElementNS(el, XmlSchema.SCHEMA_NS)) {
    if (el.getLocalName().equals("attribute")) {
      XmlSchemaAttribute attr = handleAttribute(schema, el, schemaEl);
      ext.attributes.add(attr);
    } else if (el.getLocalName().equals("attributeGroup")) {
      XmlSchemaAttributeGroupRef attrGroup = handleAttributeGroupRef(el);
      ext.attributes.add(attrGroup);
    } else if (el.getLocalName().equals("anyAttribute")) {
      ext.anyAttribute = handleAnyAttribute(schema, el, schemaEl);
    } else if (el.getLocalName().equals("annotation")) {
      XmlSchemaAnnotation ann = handleAnnotation(el);
      ext.setAnnotation(ann);
    }
  }
  return ext;
}
origin: org.apache.ws.schema/XmlSchema

private XmlSchemaComplexContentExtension handleComplexContentExtension(
    XmlSchema schema, Element extEl, Element schemaEl) {
  XmlSchemaComplexContentExtension ext = new XmlSchemaComplexContentExtension();
  if (extEl.hasAttribute("base")) {
    String name = extEl.getAttribute("base");
    ext.baseTypeName = getRefQName(name, extEl);
  }
  for (Element el = XDOMUtil.getFirstChildElementNS(extEl,
      XmlSchema.SCHEMA_NS); el != null; el = XDOMUtil
      .getNextSiblingElementNS(el, XmlSchema.SCHEMA_NS)) {
    if (el.getLocalName().equals("sequence")) {
      ext.particle = handleSequence(schema, el, schemaEl);
    } else if (el.getLocalName().equals("choice")) {
      ext.particle = handleChoice(schema, el, schemaEl);
    } else if (el.getLocalName().equals("all")) {
      ext.particle = handleAll(schema, el, schemaEl);
    } else if (el.getLocalName().equals("attribute")) {
      ext.attributes.add(handleAttribute(schema, el, schemaEl));
    } else if (el.getLocalName().equals("attributeGroup")) {
      ext.attributes.add(handleAttributeGroupRef(el));
    } else if (el.getLocalName().equals("group")) {
      ext.particle = handleGroupRef(schema, el, schemaEl);
    } else if (el.getLocalName().equals("anyAttribute")) {
      ext.anyAttribute = handleAnyAttribute(schema, el, schemaEl);
    } else if (el.getLocalName().equals("annotation")) {
      ext.setAnnotation(handleAnnotation(el));
    }
  }
  return ext;
}
origin: org.apache.ws.commons.schema/XmlSchema

} else if (el.getLocalName().equals("attribute")) {
  restriction.attributes
      .add(handleAttribute(schema, el, schemaEl));
} else if (el.getLocalName().equals("attributeGroup")) {
  restriction.attributes.add(handleAttributeGroupRef(el));
} else if (el.getLocalName().equals("group")) {
  restriction.particle = handleGroupRef(schema, el, schemaEl);
origin: org.apache.ws.commons.schema/XmlSchema

private XmlSchemaComplexContentExtension handleComplexContentExtension(
    XmlSchema schema, Element extEl, Element schemaEl) {
  XmlSchemaComplexContentExtension ext = new XmlSchemaComplexContentExtension();
  if (extEl.hasAttribute("base")) {
    String name = extEl.getAttribute("base");
    ext.baseTypeName = getRefQName(name, extEl);
  }
  for (Element el = XDOMUtil.getFirstChildElementNS(extEl,
      XmlSchema.SCHEMA_NS); el != null; el = XDOMUtil
      .getNextSiblingElementNS(el, XmlSchema.SCHEMA_NS)) {
    if (el.getLocalName().equals("sequence")) {
      ext.particle = handleSequence(schema, el, schemaEl);
    } else if (el.getLocalName().equals("choice")) {
      ext.particle = handleChoice(schema, el, schemaEl);
    } else if (el.getLocalName().equals("all")) {
      ext.particle = handleAll(schema, el, schemaEl);
    } else if (el.getLocalName().equals("attribute")) {
      ext.attributes.add(handleAttribute(schema, el, schemaEl));
    } else if (el.getLocalName().equals("attributeGroup")) {
      ext.attributes.add(handleAttributeGroupRef(el));
    } else if (el.getLocalName().equals("group")) {
      ext.particle = handleGroupRef(schema, el, schemaEl);
    } else if (el.getLocalName().equals("anyAttribute")) {
      ext.anyAttribute = handleAnyAttribute(schema, el, schemaEl);
    } else if (el.getLocalName().equals("annotation")) {
      ext.setAnnotation(handleAnnotation(el));
    }
  }
  return ext;
}
origin: org.apache.ws/com.springsource.org.apache.ws.commons.schema

  XmlSchemaAttribute attr =
      handleAttribute(schema, el, schemaEl);
  ext.attributes.add(attr);
} else if (el.getLocalName().equals("attributeGroup")) {
  XmlSchemaAttributeGroupRef attrGroup =
      handleAttributeGroupRef(el);
  ext.attributes.add(attrGroup);
} else if (el.getLocalName().equals("anyAttribute")) {
  ext.anyAttribute =
origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core

/**
 * Resolves schema imports by adding an schema import section to the host schema.
 * @param hostSchema The host schema
 * @param refNamespace The external schema reference
 */
private static void resolveSchemaImports(XmlSchema hostSchema, String refNamespace) {
  if (!hostSchema.getTargetNamespace().equals(refNamespace)) {
    XmlSchemaImport schemaImport = new XmlSchemaImport();
    schemaImport.setNamespace(refNamespace);
    if (!containsSchemaImport(hostSchema, schemaImport)) {
      hostSchema.getItems().add(schemaImport);
    }
  }
}
 
origin: org.apache.ws/com.springsource.org.apache.ws.commons.schema

private XmlSchemaAll handleAll(XmlSchema schema, Element allEl,
                Element schemaEl) {
  XmlSchemaAll all = new XmlSchemaAll();
   //handle min and max occurences
  all.minOccurs = getMinOccurs(allEl);
  all.maxOccurs = getMaxOccurs(allEl);
  for (Element el = XDOMUtil.getFirstChildElementNS(allEl, XmlSchema.SCHEMA_NS);
     el != null; el = XDOMUtil.getNextSiblingElementNS(el, XmlSchema.SCHEMA_NS)) {
    if (el.getLocalName().equals("element")) {
      XmlSchemaElement element = handleElement(schema, el, schemaEl, false);
      all.items.add(element);
    } else if (el.getLocalName().equals("annotation")) {
      XmlSchemaAnnotation annotation = handleAnnotation(el);
      all.setAnnotation(annotation);
    }
  }
  return all;
}
origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core

/**
 * Creates XML schema complex type with the given namespace and the name.
 * @param cparams The common parameters used in the schema generator
 * @param namespace The namespace of the complex type
 * @param name The name of the complex type
 * @param global Signal if the newly created type is global or not
 * @return The newly create XML schema complex type
 */
private static XmlSchemaComplexType createComplexType(CommonParams cparams, String namespace,
    String name, boolean global) {		
  XmlSchema schema = retrieveSchema(cparams, namespace);
  XmlSchemaComplexType type = new XmlSchemaComplexType(schema);
  Map<QName, XmlSchemaComplexType> typeMap = cparams.getTypeMap();
  if (global) {
    QName qname = new QName(namespace, name);
    if (typeMap.containsKey(qname)) {
      int suffix = 1; // start with 2, if T is there, the next one would be T2
      while (typeMap.containsKey(new QName(namespace, name + (++suffix))));
      name = name + suffix;
      qname = new QName(namespace, name);
    }        
    type.setName(name);
    cparams.getTypeMap().put(qname, type);
    schema.getItems().add(type);
    schema.getSchemaTypes().add(qname, type);
  }
  return type;
}
 
origin: org.apache.ws.schema/XmlSchema

private XmlSchemaAll handleAll(XmlSchema schema, Element allEl,
    Element schemaEl) {
  XmlSchemaAll all = new XmlSchemaAll();
  //handle min and max occurences
  all.minOccurs = getMinOccurs(allEl);
  all.maxOccurs = getMaxOccurs(allEl);
  for (Element el = XDOMUtil.getFirstChildElementNS(allEl,
      XmlSchema.SCHEMA_NS); el != null; el = XDOMUtil
      .getNextSiblingElementNS(el, XmlSchema.SCHEMA_NS)) {
    if (el.getLocalName().equals("element")) {
      XmlSchemaElement element = handleElement(schema, el, schemaEl,
          false);
      all.items.add(element);
    } else if (el.getLocalName().equals("annotation")) {
      XmlSchemaAnnotation annotation = handleAnnotation(el);
      all.setAnnotation(annotation);
    }
  }
  return all;
}
origin: org.apache.ws.commons.schema/XmlSchema

private XmlSchemaAll handleAll(XmlSchema schema, Element allEl,
    Element schemaEl) {
  XmlSchemaAll all = new XmlSchemaAll();
  //handle min and max occurences
  all.minOccurs = getMinOccurs(allEl);
  all.maxOccurs = getMaxOccurs(allEl);
  for (Element el = XDOMUtil.getFirstChildElementNS(allEl,
      XmlSchema.SCHEMA_NS); el != null; el = XDOMUtil
      .getNextSiblingElementNS(el, XmlSchema.SCHEMA_NS)) {
    if (el.getLocalName().equals("element")) {
      XmlSchemaElement element = handleElement(schema, el, schemaEl,
          false);
      all.items.add(element);
    } else if (el.getLocalName().equals("annotation")) {
      XmlSchemaAnnotation annotation = handleAnnotation(el);
      all.setAnnotation(annotation);
    }
  }
  return all;
}
origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core

private static XmlSchemaObjectCollection getSchemaObjectsFromComplexType(XmlSchemaComplexType schemaComplexType) {
  XmlSchemaObjectCollection collection = new XmlSchemaObjectCollection();
  XmlSchemaSequence sequence = (XmlSchemaSequence) schemaComplexType.getParticle();
  if (sequence != null) {
    XmlSchemaObjectCollection seqItems = sequence.getItems();
    int c = seqItems.getCount();
    for (int i = 0; i < c; i++) {
      // add elements
      collection.add(seqItems.getItem(i));
    }
  }
  XmlSchemaObjectCollection attrItems = schemaComplexType.getAttributes();
  int c = attrItems.getCount();
  for (int i = 0; i < c; i++) {
    // add attributes
    collection.add(attrItems.getItem(i));
  }
  return collection;
}
 
origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core

/**
 * Adds the given parameter to the complex type.
 * @param complexType The complex type which the attribute will be added to
 * @param name The name of the attribute
 * @param xsdType The type of the attribute
 */
@SuppressWarnings("unchecked")
private static void addAttributeToComplexType(XmlSchemaComplexType complexType, String name,
    QName xsdType) {
  XmlSchemaAttribute attr = new XmlSchemaAttribute();
  attr.setName(name);
  attr.setSchemaTypeName(xsdType);
  attr.setUse(new XmlSchemaUse("optional"));
  XmlSchemaAttribute tmpAttr;
  for (Iterator<XmlSchemaAttribute> itr = complexType.getAttributes().getIterator(); 
       itr.hasNext();) {
    tmpAttr = itr.next();
    if (tmpAttr.getName().equals(attr.getName())) {
      /* current attribute is already set, nothing more to do */
      return;
    }
  }
  complexType.getAttributes().add(attr);
}
 
origin: org.apache.ws.commons.schema/XmlSchema

content.add(appInfoObj);
content.add(docsObj);
origin: org.springframework.ws/org.springframework.xml

private void inlineIncludes(XmlSchema schema, Set<XmlSchema> processedIncludes, Set<XmlSchema> processedImports) {
  processedIncludes.add(schema);
  XmlSchemaObjectCollection schemaItems = schema.getItems();
  for (int i = 0; i < schemaItems.getCount(); i++) {
    XmlSchemaObject schemaObject = schemaItems.getItem(i);
    if (schemaObject instanceof XmlSchemaInclude) {
      XmlSchema includedSchema = ((XmlSchemaInclude) schemaObject).getSchema();
      if (!processedIncludes.contains(includedSchema)) {
        inlineIncludes(includedSchema, processedIncludes, processedImports);
        findImports(includedSchema, processedImports, processedIncludes);
        XmlSchemaObjectCollection includeItems = includedSchema.getItems();
        for (int j = 0; j < includeItems.getCount(); j++) {
          XmlSchemaObject includedItem = includeItems.getItem(j);
          schemaItems.add(includedItem);
        }
      }
      // remove the <include/>
      schemaItems.removeAt(i);
      i--;
    }
  }
}
origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core

/**
 * Creates the default data services response element, and stores it in the schema.
 * @param cparams The common parameters used in the schema generator
 */
private static void createAndStoreDataServiceResponseElement(CommonParams cparams) {
  XmlSchemaElement element = createElement(cparams, DBConstants.WSO2_DS_NAMESPACE,
      DBConstants.DATA_SERVICE_RESPONSE_WRAPPER_ELEMENT, true);
  XmlSchemaComplexType type = createComplexType(cparams, DBConstants.WSO2_DS_NAMESPACE, 
      DBConstants.DATA_SERVICE_RESPONSE_WRAPPER_ELEMENT, false);
  element.setType(type);
  XmlSchemaAny anyEl = new XmlSchemaAny();
  anyEl.setMinOccurs(0);
  XmlSchemaSequence seq = new XmlSchemaSequence();
  seq.getItems().add(anyEl);
  type.setParticle(seq);
}
   
origin: com.legsem.legstar/legstar-xsd2cob

/**
 * Create a nex XML schema element.
 * <p/>
 * We use the source URI to mark these injected elements.
 * 
 * @param typeQName the element type
 * @param elementQName the element name
 * @param schema the XML schema
 */
public static void addXmlSchemaElement(final QName typeQName,
    final QName elementQName, final XmlSchema schema) {
  XmlSchemaElement el = new XmlSchemaElement();
  el.setQName(elementQName);
  el.setName(elementQName.getLocalPart());
  el.setSchemaTypeName(typeQName);
  el.setSchemaType(schema.getTypeByName(typeQName));
  el.setSourceURI(XsdConstants.INJECTED_ELEMENT);
  schema.getElements().add(elementQName, el);
  schema.getItems().add(el);
}
org.apache.ws.commons.schemaXmlSchemaObjectCollectionadd

Popular methods of XmlSchemaObjectCollection

  • getIterator
  • getCount
  • getItem
  • <init>
    Creates new XmlSchemaObjectCollection
  • removeAt
  • toString

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • addToBackStack (FragmentTransaction)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • JPanel (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now