本文整理了Java中org.eclipse.xsd.XSDTypeDefinition.getTargetNamespace()
方法的一些代码示例,展示了XSDTypeDefinition.getTargetNamespace()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSDTypeDefinition.getTargetNamespace()
方法的具体详情如下:
包路径:org.eclipse.xsd.XSDTypeDefinition
类名称:XSDTypeDefinition
方法名:getTargetNamespace
暂无
代码示例来源:origin: geotools/geotools
protected void buildComplexTypeIndex() {
complexTypeIndex = new HashMap();
for (int i = 0; i < schemas.length; i++) {
XSDSchema schema = schemas[i];
for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext(); ) {
XSDTypeDefinition type = (XSDTypeDefinition) t.next();
if (type instanceof XSDComplexTypeDefinition) {
QName qName = new QName(type.getTargetNamespace(), type.getName());
complexTypeIndex.put(qName, type);
}
}
}
}
代码示例来源:origin: geotools/geotools
protected void buildSimpleTypeIndex() {
simpleTypeIndex = new HashMap();
for (int i = 0; i < schemas.length; i++) {
XSDSchema schema = schemas[i];
for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext(); ) {
XSDTypeDefinition type = (XSDTypeDefinition) t.next();
if (type instanceof XSDSimpleTypeDefinition) {
QName qName = new QName(type.getTargetNamespace(), type.getName());
simpleTypeIndex.put(qName, type);
}
}
}
}
代码示例来源:origin: geotools/geotools
/**
* Returns true if the <code>typeDefinition</code> is based on provided <code>superNS</code>.
*
* @param typeDefinition
* @param superNS
* @return
*/
private static boolean isBasedOn(XSDTypeDefinition typeDefinition, final String superNS) {
XSDTypeDefinition baseType;
String targetNamespace;
String name;
while ((baseType = typeDefinition.getBaseType()) != null) {
targetNamespace = baseType.getTargetNamespace();
name = baseType.getName();
if (XS.NAMESPACE.equals(targetNamespace) && XS.ANYTYPE.getLocalPart().equals(name)) {
// break the loop or this goes forever
return false;
}
if (superNS.equals(targetNamespace)) {
return true;
}
typeDefinition = baseType;
}
return false;
}
代码示例来源:origin: geotools/geotools
/**
* Provide an explicit mapping from an XSD type
* @param namespace
* @param name
*/
public void addTypeMapping(String namespace, String name,
AttributeType gtType) {
if (namespace == null) {
namespace = schema.getTargetNamespace();
}
assert name != null;
//find the type in the xsd schema
List typeDefs = schema.getTypeDefinitions();
for (Iterator itr = typeDefs.iterator(); itr.hasNext();) {
XSDTypeDefinition xsdType = (XSDTypeDefinition) itr.next();
String tns = xsdType.getTargetNamespace();
String tn = xsdType.getName();
if (namespace.equals(tns) && name.equals(tn)) {
types.put(xsdType, gtType);
return;
}
}
throw new IllegalArgumentException("Type: [" + namespace + "," + name
+ "] not found");
}
代码示例来源:origin: geotools/geotools
/**
* Returns <code>true</code> if <code>typeDefinition</code> is derived from a type named <code>
* superTypeName</code>
*
* @param typeDefinition
* @param superTypeName
* @return
*/
private static boolean isDerivedFrom(
XSDTypeDefinition typeDefinition, final Name superTypeName) {
XSDTypeDefinition baseType;
final String superNS = superTypeName.getNamespaceURI();
final String superName = superTypeName.getLocalPart();
String targetNamespace;
String name;
while ((baseType = typeDefinition.getBaseType()) != null) {
targetNamespace = baseType.getTargetNamespace();
name = baseType.getName();
if (XS.NAMESPACE.equals(targetNamespace) && XS.ANYTYPE.getLocalPart().equals(name)) {
return false;
}
if (superNS.equals(targetNamespace) && superName.equals(name)) {
return true;
}
typeDefinition = baseType;
}
return false;
}
代码示例来源:origin: geotools/geotools
XSDTypeDefinition type = (XSDTypeDefinition)itr.next();
if (type.getName() == null) continue;
if (!ns.equals(type.getTargetNamespace())) continue;
代码示例来源:origin: geotools/geotools
if (!xsdType.getTargetNamespace()
.equals(schema.getTargetNamespace())) {
continue;
if (!xsdType.getTargetNamespace()
.equals(schema.getTargetNamespace())) {
continue;
代码示例来源:origin: geotools/geotools
} else if (parent.getTargetNamespace() != null) {
childName = new QName(parent.getTargetNamespace(), child.getName());
} else if (parent.getType().getTargetNamespace() != null) {
childName =
new QName(
parent.getType().getTargetNamespace(), child.getName());
} else {
childName = new QName(null, child.getName());
代码示例来源:origin: geotools/geotools
bindingLoader.loadBinding(
new QName(
type.getTargetNamespace(),
type.getName()),
context);
代码示例来源:origin: geotools/geotools
new QName(contentType.getTargetNamespace(), contentType.getName());
代码示例来源:origin: geotools/geotools
String targetNamespace = baseType.getTargetNamespace();
String name = baseType.getName();
if (name != null) {
+ childDecl.getName()
+ " from container '"
+ typeDefinition.getTargetNamespace()
+ "#"
+ typeDefinition.getName()
代码示例来源:origin: geotools/geotools
bindingName = new QName(type.getTargetNamespace(), type.getName());
} else {
bindingName = new QName(type.getTargetNamespace(), "_" + element.getName());
代码示例来源:origin: geotools/geotools
Name typeName = Types.typeName(typeDef.getTargetNamespace(), typeDef.getName());
AttributeType attType = typeRegistry.get(typeName);
代码示例来源:origin: geotools/geotools
QName qualifiedElementTypeName =
new QName(
elementTypeDef.getTargetNamespace(), elementTypeDef.getName());
if (qualifiedTypeName.equals(qualifiedElementTypeName)) {
type = elementTypeDef;
代码示例来源:origin: geotools/geotools
boolean isAnyType =
typeDef.getName() != null
&& typeDef.getTargetNamespace() != null
&& typeDef.getName().equals(XS.ANYTYPE.getLocalPart())
&& typeDef.getTargetNamespace().equals(XS.NAMESPACE);
if (isAnyType) {
Collection complexAtts;
代码示例来源:origin: geotools/geotools
String targetNamespace = typeDefinition.getTargetNamespace();
String name = typeDefinition.getName();
Name typeName = Types.typeName(targetNamespace, name);
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
/**
* Returns whether the type definition is the
* <a href="http://www.w3.org/TR/xmlschema-2/#dt-anySimpleType">anySimpleType</a>.
* @param xsdTypeDefinition a simple or complex type definition.
* @return whether the type definition is the anySimpleType.
*/
public static boolean isAnySimpleType(XSDTypeDefinition xsdTypeDefinition)
{
return
isSchemaForSchemaNamespace(xsdTypeDefinition.getTargetNamespace()) &&
"anySimpleType".equals(xsdTypeDefinition.getName());
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
/**
* Returns whether the type definition is the
* <a href="http://www.w3.org/TR/xmlschema-2/#dt-anySimpleType">anySimpleType</a>.
* @param xsdTypeDefinition a simple or complex type definition.
* @return whether the type definition is the anySimpleType.
*/
public static boolean isAnySimpleType(XSDTypeDefinition xsdTypeDefinition)
{
return
isSchemaForSchemaNamespace(xsdTypeDefinition.getTargetNamespace()) &&
"anySimpleType".equals(xsdTypeDefinition.getName());
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public String getTypeNameQualifier()
{
XSDTypeDefinition type = getResolvedXSDAttributeDeclaration().getTypeDefinition();
if (type != null)
{
return type.getTargetNamespace();
}
return "";
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public String getTypeNameQualifier()
{
XSDTypeDefinition type = getResolvedXSDAttributeDeclaration().getTypeDefinition();
if (type != null)
{
return type.getTargetNamespace();
}
return "";
}
内容来源于网络,如有侵权,请联系作者删除!