org.geotools.xsd.XSD.getNamespaceURI()方法的使用及代码示例

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

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

XSD.getNamespaceURI介绍

[英]The namespace uri of the schema.
[中]架构的命名空间uri。

代码示例

代码示例来源:origin: geoserver/geoserver

@Override
public void write(Object value, OutputStream output, Operation operation)
    throws IOException, ServiceException {
  try {
    Configuration c = (Configuration) xmlConfiguration.newInstance();
    Encoder e = new Encoder(c);
    for (Map.Entry<String, String> entry : getSchemaLocations().entrySet()) {
      e.setSchemaLocation(entry.getKey(), entry.getValue());
    }
    configureEncoder(e, elementName, xmlConfiguration);
    e.encode(value, new QName(c.getXSD().getNamespaceURI(), elementName), output);
  } catch (Exception e) {
    throw (IOException) new IOException().initCause(e);
  }
}

代码示例来源:origin: geotools/geotools

public String toString() {
  return getNamespaceURI();
}

代码示例来源:origin: geotools/geotools

/** Implementation of equals, equality is based soley on {@link #getNamespaceURI()}. */
public final boolean equals(Object obj) {
  if (obj instanceof XSD) {
    XSD other = (XSD) obj;
    return getNamespaceURI().equals(other.getNamespaceURI());
  }
  return false;
}

代码示例来源:origin: geotools/geotools

/**
 * Returns the qualified name for the specified local part.
 *
 * @return The QName, built by simply prepending the namespace for this xsd.
 */
public QName qName(String local) {
  return new QName(getNamespaceURI(), local);
}

代码示例来源:origin: geotools/geotools

/**
 * Determines if the locator can locate a schema for the specified namespace and location.
 *
 * @return true if it can handle, otherwise false.
 */
public boolean canHandle(
    XSDSchema schema,
    String namespaceURI,
    String rawSchemaLocationURI,
    String resolvedSchemaLocationURI) {
  return xsd.getNamespaceURI().equals(namespaceURI);
}

代码示例来源:origin: geotools/geotools

public final int hashCode() {
  return getNamespaceURI().hashCode();
}

代码示例来源:origin: geotools/geotools

public boolean canHandle(
      XSDSchema schema,
      String namespaceURI,
      String rawSchemaLocationURI,
      String resolvedSchemaLocationURI) {
    return xsd.getNamespaceURI().equals(namespaceURI)
        && xsd.getSchemaLocation().equals(resolvedSchemaLocationURI);
  }
};

代码示例来源:origin: geotools/geotools

/** Returns the XSD object representing the contents of the schema. */
public final XSDSchema getSchema() throws IOException {
  if (schema == null) {
    synchronized (this) {
      if (schema == null) {
        LOGGER.fine("building schema for schema: " + getNamespaceURI());
        schema = buildSchema();
      }
    }
  }
  return schema;
}

代码示例来源:origin: geotools/geotools

/** Sets up the schema which maps xml schema types to attribute types. */
protected Schema buildTypeSchema() {
  return new SchemaImpl(getNamespaceURI());
}

代码示例来源:origin: geotools/geotools

/** @return The namespace of the configuration schema. */
public final String getNamespaceURI() {
  return getXSD().getNamespaceURI();
}

代码示例来源:origin: geotools/geotools

/**
 * Determines if the locator can resolve the schema location for a particular namespace uri and
 * schema location.
 *
 * @return true if it can handle, otherwise false.
 */
public boolean canHandle(XSDSchema schema, String uri, String location) {
  if (xsd.getNamespaceURI().equals(uri)) {
    // try resolving directly
    URL xsdLocation = resolveLocationToResource(location);
    return xsdLocation != null;
  }
  return false;
}

代码示例来源:origin: geotools/geotools

public boolean canHandle(QName elementName) {
  return handler.getConfiguration()
      .getXSD()
      .getNamespaceURI()
      .equals(elementName.getNamespaceURI());
}

代码示例来源:origin: geotools/geotools

public XSDSchema locateSchema(XSDSchema schema, String namespaceURI,
  String rawSchemaLocationURI, String resolvedSchemaLocationURI) {
  
  for ( Iterator x = xsds.iterator(); x.hasNext(); ) {
    XSD xsd = (XSD) x.next();
    if ( xsd == null ) {
      continue;
    }
    if ( xsd.getNamespaceURI().equals( namespaceURI ) ) {
      try {
        return xsd.getSchema();
      } 
      catch (IOException e) {
        getLog().warn("Error occured locating schema: " + namespaceURI, e);
      }
    }
  }
   getLog().warn( "Could not locate schema for: " + namespaceURI );
  return null;
}

代码示例来源:origin: geotools/geotools

encoding.setAttributeNS(gml.getNamespaceURI(), "id", id);

代码示例来源:origin: geotools/geotools

String uri = locations[i];
for (XSD dep : deps) {
  if (dep.getNamespaceURI().equals(uri)) {
    locations[i + 1] = dep.getSchemaLocation();

代码示例来源:origin: geotools/geotools

if (gml.getNamespaceURI().equals(attribute.getTargetNamespace())) {
  for (int j = i + 1; j < particles.size(); j++) {
    XSDParticle particle2 = (XSDParticle) particles.get(j);

相关文章