Package org.opengis.cite.kml22.level1
Class UserDefinedDataTests
java.lang.Object
org.opengis.cite.kml22.BaseFixture
org.opengis.cite.kml22.level1.UserDefinedDataTests
Contains test methods that verify constraints applicable to user-defined data elements
and their corresponding definitions.
Sources
- OGC 07-147r2: OGC KML 2.2, cl. 9.8 (kml:Schema)
- KML Reference - Schema
-
Field Summary
FieldsModifier and TypeFieldDescriptionList of XML Schema data types that may be used to define simple fields.Java type mappings for XML Schema datatypes (from JAXB specification).Fields inherited from class org.opengis.cite.kml22.BaseFixture
NS_MAP, testSubject -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidcheckSimpleDataElements(Element schemaData, net.sf.saxon.s9api.XdmNode schemaNode, org.opengis.cite.validation.ValidationErrorHandler errHandler) Checks that the content of a kml:SchemaData element conforms to the declarations in the referenced Schema.(package private) QNamegetFieldType(Element field) Determines the data type declared for a given kml:SimpleField element.void[Test] Verifies that a kml:Schema element has an 'id' attribute value.(package private) booleanvalueConformsToType(String value, QName dataType) Determines whether or not the given datum value conforms to a specified XML Schema datatype.void[Test] Verifies that a kml:SchemaData element satisfies all of the following constraints: the 'schemaUrl' attribute value is a URL with a fragment component that refers to a kml:Schema element; all kml:SimpleData child elements have a 'name' attribute that matches the name of a declared kml:SimpleField element in the corresponding Schema; the values of all kml:SimpleData child elements conform to their declared types.void[Test] Verifies that a kml:SimpleField element satisfies all of the following constraints: it has a 'name' attribute; the value of the 'type' attribute is one of the following XML Schema data types: xsd:string xsd:int xsd:unsignedInt xsd:short xsd:unsignedShort xsd:float xsd:double xsd:booleanvoid[Test] Verifies that the value of the 'name' attribute on a kml:Data element is unique within the context of the parent kml:ExtendedData element.Methods inherited from class org.opengis.cite.kml22.BaseFixture
obtainTestSubject, setTestSubject, verifyElementNotEmpty
-
Field Details
-
SIMPLE_FIELD_TYPES
List of XML Schema data types that may be used to define simple fields. -
XSD_JAVA_MAPPINGS
Java type mappings for XML Schema datatypes (from JAXB specification).
-
-
Constructor Details
-
UserDefinedDataTests
public UserDefinedDataTests()
-
-
Method Details
-
schemaHasIdAttribute
public void schemaHasIdAttribute()[Test] Verifies that a kml:Schema element has an 'id' attribute value.- See Also:
-
- "OGC 07-134r2, ATC 25: Schema"
-
verifySimpleField
public void verifySimpleField()[Test] Verifies that a kml:SimpleField element satisfies all of the following constraints:- it has a 'name' attribute;
- the value of the 'type' attribute is one of the following XML Schema data
types:
- xsd:string
- xsd:int
- xsd:unsignedInt
- xsd:short
- xsd:unsignedShort
- xsd:float
- xsd:double
- xsd:boolean
- See Also:
-
- "OGC 07-134r2, ATC 26: Schema - SimpleField"
-
verifySchemaData
public void verifySchemaData()[Test] Verifies that a kml:SchemaData element satisfies all of the following constraints:- the 'schemaUrl' attribute value is a URL with a fragment component that refers to a kml:Schema element;
- all kml:SimpleData child elements have a 'name' attribute that matches the name of a declared kml:SimpleField element in the corresponding Schema;
- the values of all kml:SimpleData child elements conform to their declared types.
- See Also:
-
- "OGC 07-134r2, ATC 27: ExtendedData - SchemaData"
-
verifyUntypedDataAreUnique
[Test] Verifies that the value of the 'name' attribute on a kml:Data element is unique within the context of the parent kml:ExtendedData element.- Throws:
XPathExpressionException- If an error occurred while evaluating an XPath expression.- See Also:
-
- "OGC 07-134r2, ATC 28: ExtendedData - Data"
-
checkSimpleDataElements
void checkSimpleDataElements(Element schemaData, net.sf.saxon.s9api.XdmNode schemaNode, org.opengis.cite.validation.ValidationErrorHandler errHandler) Checks that the content of a kml:SchemaData element conforms to the declarations in the referenced Schema.- Parameters:
schemaData- A kml:SchemaData element (with parent kml:ExtendedData).schemaNode- An XdmNode representing the referenced kml:Schema element.errHandler- An error handler that accepts reported constraint violations.
-
valueConformsToType
Determines whether or not the given datum value conforms to a specified XML Schema datatype. The assessment is based on the type mappings defined in the JAXB specification.- Parameters:
value- A String representing a datum value.dataType- A QName identifying some simple datatype.- Returns:
trueif the value conforms to the data type;falseotherwise.
-
getFieldType
Determines the data type declared for a given kml:SimpleField element.- Parameters:
field- A kml:SimpleField element.- Returns:
- A QName representing a (simple) XML Schema data type.
-