org.deegree_impl.graphics.sld
Class SLDFactory

java.lang.Object
  extended byorg.deegree_impl.graphics.sld.SLDFactory

public class SLDFactory
extends java.lang.Object

Factory class for all mapped SLD-elements.

TODO: Default values for omitted elements (such as fill color) should better not be used in the construction of the corresponding objects (Fill), but marked as left out (to make it possible to differentiate between explicitly given values and default values).

Version:
$Revision: 1.35 $ $Date: 2004/04/07 06:43:48 $
Author:
Andreas Poth, Markus Schneider

Field Summary
private static java.lang.String ogcNS
           
private static java.lang.String xlnNS
           
 
Constructor Summary
SLDFactory()
           
 
Method Summary
private static CssParameter createCssParameter(org.w3c.dom.Element element)
          Creates a CssParameter-instance according to the contents of the DOM-subtree starting at the given 'CssParameter'-Element.
private static Extent createExtent(org.w3c.dom.Element element)
          Creates an Extent-instance according to the contents of the DOM-subtree starting at the given 'Extent'-Element.
private static ExternalGraphic createExternalGraphic(org.w3c.dom.Element element)
          Creates an ExternalGraphic-instance according to the contents of the DOM-subtree starting at the given 'ExternalGraphic'-Element.
private static FeatureTypeConstraint createFeatureTypeConstraint(org.w3c.dom.Element element)
          Creates a FeatureTypeConstraint-instance according to the contents of the DOM-subtree starting at the given 'FeatureTypeConstraint'-Element.
static FeatureTypeStyle createFeatureTypeStyle(org.w3c.dom.Element element)
          Creates a FeatureTypeStyle-instance according to the contents of the DOM-subtree starting at the given 'FeatureTypeStyle'-Element.
private static Fill createFill(org.w3c.dom.Element element)
          Creates a Fill-instance according to the contents of the DOM-subtree starting at the given 'Fill'-Element.
private static Font createFont(org.w3c.dom.Element element)
          Creates a Font-instance according to the contents of the DOM-subtree starting at the given 'Font'-Element.
private static Geometry createGeometry(org.w3c.dom.Element element)
          Creates a Geometry-instance according to the contents of the DOM-subtree starting at the given 'Geometry'-Element.
private static Graphic createGraphic(org.w3c.dom.Element element)
          Creates a Graphic-instance according to the contents of the DOM-subtree starting at the given 'Graphic'-element.
private static GraphicFill createGraphicFill(org.w3c.dom.Element element)
          Creates a GraphicFill-instance according to the contents of the DOM-subtree starting at the given 'GraphicFill'-Element.
private static GraphicStroke createGraphicStroke(org.w3c.dom.Element element)
          Creates a GraphicStroke-instance according to the contents of the DOM-subtree starting at the given 'GraphicStroke'-Element.
private static Halo createHalo(org.w3c.dom.Element element)
          Creates a Halo-instance according to the contents of the DOM-subtree starting at the given 'Halo'-Element.
private static LabelPlacement createLabelPlacement(org.w3c.dom.Element element)
          Creates a LabelPlacement-instance according to the contents of the DOM-subtree starting at the given 'LabelPlacement'-Element.
static LayerFeatureConstraints createLayerFeatureConstraints(org.w3c.dom.Element element)
          Creates a LayerFeatureConstraints-instance according to the contents of the DOM-subtree starting at the given 'LayerFeatureConstraints'-Element.
private static LegendGraphic createLegendGraphic(org.w3c.dom.Element element)
          Creates a LegendGraphic-instance according to the contents of the DOM-subtree starting at the given 'LegendGraphic'-element.
private static LinePlacement createLinePlacement(org.w3c.dom.Element element)
          Creates a LinePlacement-instance according to the contents of the DOM-subtree starting at the given 'LinePlacement'-Element.
private static LineSymbolizer createLineSymbolizer(org.w3c.dom.Element element, double min, double max)
          Creates a LineSymbolizer-instance according to the contents of the DOM-subtree starting at the given 'LineSymbolizer'-Element.
private static Mark createMark(org.w3c.dom.Element element)
          Creates a Mark-instance according to the contents of the DOM-subtree starting at the given 'Mark'-Element.
private static NamedLayer createNamedLayer(org.w3c.dom.Element element)
          Creates a NamedLayer-instance according to the contents of the DOM-subtree starting at the given 'UserLayer'-Element.
static NamedLayer createNamedLayer(java.lang.String name, LayerFeatureConstraints layerFeatureConstraints, Style[] styles)
           
private static NamedStyle createNamedStyle(org.w3c.dom.Element element)
          Creates a NamedStyle-instance according to the contents of the DOM-subtree starting at the given 'NamedStyle'-Element.
static NamedStyle createNamedStyle(java.lang.String name)
           
private static ParameterValueType createParameterValueType(org.w3c.dom.Element element)
          Creates a ParameterValueType-instance according to the contents of the DOM-subtree starting at the given Element.
private static PointPlacement createPointPlacement(org.w3c.dom.Element element)
          Creates a PointPlacement-instance according to the contents of the DOM-subtree starting at the given 'PointPlacement'-Element.
private static PointSymbolizer createPointSymbolizer(org.w3c.dom.Element element, double min, double max)
          Creates a PointSymbolizer-instance according to the contents of the DOM-subtree starting at the given 'PointSymbolizer'-Element.
private static PolygonSymbolizer createPolygonSymbolizer(org.w3c.dom.Element element, double min, double max)
          Creates a PolygonSymbolizer-instance according to the contents of the DOM-subtree starting at the given 'PolygonSymbolizer'-Element.
private static RasterSymbolizer createRasterSymbolizer(org.w3c.dom.Element element, double min, double max)
           
private static RemoteOWS createRemoteOWS(org.w3c.dom.Element element)
          Creates a RemoteOWS-instance according to the contents of the DOM-subtree starting at the given 'RemoteOWS'-Element.
private static Rule createRule(org.w3c.dom.Element element)
          Creates a Rule-instance according to the contents of the DOM-subtree starting at the given 'Rule'-Element.
static StyledLayerDescriptor createSLD(java.io.Reader reader)
          Creates a StyledLayerDescriptor-instance from the given Reader.
static StyledLayerDescriptor createSLD(java.lang.String s)
          Creates a StyledLayerDescriptor-instance from the given XML-representation.
private static Stroke createStroke(org.w3c.dom.Element element)
          Creates a Stroke-instance according to the contents of the DOM-subtree starting at the given 'Stroke'-Element.
static StyledLayerDescriptor createStyledLayerDescriptor(org.w3c.dom.Element element)
          Creates a StyledLayerDescriptor-instance according to the contents of the DOM-subtree starting at the given 'StyledLayerDescriptor'-Element.
private static TextSymbolizer createTextSymbolizer(org.w3c.dom.Element element, double min, double max)
          Creates a TextSymbolizer-instance according to the contents of the DOM-subtree starting at the given 'TextSymbolizer'-Element.
private static UserLayer createUserLayer(org.w3c.dom.Element element)
          Creates a UserLayer-instance according to the contents of the DOM-subtree starting at the given 'UserLayer'-Element.
private static UserStyle createUserStyle(org.w3c.dom.Element element)
          Creates a UserStyle-instance according to the contents of the DOM-subtree starting at the given 'UserStyle'-Element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ogcNS

private static java.lang.String ogcNS

xlnNS

private static java.lang.String xlnNS
Constructor Detail

SLDFactory

public SLDFactory()
Method Detail

createSLD

public static StyledLayerDescriptor createSLD(java.lang.String s)
                                       throws XMLParsingException
Creates a StyledLayerDescriptor-instance from the given XML-representation.

Parameters:
s - contains the XML document
Returns:
the constructed StyledLayerDescriptor-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the XML document is encountered

createSLD

public static StyledLayerDescriptor createSLD(java.io.Reader reader)
                                       throws XMLParsingException
Creates a StyledLayerDescriptor-instance from the given Reader.

Parameters:
reader - provides the XML document
Returns:
the constructed StyledLayerDescriptor-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the XML document is encountered

createRasterSymbolizer

private static RasterSymbolizer createRasterSymbolizer(org.w3c.dom.Element element,
                                                       double min,
                                                       double max)
Parameters:
element -
Returns:

createTextSymbolizer

private static TextSymbolizer createTextSymbolizer(org.w3c.dom.Element element,
                                                   double min,
                                                   double max)
                                            throws XMLParsingException
Creates a TextSymbolizer-instance according to the contents of the DOM-subtree starting at the given 'TextSymbolizer'-Element.

Parameters:
element - the 'TextSymbolizer'-Element
min - scale-constraint to be used
max - scale-constraint to be used
Returns:
the constructed TextSymbolizer-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createHalo

private static Halo createHalo(org.w3c.dom.Element element)
                        throws XMLParsingException
Creates a Halo-instance according to the contents of the DOM-subtree starting at the given 'Halo'-Element.

Parameters:
element - the 'Halo'-Element
Returns:
the constructed Halo-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createLabelPlacement

private static LabelPlacement createLabelPlacement(org.w3c.dom.Element element)
                                            throws XMLParsingException
Creates a LabelPlacement-instance according to the contents of the DOM-subtree starting at the given 'LabelPlacement'-Element.

Parameters:
element - the 'LabelPlacement'-Element
Returns:
the constructed LabelPlacement-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createPointPlacement

private static PointPlacement createPointPlacement(org.w3c.dom.Element element)
                                            throws XMLParsingException
Creates a PointPlacement-instance according to the contents of the DOM-subtree starting at the given 'PointPlacement'-Element.

Parameters:
element - the 'PointPlacement'-Element
Returns:
the constructed PointPlacement-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createLinePlacement

private static LinePlacement createLinePlacement(org.w3c.dom.Element element)
                                          throws XMLParsingException
Creates a LinePlacement-instance according to the contents of the DOM-subtree starting at the given 'LinePlacement'-Element.

Parameters:
element - the 'LinePlacement'-Element
Returns:
the constructed LinePlacement-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createFont

private static Font createFont(org.w3c.dom.Element element)
                        throws XMLParsingException
Creates a Font-instance according to the contents of the DOM-subtree starting at the given 'Font'-Element.

Parameters:
element - the 'Font'-Element
Returns:
the constructed Font-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createParameterValueType

private static ParameterValueType createParameterValueType(org.w3c.dom.Element element)
                                                    throws XMLParsingException
Creates a ParameterValueType-instance according to the contents of the DOM-subtree starting at the given Element.

Parameters:
element - the Element (must be of the type sld:ParameterValueType)
Returns:
the constructed ParameterValueType-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createStyledLayerDescriptor

public static StyledLayerDescriptor createStyledLayerDescriptor(org.w3c.dom.Element element)
                                                         throws XMLParsingException
Creates a StyledLayerDescriptor-instance according to the contents of the DOM-subtree starting at the given 'StyledLayerDescriptor'-Element.

Parameters:
element - the 'StyledLayerDescriptor'-Element
Returns:
the constructed StyledLayerDescriptor-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createNamedStyle

private static NamedStyle createNamedStyle(org.w3c.dom.Element element)
                                    throws XMLParsingException
Creates a NamedStyle-instance according to the contents of the DOM-subtree starting at the given 'NamedStyle'-Element.

Parameters:
element - the 'NamedStyle'-Element
Returns:
the constructed NamedStyle-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createNamedStyle

public static NamedStyle createNamedStyle(java.lang.String name)
                                   throws XMLParsingException
Throws:
XMLParsingException

createRemoteOWS

private static RemoteOWS createRemoteOWS(org.w3c.dom.Element element)
                                  throws XMLParsingException
Creates a RemoteOWS-instance according to the contents of the DOM-subtree starting at the given 'RemoteOWS'-Element.

Parameters:
element - the 'RemoteOWS'-Element
Returns:
the constructed RemoteOWS-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createNamedLayer

private static NamedLayer createNamedLayer(org.w3c.dom.Element element)
                                    throws XMLParsingException
Creates a NamedLayer-instance according to the contents of the DOM-subtree starting at the given 'UserLayer'-Element.

Parameters:
element - the 'NamedLayer'-Element
Returns:
the constructed NamedLayer-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createNamedLayer

public static NamedLayer createNamedLayer(java.lang.String name,
                                          LayerFeatureConstraints layerFeatureConstraints,
                                          Style[] styles)
                                   throws XMLParsingException
Throws:
XMLParsingException

createUserLayer

private static UserLayer createUserLayer(org.w3c.dom.Element element)
                                  throws XMLParsingException
Creates a UserLayer-instance according to the contents of the DOM-subtree starting at the given 'UserLayer'-Element.

Parameters:
element - the 'UserLayer'-Element
Returns:
the constructed UserLayer-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createFeatureTypeConstraint

private static FeatureTypeConstraint createFeatureTypeConstraint(org.w3c.dom.Element element)
                                                          throws XMLParsingException
Creates a FeatureTypeConstraint-instance according to the contents of the DOM-subtree starting at the given 'FeatureTypeConstraint'-Element.

Parameters:
element - the 'FeatureTypeConstraint'-Element
Returns:
the constructed FeatureTypeConstraint-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createExtent

private static Extent createExtent(org.w3c.dom.Element element)
                            throws XMLParsingException
Creates an Extent-instance according to the contents of the DOM-subtree starting at the given 'Extent'-Element.

Parameters:
element - the 'Extent'-Element
Returns:
the constructed Extent-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createLayerFeatureConstraints

public static LayerFeatureConstraints createLayerFeatureConstraints(org.w3c.dom.Element element)
                                                             throws XMLParsingException
Creates a LayerFeatureConstraints-instance according to the contents of the DOM-subtree starting at the given 'LayerFeatureConstraints'-Element.

Parameters:
element - the 'LayerFeatureConstraints'-Element
Returns:
the constructed LayerFeatureConstraints-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createUserStyle

private static UserStyle createUserStyle(org.w3c.dom.Element element)
                                  throws XMLParsingException
Creates a UserStyle-instance according to the contents of the DOM-subtree starting at the given 'UserStyle'-Element.

Parameters:
element - the 'UserStyle'-Element
Returns:
the constructed UserStyle-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createFeatureTypeStyle

public static FeatureTypeStyle createFeatureTypeStyle(org.w3c.dom.Element element)
                                               throws XMLParsingException
Creates a FeatureTypeStyle-instance according to the contents of the DOM-subtree starting at the given 'FeatureTypeStyle'-Element.

TODO: The ElseFilter currently does not work correctly with FeatureFilters.

Parameters:
element - the 'FeatureTypeStyle'-Element
Returns:
the constructed FeatureTypeStyle-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createRule

private static Rule createRule(org.w3c.dom.Element element)
                        throws XMLParsingException
Creates a Rule-instance according to the contents of the DOM-subtree starting at the given 'Rule'-Element.

Parameters:
element - the 'Rule'-Element
Returns:
the constructed Rule-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createPointSymbolizer

private static PointSymbolizer createPointSymbolizer(org.w3c.dom.Element element,
                                                     double min,
                                                     double max)
                                              throws XMLParsingException
Creates a PointSymbolizer-instance according to the contents of the DOM-subtree starting at the given 'PointSymbolizer'-Element.

Parameters:
element - the 'PointSymbolizer'-Element
min - scale-constraint to be used
max - scale-constraint to be used
Returns:
the constructed PointSymbolizer-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createLineSymbolizer

private static LineSymbolizer createLineSymbolizer(org.w3c.dom.Element element,
                                                   double min,
                                                   double max)
                                            throws XMLParsingException
Creates a LineSymbolizer-instance according to the contents of the DOM-subtree starting at the given 'LineSymbolizer'-Element.

Parameters:
element - the 'LineSymbolizer'-Element
min - scale-constraint to be used
max - scale-constraint to be used
Returns:
the constructed LineSymbolizer-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createPolygonSymbolizer

private static PolygonSymbolizer createPolygonSymbolizer(org.w3c.dom.Element element,
                                                         double min,
                                                         double max)
                                                  throws XMLParsingException
Creates a PolygonSymbolizer-instance according to the contents of the DOM-subtree starting at the given 'PolygonSymbolizer'-Element.

Parameters:
element - the 'PolygonSymbolizer'-Element
min - scale-constraint to be used
max - scale-constraint to be used
Returns:
the constructed PolygonSymbolizer-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createGeometry

private static Geometry createGeometry(org.w3c.dom.Element element)
                                throws XMLParsingException
Creates a Geometry-instance according to the contents of the DOM-subtree starting at the given 'Geometry'-Element.

FIXME: Add support for 'Function'-Elements.

Parameters:
element - the 'Geometry'-Element
Returns:
the constructed Geometry-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createFill

private static Fill createFill(org.w3c.dom.Element element)
                        throws XMLParsingException
Creates a Fill-instance according to the contents of the DOM-subtree starting at the given 'Fill'-Element.

Parameters:
element - the 'Fill'-Element
Returns:
the constructed Fill-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createLegendGraphic

private static LegendGraphic createLegendGraphic(org.w3c.dom.Element element)
                                          throws XMLParsingException
Creates a LegendGraphic-instance according to the contents of the DOM-subtree starting at the given 'LegendGraphic'-element.

Parameters:
element - the 'LegendGraphic'-Element
Returns:
the constructed Graphic-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createExternalGraphic

private static ExternalGraphic createExternalGraphic(org.w3c.dom.Element element)
                                              throws XMLParsingException
Creates an ExternalGraphic-instance according to the contents of the DOM-subtree starting at the given 'ExternalGraphic'-Element.

Parameters:
element - the 'ExternalGraphic'-Element
Returns:
the constructed ExternalGraphic-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createMark

private static Mark createMark(org.w3c.dom.Element element)
                        throws XMLParsingException
Creates a Mark-instance according to the contents of the DOM-subtree starting at the given 'Mark'-Element.

Parameters:
element - the 'Mark'-Element
Returns:
the constructed Mark-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createStroke

private static Stroke createStroke(org.w3c.dom.Element element)
                            throws XMLParsingException
Creates a Stroke-instance according to the contents of the DOM-subtree starting at the given 'Stroke'-Element.

Parameters:
element - the 'Stroke'-Element
Returns:
the constructed Stroke-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createGraphicFill

private static GraphicFill createGraphicFill(org.w3c.dom.Element element)
                                      throws XMLParsingException
Creates a GraphicFill-instance according to the contents of the DOM-subtree starting at the given 'GraphicFill'-Element.

Parameters:
element - the 'GraphicFill'-Element
Returns:
the constructed GraphicFill-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createGraphicStroke

private static GraphicStroke createGraphicStroke(org.w3c.dom.Element element)
                                          throws XMLParsingException
Creates a GraphicStroke-instance according to the contents of the DOM-subtree starting at the given 'GraphicStroke'-Element.

Parameters:
element - the 'GraphicStroke'-Element
Returns:
the constructed GraphicStroke-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createGraphic

private static Graphic createGraphic(org.w3c.dom.Element element)
                              throws XMLParsingException
Creates a Graphic-instance according to the contents of the DOM-subtree starting at the given 'Graphic'-element.

Parameters:
element - the 'Graphic'-Element
Returns:
the constructed Graphic-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createCssParameter

private static CssParameter createCssParameter(org.w3c.dom.Element element)
                                        throws XMLParsingException
Creates a CssParameter-instance according to the contents of the DOM-subtree starting at the given 'CssParameter'-Element.

Parameters:
element - the 'CssParamter'-Element
Returns:
the constructed CssParameter-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered