Package org.geotools.feature.type

Examples of org.geotools.feature.type.AttributeTypeImpl


 
  public void setUp() throws Exception
  {
    super.setUp();
   
    AttributeTypeImpl textAttributeType = new AttributeTypeImpl( new NameImpl( "textType" ), String.class, false, false, null, null, null );
    AttributeTypeImpl numericAttributeType = new AttributeTypeImpl( new NameImpl( "numericType" ), Number.class, false, false, null, null, null );
   
    AttributeDescriptor attribute1 = new AttributeDescriptorImpl( textAttributeType, new NameImpl( TEXT_ATTRIBUTE_ID ), 0, 0, true, null );
    AttributeDescriptor attribute2 = new AttributeDescriptorImpl( numericAttributeType, new NameImpl( NUMERIC_ATTRIBUTE_ID ), 0, 100, true, null );
   
    SimpleFeatureType featureType = new SimpleFeatureTypeImpl( new NameImpl( "test" ),
View Full Code Here


        Name fName = new NameImpl(EG, "complexFeatureType");

        Collection<PropertyDescriptor> schema = new ArrayList<PropertyDescriptor>();

        // add simple attribute
        AttributeType attType = new AttributeTypeImpl(SIMPLE_ATTRIBUTE, String.class, false, false,
                Collections.EMPTY_LIST, null, null);

        AttributeDescriptor attDesc = new AttributeDescriptorImpl(attType, SIMPLE_ATTRIBUTE, 0, 1,
                true, null);

        schema.add(attDesc);

        // build nested attributes

        Collection<PropertyDescriptor> rootProperties = new ArrayList<PropertyDescriptor>();

        attType = new AttributeTypeImpl(SINGLE_LEAF_ATTRIBUTE, String.class, false, false,
                Collections.EMPTY_LIST, null, null);
        attDesc = new AttributeDescriptorImpl(attType, SINGLE_LEAF_ATTRIBUTE, 0, 1, true, null);
        rootProperties.add(attDesc);

        attType = new AttributeTypeImpl(MULTI_LEAF_ATTRIBUTE, String.class, false, false,
                Collections.EMPTY_LIST, null, null);
        attDesc = new AttributeDescriptorImpl(attType, MULTI_LEAF_ATTRIBUTE, 0, -1, true, null);
        rootProperties.add(attDesc);

        attType = new ComplexTypeImpl(ROOT_ATTRIBUTE, rootProperties, false, false,
View Full Code Here

        Object defaultValue = override.getDefaultValue();
        if( defaultValue == null ) defaultValue = type.getDefaultValue();
       
        // WARNING cannot copy metadata!       
        return new AttributeDescriptorImpl(
            new AttributeTypeImpl( new NameImpl( name ), javaType, false, false, restrictions, null, null ),
            new NameImpl( name ), min, max, isNilable, defaultValue
        );
    }
View Full Code Here

            if (Geometry.class.isAssignableFrom(clazz)) {
                GeometryType at = new GeometryTypeImpl(new NameImpl(name), clazz, crs, false,
                        false, Collections.EMPTY_LIST, null, null);
                return new GeometryDescriptorImpl(at, new NameImpl(name), 0, 1, nillable, null);
            } else {
                AttributeType at = new AttributeTypeImpl(new NameImpl(name), clazz, false, false,
                        Collections.EMPTY_LIST, null, null);
                return new AttributeDescriptorImpl(at, new NameImpl(name), 0, 1, nillable, null);
            }
        } catch (ClassNotFoundException e) {
            throw new SchemaException("Could not type " + name + " as:" + type, e);
View Full Code Here

                //
                final Class<?> cls = eAttribute().getEAttributeType().getInstanceClass();
                //
                // Create anonymous attribute type implementation
                //
                attributeType = new AttributeTypeImpl(getName(), cls, eIsID, false,
                        Collections.<Filter> emptyList(), null, null) {
                    @Override
                    public Object parse(Object value) throws IllegalArgumentException {
                        return DataBuilder.parse(cls, value);
                    }
View Full Code Here

        List<PropertyDescriptor> propertyDescriptors = new ArrayList<PropertyDescriptor>();

        Name attName = new NameImpl("codeSpace");
        // Name name, Class<?> binding, boolean isAbstract, List<Filter> restrictions,
        // PropertyType superType, InternationalString description
        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(codeSpace, 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));
View Full Code Here

        // assume attributes from same namespace as typename

        Name attName = new NameImpl("uom");
        // Name name, Class<?> binding, boolean isAbstract, List<Filter> restrictions,
        // PropertyType superType, InternationalString description
        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));
View Full Code Here

     * Make sure no xlink:href is created if id is not set.
     *
     * @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

     * Test xlink:href returns gml:id.
     *
     * @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();
View Full Code Here

        assertTrue(desc.get(0).getLocalName().equals(propNames[0]));
        assertTrue(desc.get(1).getLocalName().equals(propNames[1]));
    }
   
    public void testAddMandatoryProperties() {
        AttributeType at = new AttributeTypeImpl(new NameImpl("String"), String.class, false,
                false, Collections.EMPTY_LIST, null, null);

        AttributeDescriptor descr1 = new AttributeDescriptorImpl(at, new NameImpl("att1"), 0, 1,
                false, null);
        AttributeDescriptor descr2 = new AttributeDescriptorImpl(at, new NameImpl("att2"), 0, 1,
View Full Code Here

TOP

Related Classes of org.geotools.feature.type.AttributeTypeImpl

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.