gpt4 book ai didi

org.n52.svalbard.util.XmlHelper.parseXmlString()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-27 12:19:05 25 4
gpt4 key购买 nike

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

XmlHelper.parseXmlString介绍

暂无

代码示例

代码示例来源:origin: org.n52.sensorweb.sos/hibernate-common

private String checkXml(String xml)
      throws DecodingException {
    XmlHelper.parseXmlString(xml);
    if (xml.startsWith("<?xml")) {
      return xml.substring(xml.indexOf(">") + 1);
    }
    return xml;
  }
}

代码示例来源:origin: 52North/SOS

private String checkXml(String xml)
      throws DecodingException {
    XmlHelper.parseXmlString(xml);
    if (xml.startsWith("<?xml")) {
      return xml.substring(xml.indexOf(">") + 1);
    }
    return xml;
  }
}

代码示例来源:origin: 52North/SOS

private XmlObject read(String path) throws DecodingException, IOException {
  try (InputStream stream = getDocumentAsStream(path)) {
    String string = StringHelper.convertStreamToString(stream);
    return XmlHelper.parseXmlString(string);
  }
}

代码示例来源:origin: 52North/SOS

protected Object decode(String xml) throws CodedException {
  try {
    XmlObject xmlObject = XmlHelper.parseXmlString(xml);
    DecoderKey decoderKey = CodingHelper.getDecoderKey(xmlObject);
    Decoder<Object, Object> decoder = decodingRepository.getDecoder(decoderKey);
    if (decoder != null) {
      return decoder.decode(xmlObject);
    } else {
      throw new NoApplicableCodeException().withMessage("No decoder found for %s", xmlObject.getClass().getName());
    }
  } catch (DecodingException de) {
    throw new NoApplicableCodeException().causedBy(de);
  }
}

代码示例来源:origin: org.n52.iceland/iceland

return XmlHelper.parseXmlString(os.toString());
} catch (IOException | EXIException ex) {
  throw new NoApplicableCodeException().causedBy(ex).withMessage("Error while reading request! Message: %s",

代码示例来源:origin: org.n52.svalbard/svalbard-xmlbeans

private XmlObject getSensorDescription(DescribeSensorResponse response, SosProcedureDescription<?> abstractFeature)
    throws EncodingException {
  if (abstractFeature instanceof SosProcedureDescriptionUnknownType && abstractFeature.isSetXml()) {
    try {
      return XmlHelper.parseXmlString(abstractFeature.getXml());
    } catch (DecodingException de) {
      throw new EncodingException("An xml error occured when parsing the request!", de);
    }
  }
  return encodeObjectToXml(response.getOutputFormat(), abstractFeature.getProcedureDescription());
}

代码示例来源:origin: 52North/SOS

protected AbstractFeature readXml(String xml, HibernateProcedureCreationContext ctx)
      throws OwsExceptionReport {
    try {
      XmlObject parsed = XmlHelper.parseXmlString(xml);
      return (AbstractFeature) ctx.getDecoderRepository().getDecoder(CodingHelper.getDecoderKey(parsed)).decode(parsed);
    } catch (DecodingException e) {
      throw new NoApplicableCodeException().causedBy(e)
          .withMessage("Error while creating procedure description from XML string");
    }

  }
}

代码示例来源:origin: org.n52.sensorweb.sos/hibernate-common

protected AbstractFeature readXml(String xml, HibernateProcedureCreationContext ctx)
      throws OwsExceptionReport {
    try {
      XmlObject parsed = XmlHelper.parseXmlString(xml);
      return (AbstractFeature) ctx.getDecoderRepository().getDecoder(CodingHelper.getDecoderKey(parsed)).decode(parsed);
    } catch (DecodingException e) {
      throw new NoApplicableCodeException().causedBy(e)
          .withMessage("Error while creating procedure description from XML string");
    }

  }
}

代码示例来源:origin: 52North/SOS

public Extension<?> parseExtensionParameter(String value) throws DecodingException {
  XmlObject xml = XmlHelper.parseXmlString(value);
  DecoderKey key = CodingHelper.getDecoderKey(xml);
  Decoder<Object, XmlObject> decoder = decoderRepository.getDecoder(key);
  if (decoder == null) {
    throw new NoDecoderForKeyException(key);
  }
  Object obj = decoder.decode(xml);
  if (obj instanceof Extension) {
    return (Extension<?>) obj;
  } else if (obj instanceof SweAbstractDataComponent) {
    return new SwesExtension<>().setValue((SweAbstractDataComponent)obj);
  } else {
    return new SwesExtension<>().setValue(new SweText().setValue(value));
  }
}

代码示例来源:origin: org.n52.svalbard/svalbard-xmlbeans

private void addProcedureDescription(InsertSensorRequest request, InsertSensorType insertSensor)
    throws EncodingException {
  XmlObject xmlObj;
  if (request.getProcedureDescription() instanceof SosProcedureDescriptionUnknownType &&
      request.getProcedureDescription().isSetXml()) {
    try {
      xmlObj = XmlHelper.parseXmlString(request.getProcedureDescription().getXml());
    } catch (DecodingException de) {
      throw new EncodingException("An xml error occured when parsing the request!", de);
    }
  }
  xmlObj = encodeObjectToXml(request.getProcedureDescriptionFormat(),
      request.getProcedureDescription().getProcedureDescription());
  insertSensor.addNewProcedureDescription().set(xmlObj);
}

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