org.geotools.xsd.Node.getComponent()方法的使用及代码示例

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

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

Node.getComponent介绍

暂无

代码示例

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

  1. public boolean hasAttribute(String name) {
  2. if (name == null) {
  3. return false;
  4. }
  5. for (Iterator itr = attributes.iterator(); itr.hasNext(); ) {
  6. Node att = (Node) itr.next();
  7. if (name.equals(att.getComponent().getName())) {
  8. return true;
  9. }
  10. }
  11. return false;
  12. }

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

  1. public boolean hasChild(String name) {
  2. if (name == null) {
  3. return false;
  4. }
  5. for (int i = 0; i < children.size(); i++) {
  6. Node child = (Node) children.get(i);
  7. if (name.equals(child.getComponent().getName())) {
  8. return true;
  9. }
  10. }
  11. return false;
  12. }

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

  1. public Node getAttribute(String name) {
  2. if (name == null) {
  3. return null;
  4. }
  5. for (Iterator itr = attributes.iterator(); itr.hasNext(); ) {
  6. Node att = (Node) itr.next();
  7. if (name.equals(att.getComponent().getName())) {
  8. return att;
  9. }
  10. }
  11. return null;
  12. }

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

  1. public Node getChild(String name) {
  2. if (name == null) {
  3. return null;
  4. }
  5. for (Iterator itr = children.iterator(); itr.hasNext(); ) {
  6. Node child = (Node) itr.next();
  7. if (name.equals(child.getComponent().getName())) {
  8. return child;
  9. }
  10. }
  11. return null;
  12. }

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

  1. public List getChildren(String name) {
  2. ArrayList matches = new ArrayList();
  3. if (name == null) {
  4. return matches;
  5. }
  6. for (Iterator itr = children.iterator(); itr.hasNext(); ) {
  7. Node child = (Node) itr.next();
  8. if (name.equals(child.getComponent().getName())) {
  9. matches.add(child);
  10. }
  11. }
  12. return matches;
  13. }

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

  1. @SuppressWarnings("unchecked")
  2. private List<String> childNames(Node node) {
  3. if (null == node) {
  4. return Collections.emptyList();
  5. }
  6. List<Node> children = node.getChildren();
  7. List<String> names = new ArrayList<String>(children.size());
  8. for (Node child : children) {
  9. InstanceComponent component = child.getComponent();
  10. String paramValue = component.getName();
  11. names.add(paramValue);
  12. }
  13. return names;
  14. }

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

  1. public List getChildValues(String name) {
  2. ArrayList matches = new ArrayList();
  3. if (name == null) {
  4. return matches;
  5. }
  6. for (Iterator itr = children.iterator(); itr.hasNext(); ) {
  7. Node child = (Node) itr.next();
  8. if (name.equals(child.getComponent().getName())) {
  9. matches.add(child.getValue());
  10. }
  11. }
  12. return matches;
  13. }

代码示例来源: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. }

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

  1. private void mapBinding(Map<String, Object> map, List attributes) {
  2. for (Iterator i = attributes.iterator(); i.hasNext(); ) {
  3. Node attribute = (Node) i.next();
  4. String name = attribute.getComponent().getName();
  5. Object value = attribute.getValue();
  6. if (map.containsKey(name)) {
  7. List<Object> values;
  8. Object obj = map.get(name);
  9. if (obj instanceof List) {
  10. values = (List<Object>) obj;
  11. } else {
  12. values = new ArrayList<Object>();
  13. values.add(obj);
  14. map.put(name, values);
  15. }
  16. values.add(value);
  17. } else {
  18. map.put(name, value);
  19. }
  20. }
  21. }
  22. }

代码示例来源: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 ops = new ArrayList();
  10. for (Iterator i = node.getChildren().iterator(); i.hasNext(); ) {
  11. Node child = (Node) i.next();
  12. ops.add(factory.spatialOperator(child.getComponent().getName(), null));
  13. }
  14. return factory.spatialOperators(
  15. (SpatialOperator[]) ops.toArray(new SpatialOperator[ops.size()]));
  16. }

代码示例来源: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: 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. Double d = Double.valueOf(node.getComponent().getText());
  10. URI uom = (URI) node.getAttributeValue(URI.class);
  11. if (uom != null) {
  12. return new Measure(d.doubleValue(), new BaseUnit(uom.toString()));
  13. }
  14. return new Measure(d.doubleValue(), null);
  15. }

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

  1. @Override
  2. public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
  3. Node parent = node.getParent();
  4. if (parent != null) {
  5. String parentElementName = parent.getComponent().getName();
  6. if (FOLDER.equals(parentElementName)) {
  7. Folder folder = folderStack.peek();
  8. if (folder != null) {
  9. folder.setName(value.toString());
  10. }
  11. }
  12. }
  13. return super.parse(instance, node, value);
  14. }

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

  1. Name opName = new NameImpl(n.getComponent().getNamespace(), n.getComponent().getName());
  2. for (Node n : children) {
  3. Name opName =
  4. new NameImpl(n.getComponent().getNamespace(), n.getComponent().getName());
  5. Map map = (Map) n.getValue();

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

  1. while (!"Value".equals(children.get(i).getComponent().getName())) i++;

代码示例来源: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. ExtensionType et = Wcs20Factory.eINSTANCE.createExtensionType();
  10. EList<ExtensionItemType> contents = et.getContents();
  11. for (Object o : node.getChildren()) {
  12. Node child = (Node) o;
  13. String name = child.getComponent().getName();
  14. String namespace = child.getComponent().getNamespace();
  15. Object v = child.getValue();
  16. ExtensionItemType item = Wcs20Factory.eINSTANCE.createExtensionItemType();
  17. item.setName(name);
  18. item.setNamespace(namespace);
  19. if (v instanceof String) {
  20. item.setSimpleContent((String) v);
  21. } else {
  22. item.setObjectContent(v);
  23. }
  24. contents.add(item);
  25. }
  26. return et;
  27. }

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

  1. ftBuilder.setName(node.getComponent().getName());
  2. ftBuilder.setNamespaceURI(node.getComponent().getNamespace());
  3. String name = child.getComponent().getName();
  4. Object valu = child.getValue();

代码示例来源: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. // retype from the abstract feature type, since extended data could have altered the schema
  10. // placemarks add an additional geometry field
  11. SimpleFeature feature = (SimpleFeature) value;
  12. SimpleFeatureType abstractFeatureType = feature.getFeatureType();
  13. SimpleFeatureTypeBuilder tb = new SimpleFeatureTypeBuilder();
  14. tb.init(abstractFeatureType);
  15. tb.setName("placemark");
  16. tb.add("Geometry", Geometry.class);
  17. tb.setDefaultGeometry("Geometry");
  18. SimpleFeatureType placemarkFeatureType = tb.buildFeatureType();
  19. SimpleFeatureBuilder b = new SimpleFeatureBuilder(placemarkFeatureType);
  20. b.init(feature);
  21. // &lt;element minOccurs="0" ref="kml:Geometry"/&gt;
  22. for (Object childObj : node.getChildren(Geometry.class)) {
  23. Node childNode = (Node) childObj;
  24. String componentName = childNode.getComponent().getName();
  25. if (SUPPORTED_GEOMETRY_TYPES.contains(componentName)) {
  26. b.set("Geometry", childNode.getValue());
  27. }
  28. }
  29. return b.buildFeature(feature.getID());
  30. }

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

  1. ftCache.get(
  2. new NameImpl(
  3. node.getComponent().getNamespace(),
  4. node.getComponent().getName()));

相关文章