Examples of IllegalAttributeException


Examples of org.geotools.feature.IllegalAttributeException

    public static void assertOrderAssignable( SimpleFeatureType expected, SimpleFeatureType actual){
        // check feature type name
        String expectedName = expected.getName().getLocalPart();
        String actualName = actual.getName().getLocalPart();
        if( !expectedName.equals( actualName ) ){
            throw new IllegalAttributeException("Expected '"+expectedName+"' but was supplied '"+actualName+"'.");           
        }
        // check attributes names
        if( expected.getAttributeCount() != actual.getAttributeCount() ){
            throw new IllegalAttributeException("Expected "+expected.getAttributeCount()+" attributes, but was supplied "+actual.getAttributeCount() );
        }
        for( int i=0; i< expected.getAttributeCount(); i++){
            Class<?> expectedBinding = expected.getDescriptor(i).getType().getBinding();
            Class<?> actualBinding = actual.getDescriptor(i).getType().getBinding();
            if( !actualBinding.isAssignableFrom( expectedBinding )){
View Full Code Here

Examples of org.geotools.feature.IllegalAttributeException

        }

        // empty is allows, in such a case, content should be empty
        if (type.getDescriptors().isEmpty()) {
            if (!content.isEmpty()) {
                throw new IllegalAttributeException(attribute.getDescriptor(),
                        "Type indicates empty attribute collection, content does not");
            }

            // we are done
            return;
View Full Code Here

Examples of org.geotools.feature.IllegalAttributeException

                    citr.remove();
                }
            }

            if (occurences < ad.getMinOccurs() || occurences > ad.getMaxOccurs()) {
                throw new IllegalAttributeException(ad, "Found " + occurences + " of "
                        + ad.getName() + " when type" + "specifies between " + min + " and " + max);
            }
        }

        if (!remaining.isEmpty()) {
            throw new IllegalAttributeException((AttributeDescriptor) remaining.iterator().next(),
                    "Extra content found beyond the specified in the schema: " + remaining);
        }

    } 
View Full Code Here

Examples of org.geotools.feature.IllegalAttributeException

        // the ones that are ignorable by the renderer
        assertNotNull(forceRenderingError(new TransformException("fake transform exception")));
        assertNotNull(forceRenderingError(new NoninvertibleTransformException(
                "fake non invertible exception")));
        assertNotNull(forceRenderingError(new IllegalAttributeException(
                "non illegal attribute exception")));
        assertNotNull(forceRenderingError(new FactoryException("fake factory exception")));

        // any other one should make the map producer fail
        try {
View Full Code Here

Examples of org.geotools.feature.IllegalAttributeException

        // the ones that are ignorable by the renderer
        assertNotNull(forceRenderingError(new TransformException("fake transform exception")));
        assertNotNull(forceRenderingError(new NoninvertibleTransformException(
                "fake non invertible exception")));
        assertNotNull(forceRenderingError(new IllegalAttributeException(
                "non illegal attribute exception")));
        assertNotNull(forceRenderingError(new FactoryException("fake factory exception")));

        // any other one should make the map producer fail
        try {
View Full Code Here

Examples of org.opengis.feature.IllegalAttributeException

      newFeature.setAttribute(geoAttName, adaptedGeometry);

      return newFeature;

    } catch (IllegalAttributeException e) {
      throw new IllegalAttributeException(null, null, e.getMessage());
    }
  }
View Full Code Here

Examples of org.opengis.feature.IllegalAttributeException

    @Override
    public void setAttribute(String name, Object value) {
        final Integer revTypeIndex = nameToRevTypeIndex.get(name);
        if (revTypeIndex == null) {
            throw new IllegalAttributeException(null, "Unknown attribute " + name);
        }
        setAttribute(revTypeIndex.intValue(), value);
    }
View Full Code Here

Examples of org.opengis.feature.IllegalAttributeException

            att = s.readObject();
        } else if (m == FEATURE) {
            SimpleFeature f = unmarshall(s);
            att = f;
        } else { // this should never happen
            throw new IllegalAttributeException(null, null, "Found complex attribute which is not legal for SimpleFeature.");
        }

        return att;
    }
View Full Code Here

Examples of org.opengis.feature.IllegalAttributeException

        //
        // I have lost hope and am returning the orgional reference
        // Please extend this to support additional classes.
        //
        // And good luck getting Cloneable to work
        throw new IllegalAttributeException(null, "Do not know how to deep copy " + type.getName());
    }
View Full Code Here

Examples of org.opengis.feature.IllegalAttributeException

                } else {
                    throw new IllegalArgumentException("Argument is not a geometry: " + value);
                }
            }
            if (object instanceof FeatureType) {
                throw new IllegalAttributeException(null, "feature type is immutable");
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.