org.apache.ws.commons.schema.XmlSchemaObjectTable类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(158)

本文整理了Java中org.apache.ws.commons.schema.XmlSchemaObjectTable类的一些代码示例,展示了XmlSchemaObjectTable类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlSchemaObjectTable类的具体详情如下:
包路径:org.apache.ws.commons.schema.XmlSchemaObjectTable
类名称:XmlSchemaObjectTable

XmlSchemaObjectTable介绍

[英]A collection class that provides read-only helpers for XmlSchemaObject objects. This class is used to provide the collections for contained elements that are within the schema as collections that are accessed from the XmlSchema class (for example, Attributes, AttributeGroups, Elements, and so on).
[中]为XmlSchemaObject对象提供只读帮助的集合类。此类用于为架构中包含的元素提供集合,作为从XmlSchema类访问的集合(例如,属性、属性组、元素等)。

代码示例

代码示例来源:origin: org.apache.ws/com.springsource.org.apache.ws.commons.schema

public XmlSchemaElement getElementByName(QName name) {
  return (XmlSchemaElement)elements.getItem(name);
}

代码示例来源:origin: org.apache.ws/com.springsource.org.apache.ws.commons.schema

public void addType(XmlSchemaType type) {
  QName qname = type.getQName();
  if (schemaTypes.contains(qname)) {
    throw new RuntimeException("Schema for namespace '" +
        syntacticalTargetNamespace + "' already contains type '" +
        qname.getLocalPart());
  }
  schemaTypes.add(qname, type);
}

代码示例来源:origin: com.legsem.legstar/legstar-xsd2cob

/**
 * Get name for item from another schema.
 * 
 * @param table the other schema table
 * @param xsdObject the object for which we seek a name
 * @return the name
 */
protected static QName getName(final XmlSchemaObjectTable table,
    final XmlSchemaObject xsdObject) {
  for (Iterator < ? > it = table.getNames(); it.hasNext();) {
    QName name = (QName) it.next();
    if (xsdObject == table.getItem(name)) {
      return name;
    }
  }
  return null;
}

代码示例来源: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/com.springsource.org.apache.ws.commons.schema

/**
 * Creates new XmlSchemaRedefine
 */
public XmlSchemaRedefine() {
  items = new XmlSchemaObjectCollection();
  schemaTypes = new XmlSchemaObjectTable();
  groups = new XmlSchemaObjectTable();
  attributeGroups = new XmlSchemaObjectTable();
}

代码示例来源:origin: stackoverflow.com

XmlSchemaObjectTable objTable = schema.getElements();
Iterator elementNames = objTable.getNames();

代码示例来源:origin: org.apache.openejb/openejb-axis

private void buildXmlTypeInfos() {
  for (final XmlSchema schema : xmlSchemaCollection.getXmlSchemas()) {
    // Global Elements
    for (final Iterator iterator = schema.getElements().getValues(); iterator.hasNext(); ) {
      final XmlSchemaElement globalElement = (XmlSchemaElement) iterator.next();
      addGlobalElement(globalElement);
    }
    // Global Types
    for (final Iterator iterator = schema.getSchemaTypes().getValues(); iterator.hasNext(); ) {
      final XmlSchemaType globalType = (XmlSchemaType) iterator.next();
      addType(globalType.getQName(), globalType);
    }
  }
}

代码示例来源:origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core

XmlSchema schema = retrieveSchema(cparams, namespace);
schema.getItems().add(element);
schema.getElements().add(qname, element);

代码示例来源:origin: org.apache.ws.commons.schema/XmlSchema

/**
 * Creates new XmlSchemaRedefine
 */
public XmlSchemaRedefine() {
  items = new XmlSchemaObjectCollection();
  schemaTypes = new XmlSchemaObjectTable();
  groups = new XmlSchemaObjectTable();
  attributeGroups = new XmlSchemaObjectTable();
}

代码示例来源:origin: org.springframework.ws/org.springframework.xml

public QName[] getElementNames() {
  List<QName> result = new ArrayList<QName>();
  Iterator<?> iterator = schema.getElements().getNames();
  while (iterator.hasNext()) {
    QName name = (QName) iterator.next();
    result.add(name);
  }
  return result.toArray(new QName[result.size()]);
}

代码示例来源:origin: com.legsem.legstar/legstar-cob2trans

new FileInputStream(xsdFile), xsdEncoding), null);
XmlSchemaObjectTable schemaElements = xsd.getElements();
Iterator < ? > it = schemaElements.getValues();
while (it.hasNext()) {
  Object element = it.next();

代码示例来源:origin: org.apache.ws/com.springsource.org.apache.ws.commons.schema

public XmlSchemaType getTypeByName(QName name) {
  return (XmlSchemaType)schemaTypes.getItem(name);
}

代码示例来源:origin: org.apache.woden/woden-impl-commons

Iterator qnames = elementTable.getNames();
while (qnames.hasNext()) {
  QName xseQN = (QName) qnames.next();
    ed.setSystem(typeSystemURI);
    ed.setContentModel(Constants.API_APACHE_WS_XS);
    ed.setContent(elementTable.getItem(xseQN));
    fDesc.addElementDeclaration(ed);

代码示例来源:origin: org.apache.ws.commons.schema/XmlSchema

public void addType(XmlSchemaType type) {
  QName qname = type.getQName();
  if (schemaTypes.contains(qname)) {
    throw new XmlSchemaException(" Schema for namespace '" +
        syntacticalTargetNamespace + "' already contains type '" +
        qname.getLocalPart() + "'");
  }
  schemaTypes.add(qname, type);
}

代码示例来源: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);
}

代码示例来源:origin: org.apache.ws.schema/XmlSchema

/**
 * Creates new XmlSchemaRedefine
 */
public XmlSchemaRedefine() {
  items = new XmlSchemaObjectCollection();
  schemaTypes = new XmlSchemaObjectTable();
  groups = new XmlSchemaObjectTable();
  attributeGroups = new XmlSchemaObjectTable();
}

代码示例来源:origin: org.apache.woden/woden-impl-commons

Iterator elementNames = elements.getNames();
while(elementNames.hasNext())
Iterator typeNames = types.getNames();
while(typeNames.hasNext())

代码示例来源:origin: org.apache.ws.commons.schema/XmlSchema

} else {
    XmlSchemaAttribute attribute = (XmlSchemaAttribute) attributes
            .getItem(name);
    if (deep) {
        if (attribute == null) {

代码示例来源:origin: org.apache.woden/woden-impl-commons

Iterator qnames = typeTable.getNames();
while (qnames.hasNext()) {
  QName xstQN = (QName) qnames.next();
    td.setSystem(typeSystemURI);
    td.setContentModel(Constants.API_APACHE_WS_XS);
    td.setContent(typeTable.getItem(xstQN));
    fDesc.addTypeDefinition(td);

代码示例来源:origin: org.apache.ws.schema/XmlSchema

public void addType(XmlSchemaType type) {
  QName qname = type.getQName();
  if (schemaTypes.contains(qname)) {
    throw new XmlSchemaException(" Schema for namespace '" +
        syntacticalTargetNamespace + "' already contains type '" +
        qname.getLocalPart() + "'");
  }
  schemaTypes.add(qname, type);
}

相关文章