| |
|
| java.lang.Object com.vividsolutions.jump.io.GMLOutputTemplate
GMLOutputTemplate | public class GMLOutputTemplate (Code) | | This class provides a parser for reading GMLOuputTemplates. This does NOT contain an evaluator for
taking the parsed GMLOutputTemplate and a featureCollection and producing properly
formatted output GML. Thats the
GMLWriter class.
Most people will just use the load() function, but there is support for directly
constructing/modifying one. Your best bet for hand creating one is to make a String that
contains a GMLOutputTemplate then make a java.io.StringReader and passing it to the load()
method.
The valuators (things that look like "<%") are:
<%=GEOMETRY> - replace this with a GML represention of the geometry
<%=COLUMN > - replace this with the corresponding JCS column value
<%FEATURE> - this marks the start of a feature in the OutputTemplate
<%ENDFEATURE> - This marks the end of a feature in the OutputTempalte
Here's an example of how a simple GMLOutputTemplate is parsed by this class:
for input like:
<?xml version='1.0' encoding='UTF-8'?>
<dataset...>
<schemaFeatures>
<gml:featureMember>
<% FEATURE %>
<Feature>
<featureType> <%=COLUMN featureType %> </featureType>
<property fme:name="ID"> <%=COLUMN ID %> </property>
<property fme:name="SITE"> <%=COLUMN SITE %> </property>
<property fme:name="gml2_coordsys"></property>
<gml:pointProperty>
<%=GEOMETRY %>
</gml:pointProperty>
</Feature>
<% ENDFEATURE %>
</gml:featureMember>
</dataFeatures>
</dataset>
headeText =
<?xml version='1.0' encoding='UTF-8'?>
<dataset...>
<schemaFeatures>
<gml:featureMember>
footerText =
</gml:featureMember>
</dataFeatures>
</dataset>
featureText[0] =
<Feature>
<featureType>
codingText[0] = "=COLUMN featureTtype"
featureText[1] =
</property>
<property fme:name="SITE">
codingText[1] = "=COLUMN ID"
|
lineNumber | int lineNumber(Code) | | |
GMLOutputTemplate | public GMLOutputTemplate()(Code) | | constructor*
|
addItem | public void addItem(String header, String coding)(Code) | | for input like :
<feature> <PROPERTY type=name> <%=NAME></property> <PROPERTY type=address> <%=ADDRESS> </property>
use addItem("<feature> <PROPERTY type=name>","=NAME")
addItem("</property> <PROPERTY type=address>", "%=ADDRESS")
|
asString | public String asString()(Code) | | For debugging - return a human readable version of the parsed outputtemplate
|
load | public void load(java.io.Reader r, String readerName) throws Exception(Code) | | Main function - parse a GMLOuputTemplate.
Parameters: r - actual reader to read from Parameters: readerName - name of the stream (for error reporting) |
setFeatureFooter | public void setFeatureFooter(String text)(Code) | | sets the Footer text for the bottom of the feature
|
setFooterText | public void setFooterText(String text)(Code) | | sets the FooterText for the Outputtemplate
|
setHeaderText | public void setHeaderText(String text)(Code) | | sets the HeaderText for the Outputtemplate
|
|
|
|