org.apache.cxf.common.xmlschema.XmlSchemaUtils.addImportIfNeeded()方法的使用及代码示例

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

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

XmlSchemaUtils.addImportIfNeeded介绍

[英]Assist in managing the required for imports of peer schemas.
[中]协助管理对等模式导入所需的资源。

代码示例

代码示例来源:origin: apache/cxf

public static void addUtilityTypesToSchema(XmlSchema root) {
  XmlSchemaUtils.addImportIfNeeded(root, UTILITY_TYPES_SCHEMA_NS);
}

代码示例来源:origin: apache/cxf

private void addXmimeToSchema(XmlSchema root) {
  XmlSchemaUtils.addImportIfNeeded(root, AbstractXOPType.XML_MIME_NS);
}

代码示例来源:origin: org.apache.cxf/cxf-rt-databinding-aegis

private void addXmimeToSchema(XmlSchema root) {
  XmlSchemaUtils.addImportIfNeeded(root, AbstractXOPType.XML_MIME_NS);
}

代码示例来源:origin: org.apache.cxf/cxf-rt-databinding-aegis

public static void addUtilityTypesToSchema(XmlSchema root) {
  XmlSchemaUtils.addImportIfNeeded(root, UTILITY_TYPES_SCHEMA_NS);
}

代码示例来源:origin: apache/cxf

/**
 * For convenience, start from a qname, and add the import if it is non-null
 * and has a namespace.
 * @see #addImportIfNeeded(XmlSchema, String)
 * @param schema
 * @param qname
 */
public static void addImportIfNeeded(XmlSchema schema, QName qname) {
  if (qname == null) {
    return;
  }
  if (qname.getNamespaceURI() == null) {
    return;
  }
  addImportIfNeeded(schema, qname.getNamespaceURI());
}

代码示例来源:origin: apache/cxf

public static void setAttributeAttributes(QName name, AegisType type, XmlSchema root) {
  String ns = type.getSchemaType().getNamespaceURI();
  XmlSchemaUtils.addImportIfNeeded(root, ns);
}

代码示例来源:origin: org.apache.cxf/cxf-rt-databinding-aegis

public static void setAttributeAttributes(QName name, AegisType type, XmlSchema root) {
  String ns = type.getSchemaType().getNamespaceURI();
  XmlSchemaUtils.addImportIfNeeded(root, ns);
}

代码示例来源:origin: org.apache.cxf/cxf-api

private void addElementCrossImportsElement(XmlSchema schema, XmlSchemaElement item) {
  XmlSchemaElement element = item;
  XmlSchemaUtils.addImportIfNeeded(schema, element.getRef().getTargetQName());
  XmlSchemaUtils.addImportIfNeeded(schema, element.getSchemaTypeName());
  // if there's an anonymous type, it might have element refs in it.
  XmlSchemaType schemaType = element.getSchemaType();
  if (!crossImportsAdded(schema, schemaType)) {
    addCrossImportsType(schema, schemaType);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-common-utilities

private void addElementCrossImportsElement(XmlSchema schema, XmlSchemaElement item) {
  XmlSchemaElement element = (XmlSchemaElement)item;
  XmlSchemaUtils.addImportIfNeeded(schema, element.getRef().getTargetQName());
  XmlSchemaUtils.addImportIfNeeded(schema, element.getSchemaTypeName());
  // if there's an anonymous type, it might have element refs in it.
  XmlSchemaType schemaType = element.getSchemaType();
  if (!crossImportsAdded(schema, schemaType)) {
    addCrossImportsType(schema, schemaType);
  }
}

代码示例来源:origin: apache/cxf

private void addOneSchemaCrossImports(XmlSchema schema) {
  /*
   * We need to visit all the top-level items.
   */
  for (XmlSchemaElement element : schema.getElements().values()) {
    addElementCrossImportsElement(schema, element);
  }
  for (XmlSchemaAttribute attribute : schema.getAttributes().values()) {
    XmlSchemaUtils.addImportIfNeeded(schema, attribute.getRef().getTargetQName());
    XmlSchemaUtils.addImportIfNeeded(schema, attribute.getSchemaTypeName());
  }
  for (XmlSchemaType type : schema.getSchemaTypes().values()) {
    addCrossImportsType(schema, type);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

private void addElementCrossImportsElement(XmlSchema schema, XmlSchemaElement item) {
  XmlSchemaElement element = item;
  XmlSchemaUtils.addImportIfNeeded(schema, element.getRef().getTargetQName());
  XmlSchemaUtils.addImportIfNeeded(schema, element.getSchemaTypeName());
  // if there's an anonymous type, it might have element refs in it.
  XmlSchemaType schemaType = element.getSchemaType();
  if (!crossImportsAdded(schema, schemaType)) {
    addCrossImportsType(schema, schemaType);
  }
}

代码示例来源:origin: apache/cxf

private void addElementCrossImportsElement(XmlSchema schema, XmlSchemaElement item) {
  XmlSchemaElement element = item;
  XmlSchemaUtils.addImportIfNeeded(schema, element.getRef().getTargetQName());
  XmlSchemaUtils.addImportIfNeeded(schema, element.getSchemaTypeName());
  // if there's an anonymous type, it might have element refs in it.
  XmlSchemaType schemaType = element.getSchemaType();
  if (!crossImportsAdded(schema, schemaType)) {
    addCrossImportsType(schema, schemaType);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-common-utilities

private void addOneSchemaCrossImports(XmlSchema schema) {
  /*
   * We need to visit all the top-level items.
   */
  for (XmlSchemaElement element : schema.getElements().values()) {
    addElementCrossImportsElement(schema, element);
  }
  for (XmlSchemaAttribute attribute : schema.getAttributes().values()) {
    XmlSchemaUtils.addImportIfNeeded(schema, attribute.getRef().getTargetQName());
    XmlSchemaUtils.addImportIfNeeded(schema, attribute.getSchemaTypeName());
  }
  for (XmlSchemaType type : schema.getSchemaTypes().values()) {
    addCrossImportsType(schema, type);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-core

private void addElementCrossImportsElement(XmlSchema schema, XmlSchemaElement item) {
  XmlSchemaElement element = item;
  XmlSchemaUtils.addImportIfNeeded(schema, element.getRef().getTargetQName());
  XmlSchemaUtils.addImportIfNeeded(schema, element.getSchemaTypeName());
  // if there's an anonymous type, it might have element refs in it.
  XmlSchemaType schemaType = element.getSchemaType();
  if (!crossImportsAdded(schema, schemaType)) {
    addCrossImportsType(schema, schemaType);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-api

private void addOneSchemaCrossImports(XmlSchema schema) {
  /*
   * We need to visit all the top-level items.
   */
  for (XmlSchemaElement element : schema.getElements().values()) {
    addElementCrossImportsElement(schema, element);
  }
  for (XmlSchemaAttribute attribute : schema.getAttributes().values()) {
    XmlSchemaUtils.addImportIfNeeded(schema, attribute.getRef().getTargetQName());
    XmlSchemaUtils.addImportIfNeeded(schema, attribute.getSchemaTypeName());
  }
  for (XmlSchemaType type : schema.getSchemaTypes().values()) {
    addCrossImportsType(schema, type);
  }
}

代码示例来源:origin: apache/cxf

private void addCrossImportsAttributeList(XmlSchema schema, List<XmlSchemaAttributeOrGroupRef> list) {
  for (XmlSchemaAttributeOrGroupRef attr : list) {
    QName ref = null;
    if (attr instanceof XmlSchemaAttribute) {
      ref = ((XmlSchemaAttribute)attr).getRef().getTargetQName();
    } else {
      XmlSchemaAttributeGroupRef groupRef = (XmlSchemaAttributeGroupRef)attr;
      ref = groupRef.getRef().getTargetQName();
    }
    if (ref != null) {
      XmlSchemaUtils.addImportIfNeeded(schema, ref);
    }
  }
}

代码示例来源:origin: org.apache.cxf/cxf-core

private void addCrossImportsAttributeList(XmlSchema schema, List<XmlSchemaAttributeOrGroupRef> list) {
  for (XmlSchemaAttributeOrGroupRef attr : list) {
    QName ref = null;
    if (attr instanceof XmlSchemaAttribute) {
      ref = ((XmlSchemaAttribute)attr).getRef().getTargetQName();
    } else {
      XmlSchemaAttributeGroupRef groupRef = (XmlSchemaAttributeGroupRef)attr;
      ref = groupRef.getRef().getTargetQName();
    }
    if (ref != null) {
      XmlSchemaUtils.addImportIfNeeded(schema, ref);
    }
  }
}

代码示例来源:origin: org.apache.cxf/cxf-common-utilities

private void addCrossImportsAttributeList(XmlSchema schema, List<XmlSchemaAttributeOrGroupRef> list) {
  for (XmlSchemaAttributeOrGroupRef attr : list) {
    QName ref = null;
    if (attr instanceof XmlSchemaAttribute) {
      ref = ((XmlSchemaAttribute)attr).getRef().getTargetQName();
    } else {
      XmlSchemaAttributeGroupRef groupRef = (XmlSchemaAttributeGroupRef)attr;
      ref = groupRef.getRef().getTargetQName();
    }
    if (ref != null) {
      XmlSchemaUtils.addImportIfNeeded(schema, ref);
    }
  }
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

private void addCrossImportsAttributeList(XmlSchema schema, List<XmlSchemaAttributeOrGroupRef> list) {
  for (XmlSchemaAttributeOrGroupRef attr : list) {
    QName ref = null;
    if (attr instanceof XmlSchemaAttribute) {
      ref = ((XmlSchemaAttribute)attr).getRef().getTargetQName();
    } else {
      XmlSchemaAttributeGroupRef groupRef = (XmlSchemaAttributeGroupRef)attr;
      ref = groupRef.getRef().getTargetQName();
    }
    if (ref != null) {
      XmlSchemaUtils.addImportIfNeeded(schema, ref);
    }
  }
}

代码示例来源:origin: org.apache.cxf/cxf-api

private void addCrossImportsAttributeList(XmlSchema schema, List<XmlSchemaAttributeOrGroupRef> list) {
  for (XmlSchemaAttributeOrGroupRef attr : list) {
    QName ref = null;
    if (attr instanceof XmlSchemaAttribute) {
      ref = ((XmlSchemaAttribute)attr).getRef().getTargetQName();
    } else {
      XmlSchemaAttributeGroupRef groupRef = (XmlSchemaAttributeGroupRef)attr;
      ref = groupRef.getRef().getTargetQName();
    }
    if (ref != null) {
      XmlSchemaUtils.addImportIfNeeded(schema, ref);
    }
  }
}

相关文章