public List<AttributeTypeInfo> attributes() throws IOException { return delegate.attributes(); }
@Test public void testNoMapping() throws Exception { reloadCatalogAndConfiguration(); FeatureTypeInfo ft = getCatalog().getFeatureTypeByName("DividedRoutes"); assertEquals(4, ft.attributes().size()); }
@Test public void testXsdMapping() throws Exception { getDataDirectory() .copyToResourceDir( getDividedRoutes(), getClass().getResourceAsStream("schema.xsd"), "schema.xsd"); reloadCatalogAndConfiguration(); FeatureTypeInfo ft = getCatalog().getFeatureTypeByName("DividedRoutes"); assertEquals(3, ft.attributes().size()); }
@Test public void testXmlMapping() throws Exception { getDataDirectory() .copyToResourceDir( getDividedRoutes(), getClass().getResourceAsStream("schema.xml"), "schema.xml"); reloadCatalogAndConfiguration(); FeatureTypeInfo ft = getCatalog().getFeatureTypeByName("DividedRoutes"); assertEquals(2, ft.attributes().size()); }
List<AttributeTypeInfo> attributes = info.attributes(); if (attributes == null || attributes.isEmpty()) { return fs;
@Override protected void postEncodeFeatureType(FeatureTypeInfo ft, HierarchicalStreamWriter writer, MarshallingContext context) { try { writer.startNode("attributes"); context.convertAnother(ft.attributes()); writer.endNode(); } catch (IOException e) { throw new RuntimeException("Could not get native attributes", e); } } });
protected List<PropertyName> addGeometryProperties( FeatureTypeInfo meta, List<PropertyName> oldProperties) throws IOException { List<AttributeTypeInfo> atts = meta.attributes(); Iterator ii = atts.iterator(); List<PropertyName> properties = new ArrayList<PropertyName>(oldProperties); while (ii.hasNext()) { AttributeTypeInfo ati = (AttributeTypeInfo) ii.next(); PropertyName propName = filterFactory.property(ati.getName()); if (meta.getFeatureType().getDescriptor(ati.getName()) instanceof GeometryDescriptor && !properties.contains(propName)) { properties.add(propName); } } return properties; } }
@Override protected void postEncodeFeatureType( FeatureTypeInfo ft, HierarchicalStreamWriter writer, MarshallingContext context) { try { writer.startNode("attributes"); context.convertAnother(ft.attributes()); writer.endNode(); } catch (IOException e) { throw new RuntimeException("Could not get native attributes", e); } } });
final ResourceInfo resource = lyr.getResource(); try { for (AttributeTypeInfo att : ((FeatureTypeInfo) resource).attributes()) { if (att.getBinding() != null && Geometry.class.isAssignableFrom(att.getBinding())) {
@Override public Object getDefaultValue( ResourceInfo resource, String dimensionName, DimensionInfo dimension, Class clz) { String attrName = dimension.getAttribute(); Class<?> attrType = String.class; if (resource instanceof FeatureTypeInfo) { List<AttributeTypeInfo> attrTypes; try { attrTypes = ((FeatureTypeInfo) resource).attributes(); for (AttributeTypeInfo attr : attrTypes) { if (attr.getName().equals(attrName)) { attrType = attr.getBinding(); break; } } } catch (IOException e) { } } final FeatureCalc nearest = new NearestVisitor(ff.property(dimension.getAttribute()), this.toMatch); CalcResult res = getCalculatedResult((FeatureTypeInfo) resource, dimension, nearest); if (res.equals(CalcResult.NULL_RESULT)) { return null; } else { return Converters.convert(res.getValue(), clz); } }
@Override public void onResource( String name, ResourceInfo r, StoreInfo s, MockCatalogBuilder b) { if (name.equals("Buildings")) { FeatureTypeInfo info = (FeatureTypeInfo) r; AttributeTypeInfoImpl geom1 = new AttributeTypeInfoImpl(); geom1.setName("geom"); EasyMock.expect(info.getAttributes()) .andReturn(Arrays.asList(geom1)) .anyTimes(); AttributeTypeInfoImpl geom2 = new AttributeTypeInfoImpl(); geom2.setName("geom"); geom2.setBinding(Polygon.class); try { EasyMock.expect(info.attributes()) .andReturn(Arrays.asList(geom2)) .anyTimes(); } catch (IOException e) { // will not happen } } super.onResource(name, r, s, b); } });
FeatureTypeInfo fti = (FeatureTypeInfo) li.getResource(); try { for (AttributeTypeInfo ati : fti.attributes()) { ruleFormModel .getObject()
List<AttributeTypeInfo> atts = meta.attributes(); List attNames = new ArrayList(atts.size()); for (AttributeTypeInfo att : atts) {