public void visit(FeatureTypeStyle fts) { start("FeatureTypeStyle"); if ((fts.getName() != null) && (fts.getName().length() > 0)) { element("Name", fts.getName()); } if (fts.getDescription() != null && fts.getDescription().getTitle() != null) element("Title", fts.getDescription().getTitle()); if (fts.getDescription() != null && fts.getDescription().getAbstract() != null) element("Abstract", fts.getDescription().getAbstract()); if ((fts.featureTypeNames() != null) && (fts.featureTypeNames().size() > 0)) { element("FeatureTypeName", fts.featureTypeNames().iterator().next().toString()); } if (fts.getTransformation() != null) { element("Transformation", fts.getTransformation()); } String[] sti = fts.getSemanticTypeIdentifiers(); if (sti.length != 1 || !sti[0].equals(SemanticType.ANY.toString())) { for (int i = 0; i < sti.length; i++) { element("SemanticTypeIdentifier", sti[i]); } } Rule[] rules = fts.getRules(); for (int i = 0; i < rules.length; i++) { rules[i].accept(this); } encodeVendorOptions(fts.getOptions()); end("FeatureTypeStyle"); }
public void testStyleDuplication() throws IllegalFilterException { // create a style Style oldStyle = sb.createStyle("FTSName", sf.createPolygonSymbolizer()); oldStyle.getFeatureTypeStyles()[0].setSemanticTypeIdentifiers( new String[] {"simple", "generic:geometry"}); // duplicate it oldStyle.accept(visitor); Style newStyle = (Style) visitor.getCopy(); // compare it assertNotNull(newStyle); assertEquals(2, newStyle.getFeatureTypeStyles()[0].getSemanticTypeIdentifiers().length); }
public void visit(FeatureTypeStyle fts) { FeatureTypeStyle copy = null; Rule[] rules = fts.getRules(); int length=rules.length; Rule[] rulesCopy = new Rule[length]; for (int i = 0; i < length; i++) { if (rules[i] != null) { rules[i].accept(this); rulesCopy[i] = (Rule) pages.pop(); } } copy = sf.createFeatureTypeStyle(); copy.setName(fts.getName()); copy.setTitle(fts.getTitle()); copy.setAbstract(fts.getAbstract()); copy.setFeatureTypeName(fts.getFeatureTypeName()); copy.setRules(rulesCopy); copy.setSemanticTypeIdentifiers((String[]) fts.getSemanticTypeIdentifiers().clone()); pages.push(copy); }
public void visit(FeatureTypeStyle fts) { FeatureTypeStyle copy = null; Rule[] rules = fts.getRules(); int length=rules.length; Rule[] rulesCopy = new Rule[length]; for (int i = 0; i < length; i++) { if (rules[i] != null) { rules[i].accept(this); rulesCopy[i] = (Rule) getPages().pop(); } } copy = sf.createFeatureTypeStyle(); copy.setName(fts.getName()); copy.setTitle(fts.getTitle()); copy.setAbstract(fts.getAbstract()); copy.setFeatureTypeName(fts.getFeatureTypeName()); copy.setRules(rulesCopy); copy.setSemanticTypeIdentifiers((String[]) fts.getSemanticTypeIdentifiers().clone()); getPages().push(copy); }
public void visit(FeatureTypeStyle fts) { start("FeatureTypeStyle"); if ((fts.getName() != null) && (fts.getName().length() > 0)) { element("Name", fts.getName()); } if ((fts.getTitle() != null) && (fts.getTitle().length() > 0)) { element("Title", fts.getTitle()); } if ((fts.getAbstract() != null) && (fts.getAbstract().length() > 0)) { element("Abstract", fts.getAbstract()); } if ((fts.getFeatureTypeName() != null) && (fts.getFeatureTypeName().length() > 0)) { element("FeatureTypeName", fts.getFeatureTypeName()); } String[] sti = fts.getSemanticTypeIdentifiers(); for (int i = 0; i < sti.length; i++) { element("SemanticTypeIdentifier", sti[i]); } Rule[] rules = fts.getRules(); for (int i = 0; i < rules.length; i++) { rules[i].accept(this); } end("FeatureTypeStyle"); }
String[] sti = fts.getSemanticTypeIdentifiers();