org.geotools.xsd.Node类的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(12.0k)|赞(0)|评价(0)|浏览(169)

本文整理了Java中org.geotools.xsd.Node类的一些代码示例,展示了Node类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node类的具体详情如下:
包路径:org.geotools.xsd.Node
类名称:Node

Node介绍

[英]Represents a value in the parse tree. A node has a corresponds to a particular instance component of a document (element or attribute). Each node contains a parsed value, as well as a reference to the instance.
[中]表示解析树中的值。节点具有与文档(元素或属性)的特定实例组件相对应的。每个节点都包含一个解析的值,以及对实例的引用。

代码示例

代码示例来源:origin: geotools/geotools

  1. /**
  2. *
  3. * <!-- begin-user-doc -->
  4. * <!-- end-user-doc -->
  5. *
  6. * @generated modifiable
  7. */
  8. public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
  9. // &lt;xsd:element ref="ogc:Simple_Arithmetic"/&gt;
  10. boolean simpleArithmetic =
  11. node.hasChild("Simple_Arithmetic") || node.hasChild("SimpleArithmetic"); // 1.1
  12. // &lt;xsd:element name="Functions" type="ogc:FunctionsType"/&gt;
  13. Functions functions = (Functions) node.getChildValue(Functions.class);
  14. return factory.arithmeticOperators(simpleArithmetic, functions);
  15. }

代码示例来源:origin: geoserver/geoserver

  1. /**
  2. *
  3. * <!-- begin-user-doc -->
  4. *
  5. * @param value an instance of {@link GetCapabilitiesType} (possibly a subclass) if a binding
  6. * for a specific service's GetCapabilities request used {@link Binding#BEFORE} {@link
  7. * #getExecutionMode() execution mode}, and thus relies on this binding to fill the common
  8. * properties. <code>null</code> otherwise.
  9. * <!-- end-user-doc -->
  10. * @generated modifiable
  11. */
  12. public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
  13. GetCapabilitiesType getCapabilities;
  14. if ((value != null) && value instanceof GetCapabilitiesType) {
  15. getCapabilities = (GetCapabilitiesType) value;
  16. } else {
  17. getCapabilities = owsfactory.createGetCapabilitiesType();
  18. }
  19. getCapabilities.setAcceptVersions(
  20. (AcceptVersionsType) node.getChildValue(AcceptVersionsType.class));
  21. getCapabilities.setSections((SectionsType) node.getChildValue(SectionsType.class));
  22. getCapabilities.setAcceptFormats(
  23. (AcceptFormatsType) node.getChildValue(AcceptFormatsType.class));
  24. getCapabilities.setUpdateSequence((String) node.getAttributeValue("updateSequence"));
  25. return getCapabilities;
  26. }
  27. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. *
  3. * <!-- begin-user-doc -->
  4. * <!-- end-user-doc -->
  5. *
  6. * @generated modifiable
  7. */
  8. public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
  9. Expression[] args = new Expression[node.getChildren().size()];
  10. for (int i = 0; i < node.getChildren().size(); i++) {
  11. Node child = (Node) node.getChildren().get(i);
  12. args[i] = (Expression) child.getValue();
  13. }
  14. String name = (String) node.getAttribute("name").getValue();
  15. return factory.function(name, args);
  16. }

代码示例来源:origin: geotools/geotools

  1. PropertyName propertyName = (PropertyName) node.getChildValue(PropertyName.class);
  2. Envelope box = (Envelope) node.getChildValue(Envelope.class);
  3. Node srsNode = node.getChild(Envelope.class).getAttribute("srsName");
  4. String srs = (srsNode != null) ? srsNode.getValue().toString() : null;

代码示例来源:origin: geotools/geotools

  1. RectifiedGridType grid = Gml4wcsFactory.eINSTANCE.createRectifiedGridType();
  2. if (node.hasAttribute("srsName")) {
  3. grid.setSrsName(node.getAttributeValue("srsName").toString());
  4. grid.setDimension((BigInteger) node.getAttribute("dimension").getValue());
  5. GeneralGridEnvelope limitsEnvelope = (GeneralGridEnvelope) node.getChildValue("limits");
  6. (int) limitsEnvelope.getHigh(0), (int) limitsEnvelope.getHigh(1)));
  7. List<Node> axisNames = node.getChildren("axisName");
  8. if (axisNames != null && !axisNames.isEmpty()) {
  9. for (Node axisName : axisNames) {
  10. grid.getAxisName().add(axisName.getValue());

代码示例来源:origin: geotools/geotools

  1. /**
  2. *
  3. * <!-- begin-user-doc -->
  4. * Surprised we actually have something to do: namely collapse multiple fid filters using AND
  5. * <!-- end-user-doc -->
  6. *
  7. * @generated modifiable
  8. */
  9. public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
  10. if (node.hasChild("FeatureId")) {
  11. // round up into a featureId filter
  12. HashSet fids = new HashSet();
  13. fids.addAll(node.getChildValues("FeatureId"));
  14. return factory.id(fids);
  15. }
  16. return node.getChildValue(Filter.class);
  17. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. *
  3. * <!-- begin-user-doc -->
  4. * <!-- end-user-doc -->
  5. *
  6. * @generated modifiable
  7. */
  8. public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
  9. Expression e1 = (Expression) node.getChildValue(0);
  10. Expression e2 = (Expression) node.getChildValue(1);
  11. // &lt;xsd:attribute default="true" name="matchCase" type="xsd:boolean" use="optional"/&gt;
  12. Boolean matchCase = Boolean.TRUE;
  13. if (node.hasAttribute("matchCase")) {
  14. matchCase = (Boolean) node.getAttributeValue("matchCase");
  15. }
  16. return filterfactory.equal(e1, e2, matchCase.booleanValue());
  17. }
  18. }

代码示例来源:origin: geotools/geotools

  1. expressions[1] = (Expression) node.getChildValue("NumericValue");
  2. expressions[0] = filterFactory.literal(node.getChildValue("Pattern"));
  3. if (node.hasChild("NegativePattern")) {
  4. expressions[2] = filterFactory.literal(node.getChildValue("NegativePattern"));
  5. } else {
  6. expressions[2] = filterFactory.literal("-");
  7. if (node.hasAttribute("decimalPoint")) {
  8. expressions[3] = filterFactory.literal(node.getAttributeValue("decimalPoint"));
  9. } else {
  10. expressions[3] = filterFactory.literal(".");
  11. if (node.hasAttribute("groupingSeparator")) {
  12. expressions[4] = filterFactory.literal(node.getAttributeValue("groupingSeparator"));
  13. } else {
  14. expressions[4] = filterFactory.literal(",");

代码示例来源:origin: geotools/geotools

  1. /**
  2. *
  3. * <!-- begin-user-doc -->
  4. * <!-- end-user-doc -->
  5. *
  6. * @generated modifiable
  7. */
  8. public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
  9. UpdateElementType updateElement = wfsfactory.createUpdateElementType();
  10. // &lt;xsd:element maxOccurs="unbounded" ref="wfs:Property"&gt;
  11. updateElement.getProperty().addAll(node.getChildValues(PropertyType.class));
  12. // &lt;xsd:element maxOccurs="1" minOccurs="0" ref="ogc:Filter"&gt;
  13. updateElement.setFilter((Filter) node.getChildValue(Filter.class));
  14. // &lt;xsd:attribute name="handle" type="xsd:string" use="optional"&gt;
  15. if (node.hasAttribute("handle")) {
  16. updateElement.setHandle((String) node.getAttributeValue("handle"));
  17. }
  18. // &lt;xsd:attribute name="typeName" type="xsd:QName" use="required"&gt;
  19. updateElement.setTypeName((QName) node.getAttributeValue("typeName"));
  20. // &lt;xsd:attribute default="x-application/gml:3" name="inputFormat"
  21. // type="xsd:string" use="optional"&gt;
  22. if (node.hasAttribute("inputFormat")) {
  23. updateElement.setInputFormat((String) node.getAttributeValue("inputFormat"));
  24. }
  25. // &lt;xsd:attribute name="srsName" type="xsd:anyURI" use="optional"&gt;
  26. if (node.hasAttribute("srsName")) {
  27. updateElement.setSrsName((URI) node.getAttributeValue("srsName"));
  28. }
  29. return updateElement;
  30. }

代码示例来源:origin: geotools/geotools

  1. public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
  2. ComplexDataType data = factory.createComplexDataType();
  3. if (node.hasAttribute("schema")) {
  4. data.setSchema(node.getAttributeValue("schema").toString());
  5. }
  6. if (node.hasAttribute("mimeType")) {
  7. data.setMimeType(node.getAttributeValue("mimeType").toString());
  8. }
  9. if (node.hasAttribute("encoding")) {
  10. data.setEncoding(node.getAttributeValue("encoding").toString());
  11. }
  12. for (Iterator i = node.getChildren().iterator(); i.hasNext(); ) {
  13. Node c = (Node) i.next();
  14. data.getData().add(c.getValue());
  15. }
  16. return data;
  17. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. *
  3. * <!-- begin-user-doc -->
  4. * <!-- end-user-doc -->
  5. *
  6. * @generated modifiable
  7. */
  8. public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
  9. Expression[] operands = OGCUtils.spatial(node, filterFactory, geometryFactory);
  10. double distance = ((Double) node.getChildValue(Double.class)).doubleValue();
  11. Object units = node.getChild("Distance").getAttributeValue("units");
  12. return filterFactory.beyond(
  13. operands[0], operands[1], distance, units == null ? null : units.toString());
  14. }
  15. }

代码示例来源:origin: geotools/geotools

  1. @SuppressWarnings("unchecked")
  2. private void addDCPTypes(Node node, OperationType operationType) {
  3. List<Node> dcpNodes = node.getChildren(DCPType.class);
  4. for (Node dcpNode : dcpNodes) {
  5. DCPType dcp = (DCPType) dcpNode.getValue();
  6. operationType.getDCP().add(dcp);
  7. }
  8. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. *
  3. * <!-- begin-user-doc -->
  4. * <!-- end-user-doc -->
  5. *
  6. * @generated modifiable
  7. */
  8. public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
  9. return node.getChildValue(SimpleFeature.class);
  10. // TODO: xlink and remoteSchema attributes, hard to do because of streaming
  11. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. *
  3. * <!-- begin-user-doc -->
  4. * <!-- end-user-doc -->
  5. *
  6. * @generated modifiable
  7. */
  8. public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
  9. Envelope envelope = (Envelope) node.getChildValue("envelope");
  10. String body = (String) node.getChildValue("body");
  11. BigInteger id = (BigInteger) node.getAttributeValue("id");
  12. List atts = node.getChildValues("attachment");
  13. Attachment[] attachments = (Attachment[]) atts.toArray(new Attachment[atts.size()]);
  14. return new Mail(id, body, envelope, attachments);
  15. }

代码示例来源:origin: geotools/geotools

  1. /** Helper method for settings properties of an eobject. */
  2. void setProperties(EObject eObject, Node node, boolean lax) {
  3. // reflectivley set the properties of it
  4. for (Iterator c = node.getChildren().iterator(); c.hasNext(); ) {
  5. Node child = (Node) c.next();
  6. String property = child.getComponent().getName();
  7. setProperty(eObject, property, child.getValue(), lax);
  8. }
  9. for (Iterator a = node.getAttributes().iterator(); a.hasNext(); ) {
  10. Node att = (Node) a.next();
  11. String property = att.getComponent().getName();
  12. setProperty(eObject, property, att.getValue(), lax);
  13. }
  14. }

代码示例来源:origin: geoserver/geoserver

  1. /**
  2. *
  3. * <!-- begin-user-doc -->
  4. * <!-- end-user-doc -->
  5. *
  6. * @generated modifiable
  7. */
  8. public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
  9. AcceptFormatsType acceptFormats = owsfactory.createAcceptFormatsType();
  10. acceptFormats.getOutputFormat().addAll(node.getChildValues("OutputFormat"));
  11. return acceptFormats;
  12. }
  13. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. *
  3. * <!-- begin-user-doc -->
  4. * <!-- end-user-doc -->
  5. *
  6. * @generated modifiable
  7. */
  8. public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
  9. LinearRing shell = (LinearRing) node.getChild("outerBoundaryIs").getValue();
  10. List innerRings = node.getChildren("innerBoundaryIs");
  11. LinearRing[] holes = new LinearRing[innerRings.size()];
  12. for (int i = 0; i < innerRings.size(); i++) {
  13. Node inode = (Node) innerRings.get(i);
  14. holes[i] = (LinearRing) inode.getValue();
  15. }
  16. return gFactory.createPolygon(shell, holes);
  17. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. *
  3. * <!-- begin-user-doc -->
  4. * <!-- end-user-doc -->
  5. *
  6. * @generated modifiable
  7. */
  8. public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
  9. List l = node.getChildValues(Symbolizer.class);
  10. Symbolizer[] syms = (Symbolizer[]) l.toArray(new Symbolizer[l.size()]);
  11. FeatureTypeStyle style = sb.createFeatureTypeStyle(syms, 1.0, 1.0);
  12. // if the style has an id, throw it in to the style cache
  13. if (node.hasAttribute("id")) {
  14. String id = (String) node.getAttributeValue("id");
  15. // create a uri with just a fragment
  16. URI uri = new URI("#" + id);
  17. styleMap.put(uri, style);
  18. }
  19. return style;
  20. }
  21. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. *
  3. * <!-- begin-user-doc -->
  4. * <!-- end-user-doc -->
  5. *
  6. * @generated modifiable
  7. */
  8. public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
  9. // &lt;xsd:attribute ref="gml:id" use="required"/&gt;
  10. return filterfactory.gmlObjectId((String) node.getAttributeValue("id"));
  11. }

代码示例来源:origin: geotools/geotools

  1. public String[] getPropertyNames(Object object) {
  2. Node node = (Node) object;
  3. List children = node.getChildren();
  4. if ((children == null) || children.isEmpty()) {
  5. return new String[] {};
  6. }
  7. String[] propertyNames = new String[children.size()];
  8. for (int i = 0; i < children.size(); i++) {
  9. Node child = (Node) children.get(i);
  10. propertyNames[i] = child.getComponent().getName();
  11. }
  12. return propertyNames;
  13. }

相关文章