Node n = root; for (char c: number) { if ((child = n.hasChild(c)) != null) { prefix += c; n = child; } else break; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { //<xsd:element ref="ogc:EID"/> boolean eid = node.hasChild("EID"); //<xsd:element ref="ogc:FID"/> boolean fid = node.hasChild("FID"); return factory.idCapabilities(eid, fid); }
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { ExternalGraphic g = (ExternalGraphic) super.parse(instance, node, value); if (node.hasChild("InlineContent")) { //TODO: implement } return g; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { //<xsd:element ref="ogc:Simple_Arithmetic"/> boolean simpleArithmetic = node.hasChild("Simple_Arithmetic") || node.hasChild("SimpleArithmetic"); //1.1 //<xsd:element name="Functions" type="ogc:FunctionsType"/> Functions functions = (Functions) node.getChildValue(Functions.class); return factory.arithmeticOperators(simpleArithmetic, functions); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Color color = null; if (node.hasChild(Color.class)) { color = (Color) node.getChildValue(Color.class); } else { color = Color.WHITE; } return color; } }
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { FeatureTypeStyle fts = (FeatureTypeStyle) super.parse(instance, node, value); if (node.hasChild("CoverageName")) { QName name = (QName) node.getChildValue("CoverageName"); fts.setFeatureTypeName(name.getPrefix() != null ? name.getPrefix()+":"+name.getLocalPart() : name.getLocalPart()); } return fts; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { //<xsd:element ref="ogc:Logical_Operators"/> boolean logical = node.hasChild("Logical_Operators") || node.hasChild("LogicalOperators"); /* 1.1 */ //<xsd:element name="Comparison_Operators" type="ogc:Comparison_OperatorsType"/> ComparisonOperators comparison = (ComparisonOperators) node.getChildValue(ComparisonOperators.class); //<xsd:element name="Arithmetic_Operators" type="ogc:Arithmetic_OperatorsType"/> ArithmeticOperators arithmetic = (ArithmeticOperators) node.getChildValue(ArithmeticOperators.class); return factory.scalarCapabilities(comparison, arithmetic, logical); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { //<element maxOccurs="unbounded" minOccurs="0" ref="gml:surfaceMember"/> List surfaces = node.getChildValues(Polygon.class); //<element minOccurs="0" ref="gml:surfaceMembers"/> if (node.hasChild(Polygon[].class)) { surfaces.addAll(Arrays.asList((Polygon[])node.getChildValue(Polygon[].class))); } return gf.createMultiPolygon((Polygon[]) surfaces.toArray(new Polygon[surfaces.size()])); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Expression offset = null; if (node.hasChild("PerpendicularOffset")) { offset = (Expression) node.getChildValue("PerpendicularOffset"); } return styleFactory.createLinePlacement(offset); } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { LinearRing outer = (LinearRing) node.getChildValue("outerBoundaryIs"); LinearRing[] inner = null; if (node.hasChild("innerBoundaryIs")) { List l = node.getChildValues("innerBoundaryIs"); inner = (LinearRing[]) l.toArray(new LinearRing[l.size()]); } return geometryFactory.createPolygon(outer, inner); }
@Override public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Graphic g = (Graphic) super.parse(instance, node, value); if (node.hasChild(AnchorPoint.class)) { g.setAnchorPoint((AnchorPoint)node.getChildValue(AnchorPoint.class)); } if (node.hasChild(Displacement.class)) { g.setDisplacement((Displacement)node.getChildValue(Displacement.class)); } return g; } }
public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Graphic g = (Graphic) super.parse(instance, node, value); //<xsd:element minOccurs="0" ref="se:InitialGap"/> if (node.hasChild("InitialGap")) { g.setInitialGap((Expression)node.getChildValue("InitialGap")); } //<xsd:element minOccurs="0" ref="se:Gap"/> if (node.hasChild("Gap")) { g.setGap((Expression)node.getChildValue("Gap")); } return g; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { //TODO: schema allows no exterior ring, but what the heck is that all about ? LinearRing exterior = (LinearRing) node.getChildValue("exterior"); LinearRing[] interior = null; if (node.hasChild("interior")) { List list = node.getChildValues("interior"); interior = (LinearRing[]) list.toArray(new LinearRing[list.size()]); } return gFactory.createPolygon(exterior, interior); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { //TODO: schema allows no exterior ring, but what the heck is that all about ? LinearRing exterior = (LinearRing) node.getChildValue("exterior"); LinearRing[] interior = null; if (node.hasChild("interior")) { List list = node.getChildValues("interior"); interior = (LinearRing[]) list.toArray(new LinearRing[list.size()]); } return gFactory.createPolygon(exterior, interior); }
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { PolygonSymbolizer sym = (PolygonSymbolizer) super.parse(instance, node, value); //<xsd:element minOccurs="0" ref="se:Displacement"/> if (node.hasChild("Displacement")) { sym.setDisplacement((Displacement) node.getChildValue("Displacement")); } //<xsd:element minOccurs="0" ref="se:PerpendicularOffset"/> if (node.hasChild("PerpendicularOffset")) { sym.setPerpendicularOffset((Expression)node.getChildValue("PerpendicularOffset")); } return sym; }
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { LineSymbolizer sym = (LineSymbolizer) super.parse(instance, node, value); //<xsd:element minOccurs="0" ref="se:PerpendicularOffset"/> if (node.hasChild("PerpendicularOffset")) { sym.setPerpendicularOffset((Expression) node.getChildValue("PerpendicularOffset")); } return sym; }
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Rule rule = (Rule) super.parse(instance, node, value); //<xsd:element minOccurs="0" ref="se:Description"/> if (node.hasChild("Description")) { rule.setDescription((Description) node.getChildValue("Description")); } return rule; }
public String inOrderNewick(Node root) throws ItemNotFoundException { if (root.hasChild()) { String output = ""; output += "("; output += inOrderNewick(root.child1); output += ","; output += inOrderNewick(root.child2); output += ")"; return output; } else { return root.getSeq(); } }
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { NamedStyle style = (NamedStyle) super.parse(instance, node, value); if (node.hasChild("Description")) { Description desc = (Description) node.getChildValue("Description"); style.getDescription().setAbstract(desc.getAbstract()); style.getDescription().setTitle(desc.getTitle()); } return style; }
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Style style = (Style) super.parse(instance, node, value); if (node.hasChild("Description")) { Description desc = (Description) node.getChildValue("Description"); style.getDescription().setAbstract(desc.getAbstract()); style.getDescription().setTitle(desc.getTitle()); } //TODO: OnlineResource return style; }