Package com.luciad.ogc.sld.xml
Class TLcdSLDFeatureTypeStyleEncoder
java.lang.Object
com.luciad.ogc.sld.xml.TLcdSLDFeatureTypeStyleEncoder
- All Implemented Interfaces:
ILcdOutputStreamFactoryCapable
public class TLcdSLDFeatureTypeStyleEncoder
extends Object
implements ILcdOutputStreamFactoryCapable
XML Encoder for
TLcdSLDFeatureTypeStyle
objects to documents
according to version 1.1.0 of the OGC Symbology Encoding Implementation
Specification or version 1.0 of the OGC Styled Layer Descriptor
Implementation Specification.
Note that the files produced do not contain SLD top elements.- Since:
- 6.1
-
Constructor Summary
ConstructorDescriptionCreates a newTLcdSLDFeatureTypeStyleEncoder
with a default file output stream factory. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
encodeFeatureTypeStyle
(TLcdSLDFeatureTypeStyle aFeatureTypeStyle, OutputStream aOutputStream) Encodes the given feature type style to the given output stream.void
encodeFeatureTypeStyle
(TLcdSLDFeatureTypeStyle aFeatureTypeStyle, String aSourceName) Encodes the given feature type style to the given destination.static String
encodeToString
(TLcdSLDFeatureTypeStyle aSLDFeatureTypeStyle) Utility method which encodes the SLD feature type style as an XML string.Returns the output stream factory that is currently used for creating output streams given source names.void
setOutputStreamFactory
(ILcdOutputStreamFactory aOutputStreamFactory) Sets the output stream factory that will be used for creating output streams given source names.
-
Constructor Details
-
TLcdSLDFeatureTypeStyleEncoder
public TLcdSLDFeatureTypeStyleEncoder()Creates a newTLcdSLDFeatureTypeStyleEncoder
with a default file output stream factory.
-
-
Method Details
-
setOutputStreamFactory
Sets the output stream factory that will be used for creating output streams given source names.- Specified by:
setOutputStreamFactory
in interfaceILcdOutputStreamFactoryCapable
- Parameters:
aOutputStreamFactory
- the output stream factory to be used.
-
getOutputStreamFactory
Returns the output stream factory that is currently used for creating output streams given source names.- Specified by:
getOutputStreamFactory
in interfaceILcdOutputStreamFactoryCapable
- Returns:
- the input stream factory that is currently used.
-
encodeFeatureTypeStyle
public void encodeFeatureTypeStyle(TLcdSLDFeatureTypeStyle aFeatureTypeStyle, String aSourceName) throws IOException Encodes the given feature type style to the given destination. The version of theTLcdSLDFeatureTypeStyle
is used to determine the encoding format, which can be Styled Layer Descriptor 1.0.0 or Symbology Encoding 1.1.0. No version corresponds to an 1.0.0 SLD. Properties of the style that are not supported by the version will be omitted from the generated XML.- Parameters:
aFeatureTypeStyle
- the given feature type style.aSourceName
- the full path to the source where the object should be written.- Throws:
IOException
- thrown if an error occurs during the write process.- See Also:
-
encodeFeatureTypeStyle
public final void encodeFeatureTypeStyle(TLcdSLDFeatureTypeStyle aFeatureTypeStyle, OutputStream aOutputStream) throws IOException Encodes the given feature type style to the given output stream. The version of theTLcdSLDFeatureTypeStyle
is used to determine the encoding format, which can be Styled Layer Descriptor 1.0.0 or Symbology Encoding 1.1.0. No version corresponds to an 1.0.0 SLD. Properties of the style that are not supported by the version will be omitted from the generated XML.- Parameters:
aFeatureTypeStyle
- the given feature type style.aOutputStream
- The stream to write the output to- Throws:
IOException
- thrown if an error occurs during the write process.- Since:
- 2017.0
- See Also:
-
encodeToString
public static String encodeToString(TLcdSLDFeatureTypeStyle aSLDFeatureTypeStyle) throws IOException Utility method which encodes the SLD feature type style as an XML string.- Parameters:
aSLDFeatureTypeStyle
- The SLD feature type style- Returns:
- An XML-encoded version of
aSLDFeatureTypeStyle
- Throws:
IOException
- When something goes wrong during the encoding- Since:
- 2017.0
-