本文整理了Java中org.geotools.xsd.Node.hasAttribute()
方法的一些代码示例,展示了Node.hasAttribute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.hasAttribute()
方法的具体详情如下:
包路径:org.geotools.xsd.Node
类名称:Node
方法名:hasAttribute
[英]Determines if the node has an attribute whose value is of the specified class.
[中]确定节点是否具有值属于指定类的属性。
代码示例来源:origin: geotools/geotools
public void initializeChildContext(
ElementInstance childInstance, Node node, MutablePicoContainer context) {
// if an srsName is set for this geometry, put it in the context for
// children, so they can use it as well
if (node.hasAttribute("srsName")) {
try {
CoordinateReferenceSystem crs = GML2ParsingUtils.crs(node);
if (crs != null) {
context.registerComponentInstance(CoordinateReferenceSystem.class, crs);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
if (value instanceof Geometry) {
Geometry geometry = (Geometry) value;
// <attribute name="srsName" type="anyURI" use="optional"/>
if (node.hasAttribute("srsName")) {
URI srs = (URI) node.getAttributeValue("srsName");
CoordinateReferenceSystem crs = CRS.decode(srs.toString());
if (crs != null) {
geometry.setUserData(crs);
} else {
logger.warning("Could not create Coordinate Reference System for " + srs);
}
}
// TODO: process the ID attribute
}
return value;
}
代码示例来源: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 {
List l = node.getChildValues(Symbolizer.class);
Symbolizer[] syms = (Symbolizer[]) l.toArray(new Symbolizer[l.size()]);
FeatureTypeStyle style = sb.createFeatureTypeStyle(syms, 1.0, 1.0);
// if the style has an id, throw it in to the style cache
if (node.hasAttribute("id")) {
String id = (String) node.getAttributeValue("id");
// create a uri with just a fragment
URI uri = new URI("#" + id);
styleMap.put(uri, style);
}
return style;
}
}
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
Expression e1 = (Expression) node.getChildValue(0);
Expression e2 = (Expression) node.getChildValue(1);
// <xsd:attribute default="true" name="matchCase" type="xsd:boolean" use="optional"/>
Boolean matchCase = Boolean.TRUE;
if (node.hasAttribute("matchCase")) {
matchCase = (Boolean) node.getAttributeValue("matchCase");
}
return filterfactory.equal(e1, e2, matchCase.booleanValue());
}
}
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
Expression e1 = (Expression) node.getChildValue(0);
Expression e2 = (Expression) node.getChildValue(1);
// filter 1.1 only
// <xsd:attribute default="true" name="matchCase" type="xsd:boolean" use="optional"/>
Boolean matchCase = Boolean.TRUE;
if (node.hasAttribute("matchCase")) {
matchCase = (Boolean) node.getAttributeValue("matchCase");
}
return filterfactory.notEqual(e1, e2, matchCase.booleanValue());
}
}
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
UpdateElementType updateElement = wfsfactory.createUpdateElementType();
// <xsd:element maxOccurs="unbounded" ref="wfs:Property">
updateElement.getProperty().addAll(node.getChildValues(PropertyType.class));
// <xsd:element maxOccurs="1" minOccurs="0" ref="ogc:Filter">
updateElement.setFilter((Filter) node.getChildValue(Filter.class));
// <xsd:attribute name="handle" type="xsd:string" use="optional">
if (node.hasAttribute("handle")) {
updateElement.setHandle((String) node.getAttributeValue("handle"));
}
// <xsd:attribute name="typeName" type="xsd:QName" use="required">
updateElement.setTypeName((QName) node.getAttributeValue("typeName"));
// <xsd:attribute default="x-application/gml:3" name="inputFormat"
// type="xsd:string" use="optional">
if (node.hasAttribute("inputFormat")) {
updateElement.setInputFormat((String) node.getAttributeValue("inputFormat"));
}
// <xsd:attribute name="srsName" type="xsd:anyURI" use="optional">
if (node.hasAttribute("srsName")) {
updateElement.setSrsName((URI) node.getAttributeValue("srsName"));
}
return updateElement;
}
代码示例来源:origin: geotools/geotools
if (node.hasAttribute("idgen")) {
insertElement.setIdgen(
(IdentifierGenerationOptionType) node.getAttributeValue("idgen"));
if (node.hasAttribute("handle")) {
insertElement.setHandle((String) node.getAttributeValue("handle"));
if (node.hasAttribute("inputFormat")) {
insertElement.setInputFormat((String) node.getAttributeValue("inputFormat"));
if (node.hasAttribute("srsName")) {
insertElement.setSrsName((URI) node.getAttributeValue("srsName"));
代码示例来源:origin: geotools/geotools
/**
*
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
DeleteElementType deleteElement = wfsfactory.createDeleteElementType();
// <xsd:element maxOccurs="1" minOccurs="1" ref="ogc:Filter">
deleteElement.setFilter((Filter) node.getChildValue(Filter.class));
// <xsd:attribute name="handle" type="xsd:string" use="optional"/>
if (node.hasAttribute("handle")) {
deleteElement.setHandle((String) node.getAttributeValue("handle"));
}
// <xsd:attribute name="typeName" type="xsd:QName" use="required"/>
deleteElement.setTypeName((QName) node.getAttributeValue(QName.class));
return deleteElement;
}
}
代码示例来源:origin: geotools/geotools
sym.setDescription((Description) node.getChildValue("Description"));
if (node.hasAttribute("uom")) {
String uom = ((URI) node.getAttributeValue("uom")).toString();
if (UomOgcMapping.get(uom) == null) {
代码示例来源:origin: geotools/geotools
String featureTypeId = null;
if (node.hasAttribute("id")) {
featureTypeId = (String) node.getAttributeValue("id");
if (node.hasAttribute("name")) {
featureTypeName = (String) node.getAttributeValue("name");
} else if (featureTypeId != null) {
代码示例来源:origin: geotools/geotools
RectifiedGridType grid = Gml4wcsFactory.eINSTANCE.createRectifiedGridType();
if (node.hasAttribute("srsName")) {
grid.setSrsName(node.getAttributeValue("srsName").toString());
代码示例来源:origin: geotools/geotools
if (node.hasAttribute("decimalPoint")) {
expressions[3] = filterFactory.literal(node.getAttributeValue("decimalPoint"));
} else {
if (node.hasAttribute("groupingSeparator")) {
expressions[4] = filterFactory.literal(node.getAttributeValue("groupingSeparator"));
} else {
内容来源于网络,如有侵权,请联系作者删除!