org.apache.xerces.xs.XSObject.getNamespace()方法的使用及代码示例

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

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

XSObject.getNamespace介绍

[英]The [target namespace] of this object, or null if it is unspecified.
[中]此对象的[target namespace],如果未指定,则为null

代码示例

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

/**
 * Construct an XSNamedMap implementation one namespace from an array
 * 
 * @param array     containing all components
 * @param length    number of components
 */
public XSNamedMapImpl(XSObject[] array, int length) {
  if (length == 0) {
    fNamespaces = null;
    fMaps = null;
    fNSNum = 0;
    fArray = array;
    fLength = 0;
    return;
  }
  // because all components are from the same target namesapce,
  // get the namespace from the first one.
  fNamespaces = new String[]{array[0].getNamespace()};
  fMaps = null;
  fNSNum = 1;
  // copy elements to the Vector
  fArray = array;
  fLength = length;
}

代码示例来源:origin: de.tudarmstadt.ukp.dkpro.core/de.tudarmstadt.ukp.dkpro.core.io.wsdl-asl

private static boolean matches(XSObject aObject, QName aQName)
  {
    return aObject.getName().equals(aQName.getLocalPart())
        && aObject.getNamespace().equals(aQName.getNamespaceURI());
  }
}

代码示例来源:origin: org.jboss.ws.native/jbossws-native-core

/**
* Retrieves an <code>XSObject</code> specified by local name and
* namespace URI.
* <br>Per XML Namespaces, applications must use the value <code>null</code> as the
* <code>namespace</code> parameter for methods if they wish to specify
* no namespace.
* @param namespace The namespace URI of the <code>XSObject</code> to
*   retrieve, or <code>null</code> if the <code>XSObject</code> has no
*   namespace.
* @param localName The local name of the <code>XSObject</code> to
*   retrieve.
* @return A <code>XSObject</code> (of any type) with the specified local
*   name and namespace URI, or <code>null</code> if they do not
*   identify any object in this map.
*/
public XSObject itemByName(String namespace, String localName)
{
 XSObject xso = null; 
 //Since our list may contain types from xerces implementation
 for(XSObject obj: list)
 {
   if(localName.equals(obj.getName()) &&
      namespace.equals(obj.getNamespace()))
    return obj;
 }
 return xso;
}

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

private void expandRelatedComponents(XSObject component, Vector componentList, Hashtable dependencies) {
  short componentType = component.getType();
  switch (componentType) {
  case XSConstants.TYPE_DEFINITION :
    expandRelatedTypeComponents((XSTypeDefinition) component, componentList, component.getNamespace(), dependencies);
    break;
  case XSConstants.ATTRIBUTE_DECLARATION :
    expandRelatedAttributeComponents((XSAttributeDeclaration) component, componentList, component.getNamespace(), dependencies);
    break;
  case XSConstants.ATTRIBUTE_GROUP :
    expandRelatedAttributeGroupComponents((XSAttributeGroupDefinition) component, componentList, component.getNamespace(), dependencies);
  case XSConstants.ELEMENT_DECLARATION :
    expandRelatedElementComponents((XSElementDeclaration) component, componentList, component.getNamespace(), dependencies);
    break;
  case XSConstants.MODEL_GROUP_DEFINITION :
    expandRelatedModelGroupDefinitionComponents((XSModelGroupDefinition) component, componentList, component.getNamespace(), dependencies);
  case XSConstants.ATTRIBUTE_USE :
    //expandRelatedAttributeUseComponents((XSAttributeUse)component, componentList, dependencies);
  case XSConstants.NOTATION_DECLARATION :
  case XSConstants.IDENTITY_CONSTRAINT :
  default :
    break;
  }
}

代码示例来源:origin: AlexanderBartash/hybris-integration-intellij-idea-plugin

public String toJavaTypeName(XSObject xs, Map<String, NamespaceDesc> nsdMap) {
  String name = xs.getName();
  if (name == null) {
    if (xs instanceof TypeInfo) {
      name = ((TypeInfo) xs).getTypeName();
      if (name != null && name.startsWith("#")) {
        name = name.substring(1);
      }
    }
  }
  return model.toJavaTypeName(name, xs.getNamespace());
}

代码示例来源:origin: AlexanderBartash/hybris-integration-intellij-idea-plugin

public String toJavaQualifiedTypeName(XSObject xs, Map<String, NamespaceDesc> nsdMap, boolean isEnum) {
  String typeName = toJavaTypeName(xs.getName(), xs.getNamespace());
  return getNSDPrefix(xs.getNamespace(), xs.getName(), isEnum) + typeName;
}

代码示例来源:origin: org.lorislab.corn/corn

private static QName getQName(XSModel xsModel, String root) {
  String namespace = null;
  XSNamedMap m1 = xsModel.getComponents(XSConstants.ELEMENT_DECLARATION);
  if (m1 != null) {
    for (int i = 0; i < m1.getLength(); i++) {
      XSObject o = m1.item(i);
      if (root.equals(o.getName())) {
        namespace = o.getNamespace();
      }
    }
  }
  return new QName(namespace, root);
}

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

} else {
  String localPart = component.getName();
  String uri = component.getNamespace();
  if (uri != null && localPart != null) { // .../schemaElement::p:item
    if (uri.equals(nameTest.uri)

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

for (int i = 0; i < length; ++i) {
  XSObject xso = item(i);
  entries[i] = new XSNamedMapEntry(new QName(xso.getNamespace(), xso.getName()), xso);

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

XSTypeDefinition xsType = elem.getTypeDefinition();
if (WSIConstants.NS_URI_SWA_REF.equals(xsType.getNamespace())
 && WSIConstants.SCHEMA_TYPE_SWA_REF.equals(xsType.getName()))
  new QName(elem.getNamespace(), elem.getName()));

代码示例来源:origin: eclipse/winery

if (id.getNamespace().getDecoded().equals(item.getNamespace())) {
  result.add(item.getName());

代码示例来源:origin: AlexanderBartash/hybris-integration-intellij-idea-plugin

for (int i = 0; i < components.getLength(); i++) {
  XSObject obj = components.item(i);
  QName qname = new QName(obj.getNamespace(), obj.getName());
  String file = this.model.qname2FileMap.get(qname);
  this.model.qname2FileMap.put(qname, (file == null ? "" : file + ";") + schemaFile.getName());
for (int i = 0; i < components.getLength(); i++) {
  XSObject obj = components.item(i);
  QName qname = new QName(obj.getNamespace(), obj.getName());
  String file = this.model.qname2FileMap.get(qname);
  this.model.qname2FileMap.put(qname, (file == null ? "" : file) + ":" + schemaFile.getName() + ":");

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

xsType.getNamespace()))
new QName(elem.getNamespace(), elem.getName()));

代码示例来源:origin: jboss/jbossxb

if(!Constants.NS_XML_SCHEMA.equals(type.getNamespace()))
 typeNames.add(new QName(type.getNamespace(), type.getName()));

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

if (xsSimpleType.getNamespace().equals(WSIConstants.NS_URI_SWA_REF)
 && xsSimpleType.getName().equals(WSIConstants.SCHEMA_TYPE_SWA_REF))

代码示例来源:origin: jboss/jbossxb

roots += "{" + xsObject.getNamespace() + "}" + xsObject.getName();

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

addGlobalComponents(expandedComponents, importDependencies);
if (referType == XSDDescription.CONTEXT_PREPARSE) {
  desc.setTargetNamespace(components[0].getNamespace());

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

private boolean canAddComponent(XSObject component, XSDDescription desc) {
  desc.setNamespace(component.getNamespace());

代码示例来源:origin: AlexanderBartash/hybris-integration-intellij-idea-plugin

model.qname2FileMap.get(new QName(o.getNamespace(), o.getName()))
);
return ctd;

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

private void addGlobalComponent(XSObject component, XSDDescription desc) {
  final String namespace = component.getNamespace();

相关文章