public XPath() { this.FF = CommonFactoryFinder.getFilterFactory(null); this.featureFactory = new ValidatingFeatureFactoryImpl(); this.descriptorFactory = new UniqueNameFeatureTypeFactoryImpl(); }
public static FeatureType createFeatureType() { FeatureTypeFactory tfac = new UniqueNameFeatureTypeFactoryImpl(); Name fName = new NameImpl(EG, "complexFeatureType");
public static FeatureType createFeatureType() { FeatureTypeFactory tfac = new UniqueNameFeatureTypeFactoryImpl(); Name fName = new NameImpl(EG, "complexFeatureType");
@Test public void testSteps() throws Exception { FeatureType complexType = ComplexTestData .createExample01MultiValuedComplexProperty(new UniqueNameFeatureTypeFactoryImpl()); Name name = complexType.getName(); AttributeDescriptor descriptor = new AttributeDescriptorImpl(complexType, name, 0,
FeatureType complexType = ComplexTestData.createExample01MultiValuedComplexProperty( new UniqueNameFeatureTypeFactoryImpl()); Name name = complexType.getName(); AttributeDescriptor descriptor =
@Before public void setUp() throws Exception { FeatureTypeFactory typeFactory = new UniqueNameFeatureTypeFactoryImpl(); FeatureType type = ComplexTestData.createExample02MultipleMultivalued(typeFactory); AttributeBuilder ab = new AttributeBuilder(new ValidatingFeatureFactoryImpl()); ab.setType(type); feature = (Feature) ab.build("test-id"); idExpr = CommonFactoryFinder.getFilterFactory(null).function("getID", new org.opengis.filter.expression.Expression[0]); }
@Before public void setUp() throws Exception { MemoryDataStore ds = createWaterSampleTestFeatures(); targetType = TestData.createComplexWaterSampleType(); FeatureTypeFactory tf = new UniqueNameFeatureTypeFactoryImpl(); AttributeDescriptor targetFeature = tf.createAttributeDescriptor(targetType, targetType .getName(), 0, Integer.MAX_VALUE, true, null); targetName = targetFeature.getName(); List mappings = TestData.createMappingsColumnsAndValues(targetFeature); Name sourceName = TestData.WATERSAMPLE_TYPENAME; FeatureSource<SimpleFeatureType, SimpleFeature> source = ds.getFeatureSource(sourceName); // empty nssupport as the sample types have no namespace defined NamespaceSupport namespaces = new NamespaceSupport(); mapping = new FeatureTypeMapping(source, targetFeature, mappings, namespaces); dataStore = new AppSchemaDataAccess(Collections.singleton(mapping)); }
/** * Tests a location path of the form <code>"foo/bar/@baz"</code> gets built as a * {@link StepList} of attribute names <code>"foo/bar/baz"</code> (i.e. no distinction between * what's a "property" and what's an (xml) "attribute". * * @throws Exception */ @Test public void testStepsWithXmlAttribute() throws Exception { FeatureType complexType = ComplexTestData .createExample01MultiValuedComplexProperty(new UniqueNameFeatureTypeFactoryImpl()); Name name = complexType.getName(); AttributeDescriptor descriptor = new AttributeDescriptorImpl(complexType, name, 0, Integer.MAX_VALUE, true, null); QName rootQName = new QName(name.getNamespaceURI(), name.getLocalPart()); NamespaceSupport namespaces = new NamespaceSupport(); namespaces.declarePrefix("wq", name.getNamespaceURI()); namespaces.declarePrefix("xlink", XLINK.NAMESPACE); StepList steps = XPath.steps(descriptor, "wq_plus/measurement[2]/@xlink:href", namespaces); assertNotNull(steps); assertEquals(steps.toString(), 2, steps.size()); XPath.Step step1 = new XPath.Step(new QName(rootQName.getNamespaceURI(), "measurement"), 2, false); XPath.Step step2 = new XPath.Step(XLINK.HREF, 1, true); assertEquals(step1, steps.get(0)); assertEquals(step2, steps.get(1)); }
/** * Tests a location path of the form <code>"foo/bar/@baz"</code> gets built as a {@link * StepList} of attribute names <code>"foo/bar/baz"</code> (i.e. no distinction between what's a * "property" and what's an (xml) "attribute". * * @throws Exception */ @Test public void testStepsWithXmlAttribute() throws Exception { FeatureType complexType = ComplexTestData.createExample01MultiValuedComplexProperty( new UniqueNameFeatureTypeFactoryImpl()); Name name = complexType.getName(); AttributeDescriptor descriptor = new AttributeDescriptorImpl(complexType, name, 0, Integer.MAX_VALUE, true, null); QName rootQName = new QName(name.getNamespaceURI(), name.getLocalPart()); NamespaceSupport namespaces = new NamespaceSupport(); namespaces.declarePrefix("wq", name.getNamespaceURI()); namespaces.declarePrefix("xlink", XLINK.NAMESPACE); StepList steps = XPathUtil.steps(descriptor, "wq_plus/measurement[2]/@xlink:href", namespaces); assertNotNull(steps); assertEquals(steps.toString(), 2, steps.size()); XPathUtil.Step step1 = new XPathUtil.Step(new QName(rootQName.getNamespaceURI(), "measurement"), 2, false); XPathUtil.Step step2 = new XPathUtil.Step(XLINK.HREF, 1, true); assertEquals(step1, steps.get(0)); assertEquals(step2, steps.get(1)); }
FeatureTypeFactory tf = new UniqueNameFeatureTypeFactoryImpl(); AttributeDescriptor targetFeature = tf.createAttributeDescriptor(targetType, targetType .getName(), 0, Integer.MAX_VALUE, true, null);
public static FeatureType createComplexWaterSampleType() { FeatureTypeFactory tfac = new UniqueNameFeatureTypeFactoryImpl(); TypeBuilder builder = new TypeBuilder(tfac); FeatureType sampleType; AttributeType parameter = builder.name("parameter").bind(String.class).attribute(); AttributeType value = builder.name("value").bind(Double.class).attribute(); builder.setName("measurement"); builder.addAttribute("parameter", parameter); builder.addAttribute("value", value); ComplexType MEASUREMENT = builder.complex(); builder.setName("sample"); builder.cardinality(0, Integer.MAX_VALUE); builder.addAttribute("measurement", MEASUREMENT); sampleType = builder.feature(); return sampleType; }
private FeatureTypeMapping createSampleDerivedAttributeMappings() throws Exception { FeatureTypeFactory tf = new UniqueNameFeatureTypeFactoryImpl(); TypeBuilder builder = new TypeBuilder(tf);
.createExample05NoNamespaceURI(new UniqueNameFeatureTypeFactoryImpl()); Name name = complexType.getName(); AttributeDescriptor descriptor = new AttributeDescriptorImpl(complexType, name, 0, .createExample01MultiValuedComplexProperty(new UniqueNameFeatureTypeFactoryImpl()); name = complexType.getName(); descriptor = new AttributeDescriptorImpl(complexType, name, 0, Integer.MAX_VALUE, true,
new UniqueNameFeatureTypeFactoryImpl()); Name name = complexType.getName(); AttributeDescriptor descriptor = new UniqueNameFeatureTypeFactoryImpl()); name = complexType.getName(); descriptor =
FeatureTypeFactory tfac = new UniqueNameFeatureTypeFactoryImpl(); TypeBuilder builder = new TypeBuilder(tfac);