Package org.geotools.feature

Examples of org.geotools.feature.ComplexAttributeImpl


        Map<Name, Object> userData = new HashMap<Name, Object>();
        singleLeaf.getUserData().put(Attributes.class, userData);
        userData.put(Types.typeName(EG, "att"), "test attribute");       
       

        AttributeImpl rootOne = new ComplexAttributeImpl(rootPropertiesOne, rootDesc, null);

        // eg:complexAttribute/eg:rootAttribute[2]
        Collection<Property> rootPropertiesTwo = new ArrayList<Property>();
        // eg:complexAttribute/eg:rootAttribute[2]/eg:multiLeafAttribute[1]
        rootPropertiesTwo.add(leafOne);
        rootPropertiesTwo.add(singleLeaf);
        AttributeImpl rootTwo = new ComplexAttributeImpl(rootPropertiesTwo, rootDesc, null);

        // eg:complexAttribute/eg:rootAttribute[3]
        Collection<Property> rootPropertiesThree = new ArrayList<Property>();
        // eg:complexAttribute/eg:rootAttribute[3]/eg:singleLeafAttribute
        rootPropertiesThree.add(singleLeaf);
        AttributeImpl rootThree = new ComplexAttributeImpl(rootPropertiesThree, rootDesc, null);

        Collection<Property> complexProperties = new ArrayList<Property>(2);
        complexProperties.add(rootOne);
        complexProperties.add(rootTwo);
        complexProperties.add(rootThree);
        AttributeImpl complexAttribute = new ComplexAttributeImpl(complexProperties,
                complexDesc, null);
        properties.add(complexAttribute);

        Feature feature = new FeatureImpl(properties, fType, new FeatureIdImpl("test1"));
View Full Code Here


    public void testLeafComplexAttribute() {
        Collection<Property> attributes = new ArrayList<Property>();
        AttributeDescriptor descriptor = new AttributeDescriptorImpl(XSSchema.STRING_TYPE,
                ComplexFeatureConstants.SIMPLE_CONTENT, 1, 1, true, (Object) null);
        attributes.add(new AttributeImpl("rini", descriptor, null));
        ComplexAttribute gmlName = new ComplexAttributeImpl(attributes, GMLSchema.CODETYPE_TYPE, null);
        String nameString = Converters.convert(gmlName, String.class);
        assertEquals("rini", nameString);
    }
View Full Code Here

    public void testParentComplexAttribute() {
        Collection<Property> attributes = new ArrayList<Property>();
        AttributeDescriptor descriptor = new AttributeDescriptorImpl(XSSchema.STRING_TYPE,
                ComplexFeatureConstants.SIMPLE_CONTENT, 1, 1, true, (Object) null);
        attributes.add(new AttributeImpl("rini", descriptor, null));
        ComplexAttribute gmlName = new ComplexAttributeImpl(attributes, GMLSchema.CODETYPE_TYPE, null);
       
        Collection<Property> parentAttributes = new ArrayList<Property>();
        parentAttributes.add(gmlName);
        ComplexAttribute parentAtt = new ComplexAttributeImpl(parentAttributes, GMLSchema.ABSTRACTFEATURETYPE_TYPE, null);
        String nameString = Converters.convert(parentAtt, String.class);
       
        assertEquals(parentAtt.toString(), nameString);
        assertNotSame("rini", nameString);
    }
View Full Code Here

        if (simpleContent == null) {
            Collection<Property> contents = new ArrayList<Property>();
          simpleContent = buildSimpleContent(attribute.getType(), value);
            contents.add(simpleContent);
            ArrayList<Attribute> nestedAttContents = new ArrayList<Attribute>();
            Attribute nestedAtt = new ComplexAttributeImpl(contents, attribute.getDescriptor(),
                    attribute.getIdentifier());
            nestedAttContents.add(nestedAtt);
            attribute.setValue(nestedAttContents);
           
            return nestedAtt;
View Full Code Here

        ComplexTypeImpl at = new ComplexTypeImpl(myType, propertyDescriptors, false, false,
                Collections.EMPTY_LIST, null, null);

        AttributeDescriptorImpl ai = new AttributeDescriptorImpl(at, myType, 0, 0, false, null);

        return new ComplexAttributeImpl(properties, ai, null);
    }
View Full Code Here

        ComplexTypeImpl at = new ComplexTypeImpl(myType, propertyDescriptors, false, false,
                Collections.EMPTY_LIST, null, null);

        AttributeDescriptorImpl ai = new AttributeDescriptorImpl(at, myType, 0, 0, false, null);

        return new ComplexAttributeImpl(properties, ai, null);
    }
View Full Code Here

                // 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*
 
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.ComplexAttributeImpl

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.