Class GetCapabilitiesParseHelper
java.lang.Object
org.openstreetmap.josm.data.imagery.GetCapabilitiesParseHelper
Helper class for handling OGC GetCapabilities documents
- Since:
- 10993
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringOWS namespace address(package private) static final QNameQNames in OWS namespace(package private) static final QName(package private) static final QName(package private) static final QName(package private) static final QName(package private) static final QName(package private) static final QName(package private) static final QName(package private) static final QName(package private) static final QName(package private) static final QName(package private) static final QName(package private) static final QName(package private) static final QNamestatic final StringXML xlink namespace address -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringConvert CRS identifier to plain codestatic StringReturns whole content of the element that reader is pointing at, including other XML elements within (with their tags).static XMLStreamReadergetReader(InputStream in) Returns reader with properties set for parsing WM(T)S documentsgetTransferMode(XMLStreamReader reader) Parses Operation[@name='GetTile']/DCP/HTTP/Get section.static voidMoves the reader to the closing tag of current tag.static booleanmoveReaderToTag(XMLStreamReader reader, BiPredicate<QName, QName> equalsFunc, QName... tags) Moves reader to first occurrence of the structure equivalent of Xpath tags[0]/tags[1]../tags[n].static booleanmoveReaderToTag(XMLStreamReader reader, QName... tags) Moves reader to first occurrence of the structure equivalent of Xpath tags[0]/tags[1]../tags[n].static StringNormalize url
-
Field Details
-
OWS_NS_URL
OWS namespace address- See Also:
-
XLINK_NS_URL
XML xlink namespace address- See Also:
-
QN_OWS_ALLOWED_VALUES
QNames in OWS namespace -
QN_OWS_CONSTRAINT
-
QN_OWS_DCP
-
QN_OWS_GET
-
QN_OWS_HTTP
-
QN_OWS_IDENTIFIER
-
QN_OWS_LOWER_CORNER
-
QN_OWS_OPERATION
-
QN_OWS_OPERATIONS_METADATA
-
QN_OWS_SUPPORTED_CRS
-
QN_OWS_TITLE
-
QN_OWS_UPPER_CORNER
-
QN_OWS_VALUE
-
QN_OWS_WGS84_BOUNDING_BOX
-
-
Constructor Details
-
GetCapabilitiesParseHelper
private GetCapabilitiesParseHelper()
-
-
Method Details
-
getReader
Returns reader with properties set for parsing WM(T)S documents- Parameters:
in- InputStream with pointing to GetCapabilities XML stream- Returns:
- safe XMLStreamReader, that is not validating external entities, nor loads DTD's
- Throws:
XMLStreamException- if any XML stream error occurs
-
moveReaderToEndCurrentTag
Moves the reader to the closing tag of current tag.- Parameters:
reader- XMLStreamReader which should be moved- Throws:
XMLStreamException- when parse exception occurs
-
getElementTextWithSubtags
Returns whole content of the element that reader is pointing at, including other XML elements within (with their tags).- Parameters:
reader- XMLStreamReader that should point to start of element- Returns:
- content of current tag
- Throws:
XMLStreamException- if any XML stream error occurs
-
moveReaderToTag
public static boolean moveReaderToTag(XMLStreamReader reader, QName... tags) throws XMLStreamException Moves reader to first occurrence of the structure equivalent of Xpath tags[0]/tags[1]../tags[n]. If fails to find moves the reader to the closing tag of current tag- Parameters:
tags- array of tagsreader- XMLStreamReader which should be moved- Returns:
- true if tag was found, false otherwise
- Throws:
XMLStreamException- SeeXMLStreamReader
-
moveReaderToTag
public static boolean moveReaderToTag(XMLStreamReader reader, BiPredicate<QName, QName> equalsFunc, QName... tags) throws XMLStreamExceptionMoves reader to first occurrence of the structure equivalent of Xpath tags[0]/tags[1]../tags[n]. If fails to find moves the reader to the closing tag of current tag- Parameters:
tags- array of tagsreader- XMLStreamReader which should be movedequalsFunc- function to check equality of the tags- Returns:
- true if tag was found, false otherwise
- Throws:
XMLStreamException- SeeXMLStreamReader
-
getTransferMode
public static GetCapabilitiesParseHelper.TransferMode getTransferMode(XMLStreamReader reader) throws XMLStreamException Parses Operation[@name='GetTile']/DCP/HTTP/Get section. Returns when reader is on Get closing tag.- Parameters:
reader- StAX reader instance- Returns:
- TransferMode coded in this section
- Throws:
XMLStreamException- SeeXMLStreamReader
-
normalizeCapabilitiesUrl
Normalize url- Parameters:
url- URL- Returns:
- normalized URL
- Throws:
MalformedURLException- in case of malformed URL- Since:
- 10993
-
crsToCode
Convert CRS identifier to plain code- Parameters:
crsIdentifier- CRS identifier- Returns:
- CRS Identifier as it is used within JOSM (without prefix)
- See Also:
-