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

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

Best Java code snippets using org.apache.ws.commons.schema.XmlSchemaObjectCollection (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

  public String toString(String prefix, int tab) {
    String xml = new String();

    for (int i = 0; i < getCount(); i++) {
      xml += getItem(i).toString(prefix, tab);
    }


    return xml;

  }
}
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.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.apache.openejb/openejb-axis

  private static List<XmlSchemaElement> getNestedElements(final XmlSchemaComplexType complexType) {
    final List<XmlSchemaElement> elements = new ArrayList<XmlSchemaElement>();
    final XmlSchemaParticle particle = complexType.getParticle();
    if (particle instanceof XmlSchemaElement) {
      final XmlSchemaElement element = (XmlSchemaElement) particle;
      elements.add(element);
    } else if (particle instanceof XmlSchemaGroupBase && !(particle instanceof XmlSchemaChoice)) {
      final XmlSchemaGroupBase groupBase = (XmlSchemaGroupBase) particle;
      for (final Iterator iterator = groupBase.getItems().getIterator(); iterator.hasNext(); ) {
        final XmlSchemaParticle child = (XmlSchemaParticle) iterator.next();
        if (child instanceof XmlSchemaElement) {
          final XmlSchemaElement element = (XmlSchemaElement) child;
          elements.add(element);
        }
      }
    } else {
      // ignore all other types... you can have these other types, but JAX-RPC doesn't support them
    }
    return elements;
  }
}
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.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.tuscany.sca/tuscany-binding-ws-wsdlgen

public void fixUpMovedTypeReferences(String fromNamespace, String toNamespace, XmlSchemaObject fixUpObj, List<XmlSchema> relatedSchema){
  
  if (!(fixUpObj instanceof XmlSchemaComplexType)){
    return;
  }
  
  for (XmlSchema schema : relatedSchema){
    int importRemoveIndex = -1;
    for (int i = 0; i < schema.getItems().getCount(); i++){
      XmlSchemaObject obj = schema.getItems().getItem(i);
      
      processXMLSchemaObject(toNamespace, obj, fixUpObj);
      
      // remove FROM imports
      if (obj instanceof XmlSchemaImport &&
        ((XmlSchemaImport)obj).getNamespace().equals(fromNamespace)){
        importRemoveIndex = i;
      }
    }
    if (importRemoveIndex >= 0){
      schema.getItems().removeAt(importRemoveIndex);
    }
  }
}

origin: org.apache.ws/com.springsource.org.apache.ws.commons.schema

/**
 * Creates new XmlSchemaAnnotation
 */
public XmlSchemaAnnotation() {
  items = new XmlSchemaObjectCollection();
}
origin: org.apache.ws.commons.schema/XmlSchema

XmlSchemaObjectCollection content = new XmlSchemaObjectCollection();
XmlSchemaAppInfo appInfoObj;
XmlSchemaDocumentation docsObj;
    content.add(appInfoObj);
    content.add(docsObj);
origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core

private static XmlSchemaComplexType getRowNameBasedSchemaComplexType(
    XmlSchemaComplexType wrapperSchemaComplexType) {
  return (((XmlSchemaComplexType) ((XmlSchemaElement) ((XmlSchemaSequence) wrapperSchemaComplexType
      .getParticle()).getItems().getItem(0)).getSchemaType()));
}
 
origin: org.codehaus.xfire/xfire-core

protected static boolean hasAttributes(XmlSchemaComplexType complexType)
{
  // Now lets see if we have any attributes...
  // This should probably look at the restricted and substitute types too.
  
  if (complexType.getAnyAttribute() != null ||
      complexType.getAttributes().getCount() > 0)
    return true;
  else
    return false;
}
 
origin: org.apache.tuscany.sca/tuscany-binding-ws-runtime-axis2

private static void updateSchemaRefs(XmlSchema parentSchema, String name) {
  for (Iterator iter = parentSchema.getIncludes().getIterator(); iter.hasNext();) {
    Object obj = iter.next();
    if (obj instanceof XmlSchemaExternal) {
      XmlSchemaExternal extSchema = (XmlSchemaExternal)obj;
      String location = extSchema.getSchemaLocation();
      if (location.length() > 0 && location.indexOf(":/") < 0 && location.indexOf("?xsd=") < 0) {
        extSchema.setSchemaLocation(name + "?xsd=" + location);
      }
      if (extSchema.getSchema() != null) {
        updateSchemaRefs(extSchema.getSchema(), name);
      }
    }
  }
}    

origin: org.apache.tuscany.sca/tuscany-base-runtime

List<XmlSchemaObject> movedItems = new ArrayList<XmlSchemaObject>();
Iterator<XmlSchemaObject> iter = fromItems.getIterator();
while(iter.hasNext()){
    toItems.add(obj);
    movedItems.add(obj);
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.tuscany.sca/tuscany-base-runtime

public void fixUpMovedTypeReferences(String fromNamespace, String toNamespace, XmlSchemaObject fixUpObj, List<XmlSchema> relatedSchema){
  
  if (!(fixUpObj instanceof XmlSchemaComplexType)){
    return;
  }
  
  for (XmlSchema schema : relatedSchema){
    int importRemoveIndex = -1;
    for (int i = 0; i < schema.getItems().getCount(); i++){
      XmlSchemaObject obj = schema.getItems().getItem(i);
      
      processXMLSchemaObject(toNamespace, obj, fixUpObj);
      
      // remove FROM imports
      if (obj instanceof XmlSchemaImport &&
        ((XmlSchemaImport)obj).getNamespace().equals(fromNamespace)){
        importRemoveIndex = i;
      }
    }
    if (importRemoveIndex >= 0){
      schema.getItems().removeAt(importRemoveIndex);
    }
  }
}

origin: org.apache.ws/com.springsource.org.apache.ws.commons.schema

/**
 * Creates new XmlSchemaComplexContentExtension
 */
public XmlSchemaComplexContentExtension() {
  attributes = new XmlSchemaObjectCollection();
}
origin: org.apache.ws.schema/XmlSchema

XmlSchemaObjectCollection content = new XmlSchemaObjectCollection();
XmlSchemaAppInfo appInfoObj;
XmlSchemaDocumentation docsObj;
    content.add(appInfoObj);
    content.add(docsObj);
origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core

private static String getResultRowName(XmlSchemaComplexType wrapperSchemaComplexType) {
  return ((XmlSchemaElement) ((XmlSchemaSequence) wrapperSchemaComplexType
      .getParticle()).getItems().getItem(0)).getName();
}
 
origin: org.apache.ws/com.springsource.org.apache.ws.commons.schema

  public String toString(String prefix, int tab) {
    String xml = new String();

    for (int i = 0; i < getCount(); i++) {
      xml += getItem(i).toString(prefix, tab);
    }


    return xml;

  }
}
origin: org.apache.ws.commons.schema/XmlSchema

if (attribute == null) {
    for (Iterator includedItems = includes.getIterator(); includedItems
            .hasNext();) {
org.apache.ws.commons.schemaXmlSchemaObjectCollection

Javadoc

An object collection class to handle XmlSchemaObjects when collections are returned from method calls.

Most used methods

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

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • getContentResolver (Context)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
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