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

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

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

  • Common ways to obtain XmlSchemaChoice
private void myMethod () {
XmlSchemaChoice x =
  • Codota Iconnew XmlSchemaChoice()
  • Smart code suggestions by Codota
}
origin: org.apache.cxf/cxf-core

private void addCrossImports(XmlSchema schema, XmlSchemaChoice choice) {
  for (XmlSchemaObjectBase seqMember : choice.getItems()) {
    if (seqMember instanceof XmlSchemaElement) {
      addElementCrossImportsElement(schema, (XmlSchemaElement)seqMember);
    }
  }
}
private void addCrossImports(XmlSchema schema, XmlSchemaSequence sequence) {
origin: raml-org/raml-java-parser

  @Nonnull
  private XmlSchemaType createAny()
  {
    final XmlSchemaComplexType value = new XmlSchemaComplexType(schema, false);
    final XmlSchemaChoice xmlSchemaSequence = new XmlSchemaChoice();
    value.setParticle(xmlSchemaSequence);
    final List<XmlSchemaChoiceMember> items = xmlSchemaSequence.getItems();
    final XmlSchemaAny schemaAny = new XmlSchemaAny();
    schemaAny.setMinOccurs(0);
    schemaAny.setMaxOccurs(UNBOUNDED);
    schemaAny.setProcessContent(XmlSchemaContentProcessing.SKIP);
    items.add(schemaAny);
    return value;
  }
}
origin: com.legsem.legstar/legstar-base-generator

/**
 * A choice is given a name built using its first alternative name (choices
 * do not have names in the XSD).
 * 
 * @param xsdChoice the XSD choice
 * @return a field name to use for this choice in its parent complex type
 */
private static String getFieldName(XmlSchemaChoice xsdChoice) {
  for (XmlSchemaChoiceMember alternative : xsdChoice.getItems()) {
    if (alternative instanceof XmlSchemaElement) {
      return getFieldName((XmlSchemaElement) alternative)
          + CHOICE_FIELD_NAME_SUFFIX;
    }
  }
  throw new Xsd2ConverterException(
      "Choice without any alternative at line "
          + xsdChoice.getLineNumber());
}
origin: org.apache.axis2/axis2-adb-codegen

} else if (particle instanceof XmlSchemaChoice) {
  XmlSchemaChoice xmlSchemaChoice = (XmlSchemaChoice) particle;
  List<XmlSchemaChoiceMember> items = ((XmlSchemaChoice) particle).getItems();
  if ((xmlSchemaChoice.getMaxOccurs() > 1)) {
    metainfHolder.registerQNameIndex(choiceQName, metainfHolder.getOrderStartPoint() + 1);
    metainfHolder.addtStatus(choiceQName, SchemaConstants.PARTICLE_TYPE_ELEMENT);
    metainfHolder.addMaxOccurs(choiceQName, xmlSchemaChoice.getMaxOccurs());
    metainfHolder.addMinOccurs(choiceQName, xmlSchemaChoice.getMinOccurs());
origin: org.apache.axis2/axis2-adb-codegen

if (xmlSchemaChoice.getItems().size() > 0) {
  BeanWriterMetaInfoHolder beanWriterMetaInfoHolder = new BeanWriterMetaInfoHolder();
  beanWriterMetaInfoHolder.setChoice(true);
  processChoiceItems(parentElementQName, xmlSchemaChoice.getItems(),
            beanWriterMetaInfoHolder, false, parentSchema);
  beanWriterMetaInfoHolder.setParticleClass(true);
  Boolean isArray = xmlSchemaChoice.getMaxOccurs() > 1 ? Boolean.TRUE : Boolean.FALSE;
  processedElementArrayStatusMap.put(item, isArray);
  particleQNameMap.put(item, choiceQName);
origin: org.apache.ws.commons.schema/XmlSchema

private XmlSchemaChoice handleChoice(XmlSchema schema, Element choiceEl,
    Element schemaEl) {
  XmlSchemaChoice choice = new XmlSchemaChoice();
    } else if (el.getLocalName().equals("annotation")) {
      XmlSchemaAnnotation annotation = handleAnnotation(el);
      choice.setAnnotation(annotation);
origin: apache/cxf

Scope fullyQualifiedName = visitor.getFullyQualifiedName();
XmlSchemaChoice choice = new XmlSchemaChoice();
choice.setMinOccurs(1);
choice.setMaxOccurs(1);
unionSchemaComplexType.setParticle(choice);
origin: apache/cxf

private CorbaType processChoice(XmlSchemaChoice choice,
                  QName defaultName,
                  QName schemaTypeName)
  throws Exception {
  QName choicename = null;
  if (schemaTypeName == null) {
    choicename = createQNameCorbaNamespace(defaultName.getLocalPart());
  } else {
    choicename = createQNameCorbaNamespace(schemaTypeName.getLocalPart());
  }
  choicename = checkPrefix(choicename);
  CorbaType corbatype = createUnion(choicename, choice, defaultName, schemaTypeName);
  String repoId = REPO_STRING + corbatype.getQName().getLocalPart().replace('.', '/')
    + IDL_VERSION;
  ((Union)corbatype).setRepositoryID(repoId);
  if (!(choice.getMaxOccurs() == 1) || !(choice.getMinOccurs() == 1)) {
    QName name = createQNameTargetNamespace(corbatype.getQName().getLocalPart() + "Array");
    CorbaType arrayType =
      createArray(name, corbatype.getQName(), corbatype.getQName(),
            choice.getMaxOccurs(), choice.getMinOccurs(), false);
    if (arrayType != null
      && !isDuplicate(arrayType)) {
      typeMappingType.getStructOrExceptionOrUnion().add(arrayType);
    }
  }
  return corbatype;
}
origin: apache/axis2-java

} else if (particle instanceof XmlSchemaChoice) {
  XmlSchemaChoice xmlSchemaChoice = (XmlSchemaChoice) particle;
  List<XmlSchemaChoiceMember> items = ((XmlSchemaChoice) particle).getItems();
  if ((xmlSchemaChoice.getMaxOccurs() > 1)) {
    metainfHolder.registerQNameIndex(choiceQName, metainfHolder.getOrderStartPoint() + 1);
    metainfHolder.addtStatus(choiceQName, SchemaConstants.PARTICLE_TYPE_ELEMENT);
    metainfHolder.addMaxOccurs(choiceQName, xmlSchemaChoice.getMaxOccurs());
    metainfHolder.addMinOccurs(choiceQName, xmlSchemaChoice.getMinOccurs());
origin: apache/axis2-java

if (xmlSchemaChoice.getItems().size() > 0) {
  BeanWriterMetaInfoHolder beanWriterMetaInfoHolder = new BeanWriterMetaInfoHolder();
  beanWriterMetaInfoHolder.setChoice(true);
  processChoiceItems(parentElementQName, xmlSchemaChoice.getItems(),
            beanWriterMetaInfoHolder, false, parentSchema);
  beanWriterMetaInfoHolder.setParticleClass(true);
  Boolean isArray = xmlSchemaChoice.getMaxOccurs() > 1 ? Boolean.TRUE : Boolean.FALSE;
  processedElementArrayStatusMap.put(item, isArray);
  particleQNameMap.put(item, choiceQName);
origin: org.apache.ws.schema/XmlSchema

private XmlSchemaChoice handleChoice(XmlSchema schema, Element choiceEl,
    Element schemaEl) {
  XmlSchemaChoice choice = new XmlSchemaChoice();
    } else if (el.getLocalName().equals("annotation")) {
      XmlSchemaAnnotation annotation = handleAnnotation(el);
      choice.setAnnotation(annotation);
origin: org.apache.axis2/axis2-adb-codegen

XmlSchemaChoice xmlSchemaChoice = (XmlSchemaChoice) child;
QName choiceQName = particleQNameMap.get(child);
boolean isArray = xmlSchemaChoice.getMaxOccurs() > 1;
metainfHolder.addMaxOccurs(choiceQName, xmlSchemaChoice.getMaxOccurs());
metainfHolder.addMinOccurs(choiceQName, xmlSchemaChoice.getMinOccurs());
metainfHolder.setHasParticleType(true);
origin: apache/cxf

private void addCrossImports(XmlSchema schema, XmlSchemaChoice choice) {
  for (XmlSchemaObjectBase seqMember : choice.getItems()) {
    if (seqMember instanceof XmlSchemaElement) {
      addElementCrossImportsElement(schema, (XmlSchemaElement)seqMember);
    }
  }
}
private void addCrossImports(XmlSchema schema, XmlSchemaSequence sequence) {
origin: org.raml/raml-parser-2

  @Nonnull
  private XmlSchemaType createAny()
  {
    final XmlSchemaComplexType value = new XmlSchemaComplexType(schema, false);
    final XmlSchemaChoice xmlSchemaSequence = new XmlSchemaChoice();
    value.setParticle(xmlSchemaSequence);
    final List<XmlSchemaChoiceMember> items = xmlSchemaSequence.getItems();
    final XmlSchemaAny schemaAny = new XmlSchemaAny();
    schemaAny.setMinOccurs(0);
    schemaAny.setMaxOccurs(UNBOUNDED);
    schemaAny.setProcessContent(XmlSchemaContentProcessing.SKIP);
    items.add(schemaAny);
    return value;
  }
}
origin: org.apache.ws/com.springsource.org.apache.ws.commons.schema

private XmlSchemaChoice handleChoice(XmlSchema schema, Element choiceEl,
                   Element schemaEl) {
  XmlSchemaChoice choice = new XmlSchemaChoice();
    } else if (el.getLocalName().equals("annotation")) {
      XmlSchemaAnnotation annotation = handleAnnotation(el);
      choice.setAnnotation(annotation);
origin: apache/axis2-java

XmlSchemaChoice xmlSchemaChoice = (XmlSchemaChoice) child;
QName choiceQName = particleQNameMap.get(child);
boolean isArray = xmlSchemaChoice.getMaxOccurs() > 1;
metainfHolder.addMaxOccurs(choiceQName, xmlSchemaChoice.getMaxOccurs());
metainfHolder.addMinOccurs(choiceQName, xmlSchemaChoice.getMinOccurs());
metainfHolder.setHasParticleType(true);
origin: org.apache.cxf/cxf-bundle-jaxrs

private void addCrossImports(XmlSchema schema, XmlSchemaChoice choice) {
  for (XmlSchemaObjectBase seqMember : choice.getItems()) {
    if (seqMember instanceof XmlSchemaElement) {
      addElementCrossImportsElement(schema, (XmlSchemaElement)seqMember);
    }
  }
}
private void addCrossImports(XmlSchema schema, XmlSchemaSequence sequence) {
origin: org.apache.cxf/cxf-api

private void addCrossImports(XmlSchema schema, XmlSchemaChoice choice) {
  for (XmlSchemaObjectBase seqMember : choice.getItems()) {
    if (seqMember instanceof XmlSchemaElement) {
      addElementCrossImportsElement(schema, (XmlSchemaElement)seqMember);
    }
  }
}
private void addCrossImports(XmlSchema schema, XmlSchemaSequence sequence) {
origin: org.apache.cxf/cxf-common-utilities

private void addCrossImports(XmlSchema schema, XmlSchemaChoice choice) {
  for (XmlSchemaObject seqMember : choice.getItems()) {
    if (seqMember instanceof XmlSchemaElement) {
      addElementCrossImportsElement(schema, (XmlSchemaElement)seqMember);
    }
  }
}
private void addCrossImports(XmlSchema schema, XmlSchemaSequence sequence) {
origin: com.legsem.legstar/legstar-base-generator

/**
 * Visit each alternative of a choice in turn.
 * <p/>
 * Note that this produces a new complex type.
 * 
 * @param xsdChoice the XML schema choice
 * @param compositeTypes the lists of composite types being populated
 * @param choiceTypeName the name to use for this choice type
 */
private void visit(XmlSchemaChoice xsdChoice,
    RootCompositeType compositeTypes, String choiceTypeName) {
  Map < String, Object > alternatives = new LinkedHashMap < String, Object >();
  int fieldIndex = 0;
  for (XmlSchemaChoiceMember alternative : xsdChoice.getItems()) {
    if (alternative instanceof XmlSchemaElement) {
      addField(fieldIndex, alternative, alternatives, compositeTypes);
      fieldIndex++;
    }
  }
  compositeTypes.choiceTypes.put(choiceTypeName, alternatives);
}
org.apache.ws.commons.schemaXmlSchemaChoice

Javadoc

Allows only one of its children to appear in an instance. Represents the World Wide Web Consortium (W3C) choice (compositor) element.

Most used methods

  • getItems
  • <init>
    Creates new XmlSchemaChoice
  • setAnnotation
  • getMaxOccurs
  • getMinOccurs
  • getLineNumber
  • setMaxOccurs
  • setMinOccurs

Popular in Java

  • Finding current android device location
  • getSystemService (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Reference (javax.naming)
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