本文整理汇总了Java中org.vast.xml.DOMHelperException类的典型用法代码示例。如果您正苦于以下问题:Java DOMHelperException类的具体用法?Java DOMHelperException怎么用?Java DOMHelperException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DOMHelperException类属于org.vast.xml包,在下文中一共展示了DOMHelperException类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setInput
import org.vast.xml.DOMHelperException; //导入依赖的package包/类
@Override
public void setInput(InputStream inputStream) throws IOException
{
try
{
this.dom = new DOMHelper(inputStream, false);
}
catch (DOMHelperException e)
{
throw new XMLReaderException("Error while parsing XML stream", e);
}
}
示例2: readXMLQuery
import org.vast.xml.DOMHelperException; //导入依赖的package包/类
public RequestType readXMLQuery(InputStream input) throws OWSException
{
try
{
DOMHelper dom = new DOMHelper(input, false);
return readXMLQuery(dom, dom.getBaseElement());
}
catch (DOMHelperException e)
{
throw new OWSException("Cannot read XML request", e);
}
}
示例3: readXMLResponse
import org.vast.xml.DOMHelperException; //导入依赖的package包/类
public ResponseType readXMLResponse(InputStream input) throws OWSException
{
try
{
DOMHelper dom = new DOMHelper(input, false);
return readXMLResponse(dom, dom.getBaseElement());
}
catch (DOMHelperException e)
{
throw new OWSException("Cannot read XML response", e);
}
}
示例4: readXMLQuery
import org.vast.xml.DOMHelperException; //导入依赖的package包/类
/**
* Helper method to parse any OWS query directly from an InputStream
* @param is input stream containing the XML document to read from
* @param serviceType service type to check if service parameter in query is correct
* @return OWS request object filled with all parameters parsed from XML request
* @throws OWSException
*/
public OWSRequest readXMLQuery(InputStream is, String serviceType) throws OWSException
{
try
{
DOMHelper dom = new DOMHelper(is, false);
OWSRequest request = readXMLQuery(dom, dom.getRootElement(), serviceType);
return request;
}
catch (DOMHelperException e)
{
throw new OWSException(AbstractRequestReader.invalidXML, e);
}
}
示例5: readXMLResponse
import org.vast.xml.DOMHelperException; //导入依赖的package包/类
/**
* Helper method to parse any OWS response directly from an InputStream
* @param is input stream to read from
* @param serviceType type of OGC service sending the response
* @param responseType type of response to read (get it from
* @return OWS response object
* @throws OWSException
*/
public OWSResponse readXMLResponse(InputStream is, String serviceType, String responseType) throws OWSException
{
try
{
DOMHelper dom = new DOMHelper(is, false);
OWSResponse resp = readXMLResponse(dom, dom.getRootElement(), serviceType, responseType);
return resp;
}
catch (DOMHelperException e)
{
throw new OWSException(AbstractResponseReader.invalidXML, e);
}
}
示例6: loadMaps
import org.vast.xml.DOMHelperException; //导入依赖的package包/类
/**
* Loads the URI to Process Class map using the provided XML file.
* Existing entries are replaced only if the replace argument is true.
* @param libFileUrl Url to the file containing the mapping definitions
* @param replace If true, existing entries are replaced
* @throws SMLException
*/
public static synchronized void loadMaps(String libFileUrl, boolean replace) throws SMLException
{
try
{
// create process hashtable entries
DOMHelper dom = new DOMHelper(libFileUrl, false);
NodeList processElts = dom.getElements("Process");
if (processMap == null)
processMap = new HashMap<String,String>(processElts.getLength());
for (int i=0; i<processElts.getLength(); i++)
{
Element processElt = (Element)processElts.item(i);
String className = dom.getElementValue(processElt, "class");
NodeList uriElts = dom.getElements(processElt, "uri");
for (int j=0; j<uriElts.getLength(); j++)
{
Element uriElt = (Element)uriElts.item(j);
String uri = dom.getElementValue(uriElt, "");
if (replace || (processMap.get(uri) == null))
processMap.put(uri, className);
}
}
}
catch (DOMHelperException e)
{
throw new SMLException("Error while reading Process Map File", e);
}
}