*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value)
throws Exception {
FeatureTypeStyle featureTypeStyle = styleFactory.createFeatureTypeStyle();
//<xsd:element ref="sld:Name" minOccurs="0"/>
if (node.hasChild("Name")) {
featureTypeStyle.setName((String) node.getChildValue("Name"));
}
//<xsd:element ref="sld:Title" minOccurs="0"/>
if (node.hasChild("Title")) {
featureTypeStyle.getDescription().setTitle(
(InternationalString) node.getChildValue("Title"));
}
//<xsd:element ref="sld:Abstract" minOccurs="0"/>
if (node.hasChild("Abstract")) {
featureTypeStyle.getDescription().setAbstract(
(InternationalString) node.getChildValue("Abstract"));
}
//<xsd:element ref="sld:FeatureTypeName" minOccurs="0"/>
if (node.hasChild("FeatureTypeName")) {
//sld 1.0 FTN is a String, in SE 1.1 it is a QName
Object ftn = node.getChildValue("FeatureTypeName");
if (ftn instanceof QName) {
QName qn = (QName)ftn;
ftn = qn.getPrefix() != null && !"".equals(qn.getPrefix().trim()) ?
qn.getPrefix() + ":" + qn.getLocalPart() : qn.getLocalPart();
}
featureTypeStyle.setFeatureTypeName(ftn.toString());
}
//<xsd:element ref="sld:SemanticTypeIdentifier" minOccurs="0" maxOccurs="unbounded"/>
if (node.hasChild("SemanticTypeIdentifier")) {
List ids = node.getChildValues("SemanticTypeIdentifier");
featureTypeStyle.setSemanticTypeIdentifiers((String[]) ids.toArray(
new String[ids.size()]));
}
//<xsd:element ref="sld:Rule" maxOccurs="unbounded"/>
if (node.hasChild("Rule")) {
List rules = node.getChildValues("Rule");
featureTypeStyle.setRules((Rule[]) rules.toArray(new Rule[rules.size()]));
}
return featureTypeStyle;
}