org.apache.ws.commons.schema.XmlSchemaObjectTable.add()方法的使用及代码示例

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

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

XmlSchemaObjectTable.add介绍

暂无

代码示例

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

代码示例来源: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.wso2.carbon.data/org.wso2.carbon.dataservices.core

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

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

相关文章