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

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

Best Java code snippets using org.apache.ws.commons.schema.XmlSchemaComplexType (Showing top 20 results out of 378)

Refine searchRefine arrow

  • XmlSchemaSequence
  • XmlSchemaElement
  • QName
  • XmlSchemaContentModel
  • XmlSchemaComplexContentExtension
  • SchemaCollection
  • Common ways to obtain XmlSchemaComplexType
private void myMethod () {
XmlSchemaComplexType x =
  • Codota IconXmlSchema xmlSchema;new XmlSchemaComplexType(xmlSchema, false)
  • Codota IconXmlSchemaElement element;(XmlSchemaComplexType) element.getSchemaType()
  • Codota IconXmlSchema schema;new XmlSchemaComplexType(schema)
  • Smart code suggestions by Codota
}
origin: apache/cxf

public static boolean isOMGUnion(XmlSchemaComplexType type) {
  boolean isUnion = false;
  if (type.getParticle() instanceof XmlSchemaSequence
    && type.getAttributes().isEmpty()) {
    XmlSchemaSequence stype = (XmlSchemaSequence)type.getParticle();
    if (stype.getItems().size() == 2) {
      XmlSchemaParticle st1 = (XmlSchemaParticle)stype.getItems().get(0);
      XmlSchemaParticle st2 = (XmlSchemaParticle)stype.getItems().get(1);
      XmlSchemaElement discEl = null;
      if (st1 instanceof XmlSchemaChoice && st2 instanceof XmlSchemaElement) {
        isUnion = true;
        discEl = (XmlSchemaElement)st2;
      } else if (st2 instanceof XmlSchemaChoice && st1 instanceof XmlSchemaElement) {
        isUnion = true;
        discEl = (XmlSchemaElement)st1;
      }
      if (isUnion && !"discriminator".equals(discEl.getQName().getLocalPart())) {
        isUnion = false;
      }
    }
  }
  return isUnion;
}
origin: org.apache.openejb/openejb-axis

private static boolean isSoapArray(final XmlSchemaComplexType complexType) {
  // Soap arrays are based on complex content restriction
  final XmlSchemaContentModel contentModel = complexType.getContentModel();
  if (contentModel == null) {
    return false;
  }
  final XmlSchemaContent content = contentModel.getContent();
  if (!(content instanceof XmlSchemaComplexContentRestriction)) {
    return false;
  }
  final XmlSchemaComplexContentRestriction restriction = (XmlSchemaComplexContentRestriction) content;
  return SOAP_ARRAY.equals(restriction.getBaseTypeName());
}
origin: apache/cxf

private XmlSchemaElement generateWrapper(QName el, XmlSchemaSequence wrappingSequence) {
  XmlSchemaComplexType schemaComplexType = new XmlSchemaComplexType(schema, false);
  schemaComplexType.setParticle(wrappingSequence);
  XmlSchemaElement wrappingSchemaElement = new XmlSchemaElement(schema, true);
  wrappingSchemaElement.setName(el.getLocalPart());
  wrappingSchemaElement.setSchemaType(schemaComplexType);
  return wrappingSchemaElement;
}
origin: apache/cxf

private boolean hasAttributes(XmlSchemaComplexType complexType) {
  // Now lets see if we have any attributes...
  // This should probably look at the restricted and substitute types too.
  return complexType.getAnyAttribute() != null || complexType.getAttributes().size() > 0;
}
origin: apache/cxf

public static boolean isUnion(XmlSchemaComplexType type) {
  boolean isUnion = false;
  if (type.getParticle() instanceof XmlSchemaChoice && type.getAttributes().isEmpty()) {
    isUnion = true;
  }
  return isUnion;
}
origin: apache/cxf

private XmlSchemaSequence getTypeSequence(XmlSchemaComplexType type,
                     QName parentName) {
  if (!(type.getParticle() instanceof XmlSchemaSequence)) {
    unsupportedConstruct("NON_SEQUENCE_PARTICLE",
               type.getQName() != null ? type.getQName()
                 :
                 parentName);
  }
  return (XmlSchemaSequence)type.getParticle();
}
origin: org.apache.axis2/axis2-kernel

                     boolean isArrayType,
                     String propertyName) {
XmlSchemaElement xmlSchemaElement = new XmlSchemaElement(xmlSchema, false);
xmlSchemaElement.setName( name + "Wrapper");
xmlSchemaElement.setNillable(true);
sequence.getItems().add(xmlSchemaElement);
    typeTable.getSimpleSchemaTypeName(propertyName).getLocalPart() + "Wrapper";
  xmlSchemaComplexType = new XmlSchemaComplexType(xmlSchema, false);
  XmlSchemaSequence xmlSchemaSequence = new XmlSchemaSequence();
  xmlSchemaComplexType.setParticle(xmlSchemaSequence);
  xmlSchemaComplexType.setName(complexTypeName);
      new QName(schemaTargetNameSpace, xmlSchemaComplexType.getName()),
      xmlSchemaComplexType);
  addElementToSequence("array",
xmlSchemaElement.setSchemaType(xmlSchemaComplexType);
xmlSchemaElement.setSchemaTypeName(new QName(schemaTargetNameSpace, xmlSchemaComplexType.getName()));
origin: apache/cxf

private XmlSchemaComplexType generateSchemaArray(Scope scopedName, Long size,
                         XmlSchemaType type, Scope fQName) {
  XmlSchemaComplexType complexType = new XmlSchemaComplexType(schema, true);
  complexType.setName(mapper.mapToQName(scopedName));
  XmlSchemaSequence sequence = new XmlSchemaSequence();
  XmlSchemaElement element = new XmlSchemaElement(schema, false);
  element.setMinOccurs(size);
  element.setMaxOccurs(size);
  element.setName(ELEMENT_NAME);
  if (type != null) {
    element.setSchemaTypeName(type.getQName());
    if (type.getQName().equals(ReferenceConstants.WSADDRESSING_TYPE)) {
      element.setNillable(true);
    }
  } else {
    ArrayDeferredAction arrayAction =
      new ArrayDeferredAction(element);
    wsdlVisitor.getDeferredActions().add(fQName, arrayAction);
  }
  sequence.getItems().add(element);
  complexType.setParticle(sequence);
  return complexType;
}
origin: apache/cxf

public static List<String> getOperationInputPartNames(OperationInfo operation) {
  List<String> names = new ArrayList<>();
  List<MessagePartInfo> parts = operation.getInput().getMessageParts();
  if (parts == null || parts.isEmpty()) {
    return names;
  }
  for (MessagePartInfo part : parts) {
    XmlSchemaAnnotated schema = part.getXmlSchema();
    if (schema instanceof XmlSchemaElement
      && ((XmlSchemaElement)schema).getSchemaType() instanceof XmlSchemaComplexType) {
      XmlSchemaElement element = (XmlSchemaElement)schema;
      XmlSchemaComplexType cplxType = (XmlSchemaComplexType)element.getSchemaType();
      XmlSchemaSequence seq = (XmlSchemaSequence)cplxType.getParticle();
      if (seq == null || seq.getItems() == null) {
        return names;
      }
      for (int i = 0; i < seq.getItems().size(); i++) {
        XmlSchemaElement elChild = (XmlSchemaElement)seq.getItems().get(i);
        names.add(elChild.getName());
      }
    } else {
      names.add(part.getConcreteName().getLocalPart());
    }
  }
  return names;
}
origin: org.apache.axis2/axis2-kernel

private XmlSchemaComplexType createSchemaTypeForFault(String localPartName) {
  XmlSchema xmlSchema = getXmlSchema(schemaTargetNameSpace);
  QName elementName =
      new QName(this.schemaTargetNameSpace, localPartName, this.schema_namespace_prefix);
  XmlSchemaComplexType complexType = getComplexTypeForElement(xmlSchema, elementName);
  if (complexType == null) {
    complexType = new XmlSchemaComplexType(xmlSchema, false);
    XmlSchemaElement globalElement = new XmlSchemaElement(xmlSchema, false);
    globalElement.setName(localPartName);
    boolean disallowAnonTypes = isAnonymousTypesDisallowed();
    if (disallowAnonTypes) {
      complexType.setName(localPartName);
      globalElement.setSchemaTypeName(complexType.getQName());
      xmlSchema.getItems().add(complexType);
      xmlSchema.getSchemaTypes().put(complexType.getQName(), complexType);
    } else {
      globalElement.setSchemaType(complexType);
    }
    xmlSchema.getItems().add(globalElement);
    xmlSchema.getElements().put(elementName, globalElement);
  }
  return complexType;
}
origin: org.apache.axis2/axis2-kernel

private void generateComplexTypeforException() {
  XmlSchemaSequence sequence = new XmlSchemaSequence();
  XmlSchema xmlSchema = getXmlSchema(schemaTargetNameSpace);
  QName elementName = new QName(schemaTargetNameSpace, "Exception", schema_namespace_prefix);
  XmlSchemaComplexType complexType = new XmlSchemaComplexType(xmlSchema, false);
  complexType.setName("Exception");
  xmlSchema.getItems().add(complexType);
  xmlSchema.getSchemaTypes().put(elementName, complexType);
  typeTable.addComplexSchema(Exception.class.getName(), elementName);
  QName schemaTypeName = new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "string");
  addContentToMethodSchemaType(sequence, schemaTypeName, "Message", false);
  complexType.setParticle(sequence);
}
origin: org.apache.axis2/axis2-kernel

/**
 * Generate schema construct for given type
 *
 * @param localPartName
 */
private XmlSchemaComplexType createSchemaTypeForMethodPart(String localPartName) {
  XmlSchema xmlSchema = getXmlSchema(schemaTargetNameSpace);
  QName elementName =
      new QName(this.schemaTargetNameSpace, localPartName, this.schema_namespace_prefix);
  XmlSchemaComplexType complexType = getComplexTypeForElement(xmlSchema, elementName);
  if (complexType == null) {
    complexType = new XmlSchemaComplexType(xmlSchema, false);
    XmlSchemaElement globalElement = new XmlSchemaElement(xmlSchema, false);
    globalElement.setSchemaType(complexType);
    globalElement.setName(localPartName);
    xmlSchema.getItems().add(globalElement);
    xmlSchema.getElements().put(elementName, globalElement);
  }
  typeTable.addComplexSchema(localPartName, elementName);
  return complexType;
}
origin: apache/cxf

@Override
public void writeSchema(XmlSchema root) {
  XmlSchemaComplexType complex = new XmlSchemaComplexType(root, true);
  complex.setName(getSchemaType().getLocalPart());
  XmlSchemaSequence sequence = new XmlSchemaSequence();
  complex.setParticle(sequence);
  AegisType kType = getKeyType();
  AegisType vType = getValueType();
  XmlSchemaElement element = new XmlSchemaElement(root, false);
  sequence.getItems().add(element);
  element.setName(getEntryName().getLocalPart());
  element.setMinOccurs(0);
  element.setMaxOccurs(Long.MAX_VALUE);
  XmlSchemaComplexType evType = new XmlSchemaComplexType(root, false);
  element.setType(evType);
  XmlSchemaSequence evSequence = new XmlSchemaSequence();
  evType.setParticle(evSequence);
  createElement(root, evSequence, getKeyName(), kType, false);
  createElement(root, evSequence, getValueName(), vType, true);
}
origin: org.apache.tuscany.sca/tuscany-base-runtime

  return null;
if (element.isNillable()) {
XmlSchemaType type = element.getSchemaType();
if (type == null) {
  String qName = element.getQName().toString();
  throw new InvalidWSDLException("The XML schema element does not have a type: " + qName);
if (complexType.getAttributes().getCount() != 0 || complexType.getAnyAttribute() != null) {
XmlSchemaParticle particle = complexType.getParticle();
if (particle == null) {
  return null;
XmlSchemaSequence sequence = (XmlSchemaSequence)complexType.getParticle();
XmlSchemaObjectCollection items = sequence.getItems();
List<XmlSchemaElement> childElements = new ArrayList<XmlSchemaElement>();
for (int i = 0; i < items.getCount(); i++) {
  if (ANY.equals(childElement.getQName())) {
origin: apache/cxf

private CorbaType processRegularUnion(XmlSchemaComplexType complex,
                     QName defaultName) throws Exception {
  //NEED TO DO
  QName name = null;
  QName schematypeName = complex.getQName();
  if (schematypeName == null) {
    schematypeName = defaultName;
    name = createQNameCorbaNamespace(defaultName.getLocalPart() + "Type");
  } else {
    name = createQNameCorbaNamespace(schematypeName.getLocalPart());
  }
  return createUnion(name, (XmlSchemaChoice)complex.getParticle(), defaultName, schematypeName);
}
origin: apache/axis2-java

private void processAttributes(XmlSchemaComplexType complexType,
                AxisMessage message,
                List partNameList,
                String qnameSuffix) {
  QName opName = message.getAxisOperation().getName();
  XmlSchemaAttribute xmlSchemaAttribute;
  for (XmlSchemaObject item : complexType.getAttributes()) {
    if (item instanceof XmlSchemaAttribute) {
      xmlSchemaAttribute = (XmlSchemaAttribute) item;
      String partName = xmlSchemaAttribute.getName();
      partNameList.add(
          WSDLUtil.getPartQName(opName.getLocalPart(),
              qnameSuffix,
              partName));
    }
  }
}
origin: apache/cxf

for (XmlSchema schemaInfo : xmlSchemaCollection.getXmlSchemas()) {
  for (Map.Entry<QName, XmlSchemaElement> e : schemaInfo.getElements().entrySet()) {
    QName name = e.getKey();
    if (JavascriptUtils.notVeryComplexType(element.getSchemaType())) {
      continue;
    XmlSchemaComplexType elementType = (XmlSchemaComplexType)element.getSchemaType();
    if (elementType != null && elementType.getQName() != null) {
      name = elementType.getQName();
    utils.appendLine("this.globalElementSerializers['" + name.toString() + "'] = "
             + nameManager.getJavascriptName(name)
             + "_serialize;");
    utils.appendLine("this.globalElementDeserializers['" + name.toString() + "'] = "
             + nameManager.getJavascriptName(name)
             + "_deserialize;");
    utils.appendLine("this.globalElementSerializers['" + name.toString() + "'] = "
             + nameManager.getJavascriptName(name)
             + "_serialize;");
origin: apache/cxf

private void addCrossImportsType(XmlSchema schema, XmlSchemaType schemaType) {
  // the base type might cross schemas.
  if (schemaType instanceof XmlSchemaComplexType) {
    XmlSchemaComplexType complexType = (XmlSchemaComplexType)schemaType;
    XmlSchemaUtils.addImportIfNeeded(schema, complexType.getBaseSchemaTypeName());
    addCrossImports(schema, complexType.getContentModel());
    addCrossImportsAttributeList(schema, complexType.getAttributes());
    // could it be a choice or something else?
    if (complexType.getParticle() instanceof XmlSchemaChoice) {
      XmlSchemaChoice choice = (XmlSchemaChoice)complexType.getParticle();
      addCrossImports(schema, choice);
    } else if (complexType.getParticle() instanceof XmlSchemaAll) {
      XmlSchemaAll all = (XmlSchemaAll)complexType.getParticle();
      addCrossImports(schema, all);
    } else if (complexType.getParticle() instanceof XmlSchemaSequence) {
      XmlSchemaSequence sequence = (XmlSchemaSequence)complexType.getParticle();
      addCrossImports(schema, sequence);
    }
  }
}
private void addCrossImports(XmlSchema schema, XmlSchemaAll all) {
origin: apache/cxf

private void buildGenericElements(XmlSchema schema, XmlSchemaSequence seq, Field f) {
  XmlSchemaComplexType generics = new XmlSchemaComplexType(schema, true);
  Type type = f.getGenericType();
  String rawType = ((ParameterizedType)type).getRawType().toString();
  String typeName = StringUtils.uncapitalize(rawType.substring(rawType.lastIndexOf(".") + 1));
  generics.setName(typeName);
  Class<?> genericsClass = f.getType();
  buildGenericSeq(schema, generics, genericsClass);
  String name = Character.toLowerCase(f.getName().charAt(0)) + f.getName().substring(1);
  XmlSchemaElement newel = new XmlSchemaElement(schema, false);
  newel.setName(name);
  newel.setSchemaTypeName(generics.getQName());
  newel.setMinOccurs(0);
  if (!seq.getItems().contains(newel)) {
    seq.getItems().add(newel);
  }
}
origin: apache/cxf

SchemaCollection schema = serviceInfo.getXmlSchemaCollection();
XmlSchemaElement elementByName = schema.getElementByQName(partElement);
XmlSchemaComplexType type = (XmlSchemaComplexType)elementByName.getSchemaType();
XmlSchemaSequence seq = (XmlSchemaSequence)type.getParticle();
if (seq == null && type.getContentModel() != null) {
  XmlSchemaContent xmlSchemaConent = type.getContentModel().getContent();
  if (xmlSchemaConent instanceof XmlSchemaComplexContentExtension) {
    XmlSchemaComplexContentExtension extension = (XmlSchemaComplexContentExtension)type
      .getContentModel().getContent();
    QName baseTypeName = extension.getBaseTypeName();
    XmlSchemaType schemaType = schema.getTypeByQName(baseTypeName);
    if (schemaType instanceof XmlSchemaComplexType) {
      XmlSchemaComplexType complexType = (XmlSchemaComplexType)schemaType;
      if (complexType.getParticle() instanceof XmlSchemaSequence) {
        seq = (XmlSchemaSequence)complexType.getParticle();
        qnames.addAll(createWrappedElements(seq));
    if (extension.getParticle() instanceof XmlSchemaSequence) {
      XmlSchemaSequence xmlSchemaSeq = (XmlSchemaSequence)extension.getParticle();
      qnames.addAll(createWrappedElements(xmlSchemaSeq));
org.apache.ws.commons.schemaXmlSchemaComplexType

Javadoc

Class for complex types. Defines a complex type that determines the set of attributes and content of an element. Represents the World Wide Web Consortium (W3C) complexType element.

Most used methods

  • getParticle
  • getAttributes
  • getContentModel
  • <init>
  • setName
  • getQName
  • setParticle
  • getAnyAttribute
  • getName
  • setAbstract
  • getBaseSchemaTypeName
    Return the QName of the base schema type, if any, as defined in the content model.
  • isAbstract
  • getBaseSchemaTypeName,
  • isAbstract,
  • setAnyAttribute,
  • setContentModel,
  • setAnnotation,
  • setBlock,
  • setFinal,
  • setMixed,
  • addMetaInfo,
  • getLineNumber

Popular in Java

  • Reactive rest calls using spring rest template
  • compareTo (BigDecimal)
  • getExternalFilesDir (Context)
  • putExtra (Intent)
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
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