Package org.apache.tuscany.core.config

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


    @Override
    public void visitMethod(Method method, ComponentType type) throws ConfigurationLoadException {
        ParentContext annotation = method.getAnnotation(ParentContext.class);
        if (annotation != null) {
            if (!Modifier.isPublic(method.getModifiers())) {
                InvalidSetterException e = new InvalidSetterException("ParentContext setter method is not public");
                e.setIdentifier(method.toString());
                throw e;
            }
            if (method.getParameterTypes().length != 1
                    && !CompositeContext.class.isAssignableFrom(method.getParameterTypes()[0])) {
                InvalidSetterException e = new InvalidSetterException("ParentContext setter method must have one parameter of type " + CompositeContext.class.getName());
                e.setIdentifier(method.toString());
                throw e;
            }
            type.getExtensibilityElements().add(new ParentContextExtensibilityElement(method));
        }
    }
View Full Code Here


    public void visitField(Field field, ComponentType type) throws ConfigurationLoadException {
        int modifiers = field.getModifiers();
        ParentContext annotation = field.getAnnotation(ParentContext.class);
        if (annotation != null) {
            if (!Modifier.isPublic(modifiers) && !Modifier.isProtected(modifiers)) {
                InvalidSetterException e = new InvalidSetterException("ParentContext field is not public or protected");
                e.setIdentifier(field.getName());
                throw e;
            }
            type.getExtensibilityElements().add(new ParentContextExtensibilityElement(field));
        }
    }
View Full Code Here

    @Override
    public void visitMethod(Method method, ComponentType type) throws ConfigurationLoadException {
        Autowire annotation = method.getAnnotation(Autowire.class);
        if (annotation != null) {
            if (!Modifier.isPublic(method.getModifiers())) {
                InvalidSetterException e = new InvalidSetterException("Autowire setter method is not public");
                e.setIdentifier(method.toString());
                throw e;
            }
            if (method.getParameterTypes().length != 1){
                InvalidSetterException e = new InvalidSetterException("Autowire setter method must have one parameter");
                e.setIdentifier(method.toString());
                throw e;
            }
            checkAutowireType(method.getParameterTypes()[0],method.getDeclaringClass());
            type.getExtensibilityElements().add(new AutowireExtensibilityElement(method));
        }
View Full Code Here

        checkAutowireType(field.getType(),field.getDeclaringClass());
        int modifiers = field.getModifiers();
        Autowire annotation = field.getAnnotation(Autowire.class);
        if (annotation != null) {
            if (!Modifier.isPublic(modifiers) && !Modifier.isProtected(modifiers)) {
                InvalidSetterException e = new InvalidSetterException("Autowire field is not public or protected");
                e.setIdentifier(field.getName());
                throw e;
            }
            type.getExtensibilityElements().add(new AutowireExtensibilityElement(field));
        }
    }
View Full Code Here

    @Override
    public void visitMethod(Method method, ComponentType type) throws ConfigurationLoadException {
        Monitor annotation = method.getAnnotation(Monitor.class);
        if (annotation != null) {
            if (!Modifier.isPublic(method.getModifiers())) {
                InvalidSetterException e = new InvalidSetterException("Monitor setter method is not public");
                e.setIdentifier(method.toString());
                throw e;
            }
            if (method.getParameterTypes().length != 1) {
                InvalidSetterException e = new InvalidSetterException("Monitor setter method must have one parameter");
                e.setIdentifier(method.toString());
                throw e;
            }
            type.getExtensibilityElements().add(new MonitorExtensibilityElement(method));
        }
    }
View Full Code Here

    public void visitField(Field field, ComponentType type) throws ConfigurationLoadException {
        int modifiers = field.getModifiers();
        Monitor annotation = field.getAnnotation(Monitor.class);
        if (annotation != null) {
            if (!Modifier.isPublic(modifiers) && !Modifier.isProtected(modifiers)) {
                InvalidSetterException e = new InvalidSetterException("Monitor field is not public or protected");
                e.setIdentifier(field.getName());
                throw e;
            }
            type.getExtensibilityElements().add(new MonitorExtensibilityElement(field));
        }
    }
View Full Code Here

            return;
        }
        SDOHelper annotation = method.getAnnotation(SDOHelper.class);
        if (annotation != null) {
            if (!Modifier.isPublic(method.getModifiers())) {
                InvalidSetterException e = new InvalidSetterException("SDO setter method is not public");
                e.setIdentifier(method.toString());
                throw e;
            }
            Class<?>[] params = method.getParameterTypes();
            if (params.length != 1) {
                InvalidSetterException e = new InvalidSetterException("SDO setter method must have one parameter");
                e.setIdentifier(method.toString());
                throw e;
            }
            type.getExtensibilityElements().add(new SDOHelperExtensibilityElement(method));

        }
View Full Code Here

        }
        int modifiers = field.getModifiers();
        SDOHelper annotation = field.getAnnotation(SDOHelper.class);
        if (annotation != null) {
            if (!Modifier.isPublic(modifiers) && !Modifier.isProtected(modifiers)) {
                InvalidSetterException e = new InvalidSetterException("Property field is not public or protected");
                e.setIdentifier(field.getName());
                throw e;
            }
            type.getExtensibilityElements().add(new SDOHelperExtensibilityElement(field));
        }
    }
View Full Code Here

        }
        int modifiers = method.getModifiers();
        org.osoa.sca.annotations.Reference annotation = method.getAnnotation(org.osoa.sca.annotations.Reference.class);
        if (annotation != null) {
            if (!Modifier.isPublic(modifiers)) {
                InvalidSetterException e = new InvalidSetterException("Reference setter method is not public");
                e.setIdentifier(method.getName());
                throw e;
            }
            if (!Void.TYPE.equals(method.getReturnType())) {
                InvalidSetterException e = new InvalidSetterException("Refence setter method must return void");
                e.setIdentifier(method.toString());
                throw e;
            }
            Class<?>[] params = method.getParameterTypes();
            if (params.length != 1) {
                InvalidSetterException e = new InvalidSetterException("Reference setter method must have one parameter");
                e.setIdentifier(method.toString());
                throw e;
            }
            String name = annotation.name();
            if (name.length() == 0) {
                name = method.getName();
View Full Code Here

        }
        int modifiers = field.getModifiers();
        org.osoa.sca.annotations.Reference annotation = field.getAnnotation(org.osoa.sca.annotations.Reference.class);
        if (annotation != null) {
            if (!Modifier.isPublic(modifiers) && !Modifier.isProtected(modifiers)) {
                InvalidSetterException e = new InvalidSetterException("Reference field is not public or protected");
                e.setIdentifier(field.getName());
                throw e;
            }
            String name = annotation.name();
            if (name.length() == 0) {
                name = field.getName();
View Full Code Here

TOP

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

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.