gpt4 book ai didi

org.geoserver.wfs.WFSException.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 22:13:05 25 4
gpt4 key购买 nike

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

WFSException.<init>介绍

暂无

代码示例

代码示例来源:origin: org.geoserver/gs-wfs

/**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated modifiable
   */
  public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
    throw new WFSException("Circle is not supported", "InvalidParameterValue");
  }
}

代码示例来源:origin: org.geoserver.community/gs-nsg-wfs-profile

void checkTimeout() {
  if (!cancelled && System.currentTimeMillis() > timeoutTime) {
    this.thrown = true;
    throw new WFSException(request, "Timeout exceeded", TIMEOUT_EXCEPTION_CODE);
  }
}

代码示例来源:origin: org.geoserver/wfsv

FeatureTypeInfo featureTypeInfo(QName name) throws WFSException, IOException {
    FeatureTypeInfo meta = catalog.getFeatureTypeInfo(name.getLocalPart(),
        name.getNamespaceURI());

    if (meta == null) {
      String msg = "Could not locate " + name + " in catalog.";
      throw new WFSException(msg);
    }

    return meta;
  }
}

代码示例来源:origin: org.geoserver/gs-wfs

private void checkValidJoinFilter(Filter filter) {
  Set<String> prefixes = getFilterPrefixes(filter);
  if (prefixes.size() > 2) {
    throw new WFSException(
        "Not subfilter joins against more than one table "
            + prefixes
            + ", this kind of filter is not supported: "
            + filter);
  }
}

代码示例来源:origin: org.geoserver/wfsv

FeatureTypeInfo featureTypeInfo(QName name) throws WFSException, IOException {
    FeatureTypeInfo meta = catalog.getFeatureTypeInfo(name.getLocalPart(),
        name.getNamespaceURI());

    if (meta == null) {
      String msg = "Could not locate " + name + " in catalog.";
      throw new WFSException(msg);
    }

    return meta;
  }
}

代码示例来源:origin: org.geoserver/gs-wfs

public void checkValidity(TransactionElement element, Map featureTypeInfos)
    throws WFSTransactionException {
  if (!getInfo().getServiceLevel().getOps().contains(WFSInfo.Operation.TRANSACTION_REPLACE)) {
    throw new WFSException(element, "Transaction REPLACE support is not enabled");
  }
  if (featureTypeInfos.size() != 1) {
    throw new WFSException(
        element,
        "Transaction REPLACE must only specify features from a"
            + " single feature type");
  }
}

代码示例来源:origin: org.geoserver/gs-wfs

FeatureTypeInfo featureTypeInfo(QName name, GetFeatureRequest request)
    throws WFSException, IOException {
  FeatureTypeInfo meta =
      catalog.getFeatureTypeByName(name.getNamespaceURI(), name.getLocalPart());
  if (meta == null) {
    String msg = "Could not locate " + name + " in catalog.";
    throw new WFSException(request, msg, "InvalidParameterValue").locator("typeName");
  }
  return meta;
}

代码示例来源:origin: org.geoserver/gs-wfs

@Override
  public Object read(Object request, Map kvp, Map rawKvp) throws Exception {
    // special cite compliance check to ensure the client specified typeNames rather than just
    // typeName (but typename is a parameter in a StoredQuery in CITE tests!!)
    if (!kvp.containsKey("typenames")
        && kvp.containsKey("typename")
        && getWFS().isCiteCompliant()
        && !kvp.containsKey("STOREDQUERY_ID")) {
      throw new WFSException("WFS 2.0 requires typeNames, not typeName");
    }
    return super.read(request, kvp, rawKvp);
  }
}

代码示例来源:origin: org.geoserver/gs-wfs

private void checkNonSpatial(PropertyName pn) {
    AttributeDescriptor ad = (AttributeDescriptor) pn.evaluate(featureType);
    if (ad instanceof GeometryDescriptor || isGmlBoundedBy(pn)) {
      throw new WFSException(
          request,
          "Cannot use a spatial property in a alphanumeric binary "
              + "comparison");
    }
  }
};

代码示例来源:origin: org.geoserver/wfsv

public Object visit(PropertyName name, Object data) {
  // case of multiple geometries being returned
  if (name.evaluate(featureType) == null) {
    // we want to throw wfs exception, but cant
    throw new WFSException("Illegal property name: "
      + name.getPropertyName(), "InvalidParameterValue");
  }
  return name;
}
;

代码示例来源:origin: org.geoserver/xslt

@Override
public String getMimeType(Object value, Operation operation) throws ServiceException {
  try {
    TransformInfo info = locateTransformation((FeatureCollectionResponse) value, operation);
    return info.mimeType();
  } catch(IOException e) {
    throw new WFSException("Failed to load the required transformation", e);
  }
}

代码示例来源:origin: org.geoserver/wfsv

public Object visit(PropertyName name, Object data) {
  // case of multiple geometries being returned
  if (name.evaluate(featureType) == null) {
    // we want to throw wfs exception, but cant
    throw new WFSException("Illegal property name: "
      + name.getPropertyName(), "InvalidParameterValue");
  }
  return name;
}
;

代码示例来源:origin: org.geoserver/gs-wfs

public void checkValidity(
    TransactionElement element, Map<QName, FeatureTypeInfo> featureTypeInfos)
    throws WFSTransactionException {
  if (!getInfo().getServiceLevel().getOps().contains(WFSInfo.Operation.TRANSACTION_INSERT)) {
    throw new WFSException(element, "Transaction INSERT support is not enabled");
  }
}

代码示例来源:origin: org.geoserver/wfsv

protected FeatureCollection getFeatures(GetFeatureType request,
    FeatureSource source, Query gtQuery) throws IOException {
  if(!(source instanceof VersioningFeatureSource))
    throw new WFSException(source.getSchema().getTypeName() + " is not versioned, cannot " +
        "execute a GetVersionedFeature on it");
  return ((VersioningFeatureSource) source).getVersionedFeatures(gtQuery);
}

代码示例来源:origin: org.geoserver/gs-wfs

public void checkValidity(TransactionElement delete, Map featureTypeInfos)
    throws WFSTransactionException {
  if (!getInfo().getServiceLevel().getOps().contains(WFSInfo.Operation.TRANSACTION_DELETE)) {
    throw new WFSException(delete, "Transaction Delete support is not enabled");
  }
  Filter f = delete.getFilter();
  if ((f == null) || Filter.INCLUDE.equals(f)) {
    throw new WFSTransactionException(
        "Must specify filter for delete", "MissingParameterValue");
  }
}

代码示例来源:origin: org.geoserver/xslt

private Operation buildSourceOperation(Operation operation, TransformInfo info) {
  try {
    EObject originalParam = (EObject) operation.getParameters()[0];
    EObject copy = EcoreUtil.copy(originalParam);
    BeanUtils.setProperty(copy, "outputFormat", info.getSourceFormat());
    final Operation sourceOperation = new Operation(operation.getId(),
        operation.getService(), operation.getMethod(), new Object[] { copy });
    return sourceOperation;
  } catch (Exception e) {
    throw new WFSException(
        "Failed to create the source operation for XSLT, this is unexpected", e);
  }
}

代码示例来源:origin: org.geoserver/gs-wfs

/**
 * Test {@link WFSException#init(Object)} for Exception with a WFS20 {@link Delete}-Action.
 *
 * @see "https://osgeo-org.atlassian.net/browse/GEOS-5857"
 */
@Test
public void testWFS20Delete() {
  WFSException tmpEx = new WFSException(new Delete.WFS20(deleteType2), "test");
  Assert.assertEquals("Delete", tmpEx.getLocator());
}

代码示例来源:origin: org.geoserver/gs-wfs

/**
 * Test {@link WFSException#init(Object)} for Exception with a WFS11 {@link Delete}-Action.
 *
 * @see "https://osgeo-org.atlassian.net/browse/GEOS-5857"
 */
@Test
public void testWFS11Delete() {
  WFSException tmpEx = new WFSException(new Delete.WFS11(deleteElementType1), "test");
  // WFS 1.x: no locator
  Assert.assertNull(tmpEx.getLocator());
}

代码示例来源:origin: org.geoserver/gs-wfs

/**
   * Test {@link WFSException#init(Object)} for Exception with a WFS20 {@link
   * GetFeatureRequest}-Action.
   *
   * @see "https://osgeo-org.atlassian.net/browse/GEOS-5857"
   */
  @Test
  public void testWFS20GetFeatureType() {
    WFSException tmpEx = new WFSException(new GetFeatureRequest.WFS20(getFeatureType2), "test");
    Assert.assertEquals("GetFeature", tmpEx.getLocator());
  }
}

代码示例来源:origin: org.geoserver/gs-wfs

/**
 * Test {@link WFSException#init(Object)} for Exception with a WFS11 {@link
 * GetFeatureRequest}-Action.
 *
 * @see "https://osgeo-org.atlassian.net/browse/GEOS-5857"
 */
@Test
public void testWFS11GetFeatureType() {
  WFSException tmpEx = new WFSException(new GetFeatureRequest.WFS11(getFeatureType1), "test");
  // WFS 1.x: no locator, GetFeature type is a top-level request and provides a default
  // version (1.1.0)
  Assert.assertNull(tmpEx.getLocator());
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com