Package org.geotools.feature

Examples of org.geotools.feature.AttributeImpl


        AttributeType p = new AttributeTypeImpl(attName, String.class, false, false, null, null,
                null);
        AttributeDescriptor pd = new AttributeDescriptorImpl(p, attName, 0, 0, false, null);

        propertyDescriptors.add(pd);
        properties.add(new AttributeImpl(uom, pd, null));

        p = new AttributeTypeImpl(new NameImpl("simpleContent"), String.class, false, false, null,
                null, null);
        AttributeDescriptor pd2 = new AttributeDescriptorImpl(p, new NameImpl("simpleContent"), 0,
                0, false, null);

        properties.add(new AttributeImpl(value, pd2, null));
        propertyDescriptors.add(pd2);

        ComplexTypeImpl at = new ComplexTypeImpl(myType, propertyDescriptors, false, false,
                Collections.EMPTY_LIST, null, null);
View Full Code Here


     * @throws Exception
     */
    public void testXlinkHrefNull() throws Exception {
        AttributeType attType = new AttributeTypeImpl(new NameImpl("someAttributeType"),
                String.class, false, false, null, null, null);
        AttributeImpl node = new AttributeImpl(null, attType, null);
        ReferenceTypeBinding binding = new ReferenceTypeBinding();
        Object xlink = binding.getProperty(node, XLINK.HREF);
        assertNull(xlink);
    }
View Full Code Here

     * @throws Exception
     */
    public void testXlinkHref() throws Exception {
        AttributeType attType = new AttributeTypeImpl(new NameImpl("someAttributeType"),
                String.class, false, false, null, null, null);
        AttributeImpl node = new AttributeImpl(null, attType, null);
        final String ID = "something";
        node.getUserData().put("gml:id", ID);
        ReferenceTypeBinding binding = new ReferenceTypeBinding();
        Object xlink = binding.getProperty(node, XLINK.HREF);
        assertNotNull(xlink);
        assertEquals("#" + ID, xlink.toString());
    }
View Full Code Here

    public static Feature createMappedFeature(String id, String bgsid, final String description,
            final String specificationDescription, final Geometry shape) {

        final Collection<Property> specificationFeatureProperties = new ArrayList<Property>() {
            {
                add(new AttributeImpl(specificationDescription, new AttributeDescriptorImpl(
                        XSSchema.STRING_TYPE, new NameImpl("http://www.opengis.net/gml",
                                "description"), 0, 1, false, null), null));
            }
        };
        final Feature specificationFeature = new FeatureImpl(specificationFeatureProperties,
                GEOLOGICUNIT_TYPE, new FeatureIdImpl(id + ".spec"));

        Collection<Property> properties = new ArrayList<Property>() {
            {
                // FIXME: should be GMLSchema.STRINGORREFTYPE_TYPE, but that is a complexType with
                // simpleContent, not currently supported
                add(new AttributeImpl(description, new AttributeDescriptorImpl(
                        XSSchema.STRING_TYPE, new NameImpl("http://www.opengis.net/gml",
                                "description"), 0, 1, false, null), null));
                add(new ComplexAttributeImpl(new ArrayList<Property>() {
                    {
                        add(specificationFeature);
                    }
                }, SPECIFICATION_DESCRIPTOR, null));
                add(new AttributeImpl(shape, SHAPE_DESCRIPTOR, null)); // FIXME should be Geometry*
            }
        };
        return new FeatureImpl(properties, MAPPEDFEATURE_TYPE, new FeatureIdImpl(id));
    }
View Full Code Here

        return ComplexAttribute.class;
    }

    @Override
    public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
        return new ComplexAttributeImpl(Arrays.<Property> asList(new AttributeImpl(node.getAttributeValue("codeSpace"),
            CODETYPE_TYPE$CODESPACE, null), new AttributeImpl(value, SIMPLECONTENT_DESCRIPTOR, null)), CODETYPE_TYPE, null);
    }
View Full Code Here

TOP

Related Classes of org.geotools.feature.AttributeImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.