public class SLDParser extends Object
Modifier and Type | Field and Description |
---|---|
protected StyleFactory |
factory |
protected InputSource |
source |
Constructor and Description |
---|
SLDParser(StyleFactory factory)
Create a Stylereader - use if you already have a dom to parse.
|
SLDParser(StyleFactory factory,
File f)
Creates a new SLDStyle object.
|
SLDParser(StyleFactory factory,
FilterFactory filterFactory) |
SLDParser(StyleFactory factory,
InputStream s)
Creates a new SLDStyle object.
|
SLDParser(StyleFactory factory,
Reader r)
Creates a new SLDStyle object.
|
SLDParser(StyleFactory factory,
String filename)
Creates a new instance of SLDStyler
|
SLDParser(StyleFactory factory,
URL url)
Creates a new SLDStyle object.
|
Modifier and Type | Method and Description |
---|---|
protected DocumentBuilder |
newDocumentBuilder(boolean namespaceAware) |
protected AnchorPoint |
parseAnchorPoint(Node root)
Internal method to parse an AnchorPoint node; protected visibility for testing.
|
protected ChannelSelection |
parseChannelSelection(Node root)
Internal parse method - made protected for unit testing
|
protected ColorMap |
parseColorMap(Node root)
Internal parse method - made protected for unit testing
|
protected ColorMapEntry |
parseColorMapEntry(Node root)
Internal parse method - made protected for unit testing
|
protected ContrastEnhancement |
parseContrastEnhancement(Node root)
Internal parse method - made protected for unit testing
|
StyledLayerDescriptor |
parseDescriptor(Node root) |
protected Displacement |
parseDisplacement(Node root)
Internal parse method - made protected for unit testing
|
protected ExternalGraphic |
parseExternalGraphic(Node root)
Internal parse method - made protected for unit testing
|
protected FeatureTypeConstraint |
parseFeatureTypeConstraint(Node root) |
protected FeatureTypeStyle |
parseFeatureTypeStyle(Node style)
Internal parse method - made protected for unit testing
|
protected Fill |
parseFill(Node root)
Internal parse method - made protected for unit testing
|
protected Filter |
parseFilter(Node child)
Internal parse method - made protected for unit testing
|
protected Font |
parseFont(Node root)
Internal method to parse a Font Node; protected to allow for unit testing
|
protected Expression |
parseGeometry(Node root)
Internal parse method - made protected for unit testing
|
protected String |
parseGeometryName(Node root)
Internal parse method - made protected for unit testing
|
protected Graphic |
parseGraphic(Node root)
Internal parse method - made protected for unit testing
|
protected Halo |
parseHalo(Node root)
Internal parse method - made protected for unit testing
|
protected LabelPlacement |
parseLabelPlacement(Node root)
Internal parse method - made protected for unit testing
|
protected LinePlacement |
parseLinePlacement(Node root)
Internal parse method - made protected for unit testing
|
protected LineSymbolizer |
parseLineSymbolizer(Node root)
parses the SLD for a linesymbolizer
|
protected Mark |
parseMark(Node root)
Internal parse method - made protected for unit testing
|
NamedStyle |
parseNamedStyle(Node n)
Parses a NamedStyle from node.
|
protected String |
parseOnlineResource(Node root)
Internal parse method - made protected for unit testing
|
protected OtherText |
parseOtherText(Node root) |
protected PointPlacement |
parsePointPlacement(Node root)
Internal parse method - made protected for unit testing
|
protected PointSymbolizer |
parsePointSymbolizer(Node root)
parses the SLD for a point symbolizer
|
protected PolygonSymbolizer |
parsePolygonSymbolizer(Node root)
parses the SLD for a polygonsymbolizer
|
protected RasterSymbolizer |
parseRasterSymbolizer(Node root)
parses the SLD for a text symbolizer
|
protected RemoteOWS |
parseRemoteOWS(Node root) |
protected Rule |
parseRule(Node ruleNode)
Internal parse method - made protected for unit testing
|
protected SelectedChannelType |
parseSelectedChannel(Node root)
Internal parse method - made protected for unit testing
|
protected ShadedRelief |
parseShadedRelief(Node root)
Internal parse method - made protected for unit testing
|
StyledLayerDescriptor |
parseSLD() |
protected Stroke |
parseStroke(Node root)
Internal parse method - made protected for unit testing
|
Style |
parseStyle(Node n)
build a style for the Node provided
|
protected TextSymbolizer |
parseTextSymbolizer(Node root)
parses the SLD for a text symbolizer
|
Style[] |
readDOM()
Read styles from the dom that was previously parsed.
|
Style[] |
readDOM(Document document)
Read the DOM provided and create a Style object for each user style found
|
Style[] |
readXML()
Read the xml inputsource provided and create a Style object for each user style found
|
void |
setEntityResolver(EntityResolver entityResolver)
Sets the EntityResolver implementation that will be used by DocumentBuilder to resolve XML
external entities.
|
void |
setInput(File f)
Sets the file to use to read the SLD from
|
void |
setInput(InputStream in)
Sets the input stream to read the SLD from
|
void |
setInput(Reader in)
Sets the input stream to read the SLD from
|
void |
setInput(String filename)
set the file to read the SLD from
|
void |
setInput(URL url)
sets an URL to read the SLD from
|
void |
setOnLineResourceLocator(ResourceLocator onlineResourceLocator)
Sets the resource loader implementation for parsing online resources.
|
protected InputSource source
protected StyleFactory factory
public SLDParser(StyleFactory factory)
factory
- The StyleFactory to use to build the stylepublic SLDParser(StyleFactory factory, FilterFactory filterFactory)
public SLDParser(StyleFactory factory, String filename) throws FileNotFoundException
factory
- The StyleFactory to use to read the filefilename
- The file to be read.FileNotFoundException
- - if the file is missingpublic SLDParser(StyleFactory factory, File f) throws FileNotFoundException
factory
- The StyleFactory to use to read the filef
- the File to be readFileNotFoundException
- - if the file is missingpublic SLDParser(StyleFactory factory, URL url) throws IOException
factory
- The StyleFactory to use to read the fileurl
- the URL to be read.IOException
- - if something goes wrong reading the filepublic SLDParser(StyleFactory factory, InputStream s)
factory
- The StyleFactory to use to read the files
- The inputstream to be readpublic SLDParser(StyleFactory factory, Reader r)
factory
- The StyleFactory to use to read the filer
- The inputstream to be readpublic void setInput(String filename) throws FileNotFoundException
filename
- the file to read the SLD fromFileNotFoundException
- if the file is missingpublic void setInput(File f) throws FileNotFoundException
f
- the file to useFileNotFoundException
- if the file is missingpublic void setInput(URL url) throws IOException
url
- the url to read the SLD fromIOException
- If anything goes wrong opening the urlpublic void setInput(InputStream in)
in
- the inputstream used to read the SLD frompublic void setInput(Reader in)
in
- the inputstream used to read the SLD frompublic void setOnLineResourceLocator(ResourceLocator onlineResourceLocator)
public void setEntityResolver(EntityResolver entityResolver)
entityResolver
- protected DocumentBuilder newDocumentBuilder(boolean namespaceAware) throws ParserConfigurationException
ParserConfigurationException
public Style[] readXML()
RuntimeException
- if a parsing error occurspublic Style[] readDOM()
public Style[] readDOM(Document document)
document
- a dom containing the SLDpublic StyledLayerDescriptor parseSLD()
public StyledLayerDescriptor parseDescriptor(Node root)
protected FeatureTypeConstraint parseFeatureTypeConstraint(Node root)
public NamedStyle parseNamedStyle(Node n)
A NamedStyle is used to refer to a style that has a name in a WMS, and is defined as:
<code> <xsd:element name="NamedStyle"> <xsd:annotation> <xsd:documentation> A NamedStyle is used to refer to a style that has a name in a WMS. </xsd:documentation> </xsd:annotation> <xsd:complexType> <xsd:sequence> <xsd:element ref="sld:Name"/> </xsd:sequence> </xsd:complexType> </xsd:element> </code>
n
- public Style parseStyle(Node n)
n
- the node which contains the style to be parsed.RuntimeException
- if an error occurs setting up the parserprotected FeatureTypeStyle parseFeatureTypeStyle(Node style)
protected Rule parseRule(Node ruleNode)
protected Filter parseFilter(Node child)
protected LineSymbolizer parseLineSymbolizer(Node root)
root
- a w2c Dom Nodeprotected PolygonSymbolizer parsePolygonSymbolizer(Node root)
root
- w3c dom nodeprotected TextSymbolizer parseTextSymbolizer(Node root)
root
- w3c dom nodeprotected RasterSymbolizer parseRasterSymbolizer(Node root)
root
- w3c dom nodeprotected ColorMapEntry parseColorMapEntry(Node root)
protected ColorMap parseColorMap(Node root)
protected SelectedChannelType parseSelectedChannel(Node root)
protected ChannelSelection parseChannelSelection(Node root)
protected ContrastEnhancement parseContrastEnhancement(Node root)
protected ShadedRelief parseShadedRelief(Node root)
protected PointSymbolizer parsePointSymbolizer(Node root)
root
- a w3c dom nodeprotected Graphic parseGraphic(Node root)
protected String parseGeometryName(Node root)
protected Expression parseGeometry(Node root)
protected Mark parseMark(Node root)
protected ExternalGraphic parseExternalGraphic(Node root)
protected String parseOnlineResource(Node root)
protected Stroke parseStroke(Node root)
protected Fill parseFill(Node root)
protected Font parseFont(Node root)
protected LabelPlacement parseLabelPlacement(Node root)
protected PointPlacement parsePointPlacement(Node root)
protected LinePlacement parseLinePlacement(Node root)
protected AnchorPoint parseAnchorPoint(Node root)
root
- protected Displacement parseDisplacement(Node root)
Copyright © 1996–2019 Geotools. All rights reserved.