本文整理了Java中org.geotools.xsd.Node.getAttributeValue()
方法的一些代码示例,展示了Node.getAttributeValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getAttributeValue()
方法的具体详情如下:
包路径:org.geotools.xsd.Node
类名称:Node
方法名:getAttributeValue
[英]Helper method for access to the parsed value of the attribute whose parsed value is an instance of clazz
. In the event that the node contains multple attributes matching the above criteria, the first encountered is returned, with no guaratnee of order. For all values matching this criteria use #getAttributeValues(Class).
[中]用于访问其解析值为clazz
实例的属性的解析值的Helper方法。如果节点包含与上述条件匹配的多个属性,则返回第一个遇到的属性,而不保证顺序。对于所有符合此条件的值,请使用#GetAttributeValue(类)。
代码示例来源:origin: geoserver/geoserver
/**
*
* <!-- begin-user-doc -->
*
* @param value an instance of {@link GetCapabilitiesType} (possibly a subclass) if a binding
* for a specific service's GetCapabilities request used {@link Binding#BEFORE} {@link
* #getExecutionMode() execution mode}, and thus relies on this binding to fill the common
* properties. <code>null</code> otherwise.
* <!-- end-user-doc -->
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
GetCapabilitiesType getCapabilities;
if ((value != null) && value instanceof GetCapabilitiesType) {
getCapabilities = (GetCapabilitiesType) value;
} else {
getCapabilities = owsfactory.createGetCapabilitiesType();
}
getCapabilities.setAcceptVersions(
(AcceptVersionsType) node.getChildValue(AcceptVersionsType.class));
getCapabilities.setSections((SectionsType) node.getChildValue(SectionsType.class));
getCapabilities.setAcceptFormats(
(AcceptFormatsType) node.getChildValue(AcceptFormatsType.class));
getCapabilities.setUpdateSequence((String) node.getAttributeValue("updateSequence"));
return getCapabilities;
}
}
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
return factory.featureId(node.getAttributeValue("fid").toString());
}
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
String name = (String) value;
// <xsd:attribute name="nArgs" type="xsd:string" use="required"/>
String nargs = (String) node.getAttributeValue("nArgs");
return factory.functionName(name, Integer.parseInt(nargs));
}
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
// <xsd:attribute ref="gml:id" use="required"/>
return filterfactory.gmlObjectId((String) node.getAttributeValue("id"));
}
代码示例来源:origin: geotools/geotools
/**
* Sets the service feature of the object passed in.
*
* <p>The service value is retreived as an attribute from the node, if <code>null</code>, the
* default "WFS" is used.
*
* @param object An object which contains a feature named "service"
* @param node The parse node.
*/
public static void service(EObject object, Node node) {
String service = (String) node.getAttributeValue("service");
if (service == null) {
service = "WFS";
}
set(object, "service", service);
}
代码示例来源:origin: geotools/geotools
@Override
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
Double minx = Double.valueOf((String) node.getAttributeValue("minx"));
Double miny = Double.valueOf((String) node.getAttributeValue("miny"));
Double maxx = Double.valueOf((String) node.getAttributeValue("maxx"));
Double maxy = Double.valueOf((String) node.getAttributeValue("maxy"));
WGS84BoundingBoxType bbox = Ows10Factory.eINSTANCE.createWGS84BoundingBoxType();
bbox.setCrs("EPSG:4326");
bbox.setDimensions(BigInteger.valueOf(2));
bbox.setLowerCorner(Arrays.asList(minx, miny));
bbox.setUpperCorner(Arrays.asList(maxx, maxy));
return bbox;
}
}
代码示例来源:origin: geotools/geotools
/**
* Sets the outputFormat feature of the object passed in.
*
* <p>The outputFormat value is retreived as an attribute from the node, if <code>null</code>,
* the default <code>default</code> is used.
*
* @param object An object which contains a feature named "version"
* @param node The parse node.
*/
public static void outputFormat(EObject object, Node node, String defalt) {
String outputFormat = (String) node.getAttributeValue("outputFormat");
if (outputFormat == null) {
outputFormat = defalt;
}
set(object, "outputFormat", outputFormat);
}
代码示例来源:origin: geotools/geotools
/**
* Sets the version feature of the object passed in.
*
* <p>The version value is retreived as an attribute from the node, if <code>null</code>, the
* default "1.0.0" is used.
*
* @param object An object which contains a feature named "version"
* @param node The parse node.
*/
public static void version(EObject object, Node node) {
String version = (String) node.getAttributeValue("version");
if (version == null) {
version = "1.0.0";
}
set(object, "version", version);
}
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
URLTemplateType template = factory.createURLTemplateType();
template.setFormat((String) node.getAttributeValue("format"));
// TODO: find resourceType binding?
// template.setResourceType((String) node.getAttributeValue("resourceType"));
template.setTemplate((String) node.getAttributeValue("template"));
return template;
}
}
代码示例来源:origin: geotools/geotools
private RequestMethodType createRequestMethodType(
Ows10Factory ows10Factory, Node getOrPostNode) {
RequestMethodType methodType = ows10Factory.createRequestMethodType();
String href = (String) getOrPostNode.getAttributeValue("onlineResource");
methodType.setHref(href);
return methodType;
}
}
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
CssParameter parameter = new CssParameter((String) node.getAttributeValue("name"));
parameter.setExpression((Expression) value);
return parameter;
}
}
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
// <xsd:element minOccurs="0" name="GeometryOperands"
// type="ogc:GeometryOperandsType"/>
GeometryOperand[] gos = (GeometryOperand[]) node.getChildValue(GeometryOperand[].class);
// <xsd:attribute name="name" type="ogc:SpatialOperatorNameType"/>
return factory.spatialOperator((String) node.getAttributeValue("name"), gos);
}
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
// <xsd:element ref="se:StringValue"/>
Expression str = (Expression) node.getChildValue("StringValue");
// <xsd:attribute name="stripOffPosition" type="se:stripOffPositionType"/>
Expression pos = filterFactory.literal(node.getAttributeValue("stripOffPosition"));
// <xsd:attribute name="stripOffChar" type="xsd:string"/>
Expression ch = filterFactory.literal(node.getAttributeValue("stripOffChar"));
return filterFactory.function("strTrim2", str, pos, ch);
}
}
代码示例来源:origin: geotools/geotools
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
ComplexDataType data = factory.createComplexDataType();
if (node.hasAttribute("schema")) {
data.setSchema(node.getAttributeValue("schema").toString());
}
if (node.hasAttribute("mimeType")) {
data.setMimeType(node.getAttributeValue("mimeType").toString());
}
if (node.hasAttribute("encoding")) {
data.setEncoding(node.getAttributeValue("encoding").toString());
}
for (Iterator i = node.getChildren().iterator(); i.hasNext(); ) {
Node c = (Node) i.next();
data.getData().add(c.getValue());
}
return data;
}
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
// TODO: units
Expression[] operands = OGCUtils.spatial(node, filterFactory, geometryFactory);
double distance = ((Double) node.getChildValue("Distance")).doubleValue();
Object units = node.getChild("Distance").getAttributeValue("units");
return filterFactory.dwithin(
operands[0], operands[1], distance, units == null ? null : units.toString());
}
}
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
Expression[] operands = OGCUtils.spatial(node, filterFactory, geometryFactory);
double distance = ((Double) node.getChildValue(Double.class)).doubleValue();
Object units = node.getChild("Distance").getAttributeValue("units");
return filterFactory.beyond(
operands[0], operands[1], distance, units == null ? null : units.toString());
}
}
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
Double d = Double.valueOf(node.getComponent().getText());
URI uom = (URI) node.getAttributeValue(URI.class);
if (uom != null) {
return new Measure(d.doubleValue(), new BaseUnit(uom.toString()));
}
return new Measure(d.doubleValue(), null);
}
代码示例来源:origin: geotools/geotools
@Override
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
CssParameter option = new CssParameter((String) node.getAttributeValue("name"));
option.setExpression(filterFactory.literal(instance.getText()));
return option;
}
}
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
GeoPackageProcessRequest.Layer layer = parseLayer(instance, node, value);
layer.setName((String) node.getAttributeValue("name"));
layer.setIdentifier((String) node.getAttributeValue("identifier"));
layer.setBbox((Envelope) node.getChildValue("bbox"));
layer.setDescription((String) node.getChildValue("description"));
layer.setSrs((URI) node.getChildValue("srs"));
return layer;
}
}
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
Envelope envelope = (Envelope) node.getChildValue("envelope");
String body = (String) node.getChildValue("body");
BigInteger id = (BigInteger) node.getAttributeValue("id");
List atts = node.getChildValues("attachment");
Attachment[] attachments = (Attachment[]) atts.toArray(new Attachment[atts.size()]);
return new Mail(id, body, envelope, attachments);
}
内容来源于网络,如有侵权,请联系作者删除!