Package org.apache.tuscany.core.config

Examples of org.apache.tuscany.core.config.MetaDataException


            Annotation[] anotations = method.getAnnotations();
            for (Annotation annotation : anotations) {
                if (Property.class.equals(annotation.annotationType())
                        || Reference.class.equals(annotation.annotationType())) {
                    if (found) {
                        MetaDataException e = new MetaDataException("Method cannot specify both property and reference");
                        e.setIdentifier(method.getName());
                        throw e;
                    }
                    found = true;
                }
            }
        }
        // validate fields do not contain both @Reference and @Property annotations
        Set<Field> fields = JavaIntrospectionHelper.getAllPublicAndProtectedFields(clazz);
        for (Field field : fields) {
            found = false;
            Annotation[] anotations = field.getAnnotations();
            for (Annotation annotation : anotations) {
                if (Property.class.equals(annotation.annotationType())
                        || Reference.class.equals(annotation.annotationType())) {
                    if (found) {
                        MetaDataException e = new MetaDataException("Field cannot specify both property and reference");
                        e.setIdentifier(field.getName());
                        throw e;
                    }
                    found = true;
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.config.MetaDataException

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.