Package org.apache.aries.blueprint.jaxb

Examples of org.apache.aries.blueprint.jaxb.Targument


            // process args
            Arg[] args = bean.args();
           
            if (args.length > 0) {
                for (int i = 0; i < args.length; i++) {
                    Targument targ = createTargument(args[i]);
                    if (targ != null) {
                        props.add(targ);
                    }
                }
            }
           
            Field[] fields = clazz.getDeclaredFields();
            for (int i = 0; i < fields.length; i++) {
                if (fields[i].isAnnotationPresent(Inject.class)) {
                    if (fields[i].isAnnotationPresent(Reference.class)) {
                        // the field is also annotated with @Reference
                        Reference ref = (Reference)fields[i].getAnnotation(Reference.class);
                        Treference tref = generateTref(ref, reflMap);
                        components.add(tref);
                    } else if (fields[i].isAnnotationPresent(ReferenceList.class)) {
                        // the field is also annotated with @ReferenceList
                        ReferenceList ref = (ReferenceList)fields[i].getAnnotation(ReferenceList.class);
                        TreferenceList tref = generateTrefList(ref, reflMap);
                        components.add(tref);
                       
                    } else {
                        Tproperty tp = createTproperty(fields[i].getName(), fields[i].getAnnotation(Inject.class));
                        props.add(tp);
                    }
                }
            }
                   
            // check if the bean also declares init, destroy or inject annotation on methods
            Method[] methods = clazz.getDeclaredMethods();
            for (int i = 0; i < methods.length; i++) {
                if (methods[i].isAnnotationPresent(Init.class)) {
                    tbean.setInitMethod(methods[i].getName());
                } else if (methods[i].isAnnotationPresent(Destroy.class)) {
                    tbean.setDestroyMethod(methods[i].getName());
                } else if (methods[i].isAnnotationPresent(Inject.class)) {
                    String propertyName = convertFromMethodName(methods[i].getName());
                    Tproperty tp = createTproperty(propertyName, methods[i].getAnnotation(Inject.class));
                    props.add(tp)
                } else if (methods[i].isAnnotationPresent(Arg.class)) {
                    Targument targ = createTargument(methods[i].getAnnotation(Arg.class));
                    props.add(targ);    
                }
            }
           
            // check if the bean also declares service
View Full Code Here


    }

    private Targument createTargument(Arg arg) {
        String value = arg.value();
        String ref = arg.ref();
        Targument targ = null;
        if (value.length() > 0) {
            targ = new Targument();
            targ.setValueAttribute(value);
        }
       
        if (ref.length() > 0) {
            if (targ == null) {
                targ = new Targument();
            }
           
            targ.setRefAttribute(ref);
        }
       
        // TODO process description, index of Arg annotation
        return targ;
    }
View Full Code Here

            // process args
            Arg[] args = bean.args();
           
            if (args.length > 0) {
                for (int i = 0; i < args.length; i++) {
                    Targument targ = createTargument(args[i]);
                    if (targ != null) {
                        props.add(targ);
                    }
                }
            }
           
            Field[] fields = clazz.getDeclaredFields();
            for (int i = 0; i < fields.length; i++) {
                if (fields[i].isAnnotationPresent(Inject.class)) {
                    if (fields[i].isAnnotationPresent(Reference.class)) {
                        // the field is also annotated with @Reference
                        Reference ref = fields[i].getAnnotation(Reference.class);
                        Treference tref = generateTref(ref, reflMap);
                        components.add(tref);
                    } else if (fields[i].isAnnotationPresent(ReferenceList.class)) {
                        // the field is also annotated with @ReferenceList
                        ReferenceList ref = fields[i].getAnnotation(ReferenceList.class);
                        TreferenceList tref = generateTrefList(ref, reflMap);
                        components.add(tref);
                       
                    } else {
                        Tproperty tp = createTproperty(fields[i].getName(), fields[i].getAnnotation(Inject.class));
                        props.add(tp);
                    }
                }
            }
                   
            // check if the bean also declares init, destroy or inject annotation on methods
            Method[] methods = clazz.getDeclaredMethods();
            for (int i = 0; i < methods.length; i++) {
                if (methods[i].isAnnotationPresent(Init.class)) {
                    tbean.setInitMethod(methods[i].getName());
                } else if (methods[i].isAnnotationPresent(Destroy.class)) {
                    tbean.setDestroyMethod(methods[i].getName());
                } else if (methods[i].isAnnotationPresent(Inject.class)) {
                    String propertyName = convertFromMethodName(methods[i].getName());
                    Tproperty tp = createTproperty(propertyName, methods[i].getAnnotation(Inject.class));
                    props.add(tp)
                } else if (methods[i].isAnnotationPresent(Arg.class)) {
                    Targument targ = createTargument(methods[i].getAnnotation(Arg.class));
                    props.add(targ);    
                }
            }
           
            // check if the bean also declares service
View Full Code Here

    }

    private Targument createTargument(Arg arg) {
        String value = arg.value();
        String ref = arg.ref();
        Targument targ = null;
        if (value.length() > 0) {
            targ = new Targument();
            targ.setValueAttribute(value);
        }
       
        if (ref.length() > 0) {
            if (targ == null) {
                targ = new Targument();
            }
           
            targ.setRefAttribute(ref);
        }
       
        // TODO process description, index of Arg annotation
        return targ;
    }
View Full Code Here

            // process args
            Arg[] args = bean.args();
           
            if (args.length > 0) {
                for (int i = 0; i < args.length; i++) {
                    Targument targ = createTargument(args[i]);
                    if (targ != null) {
                        props.add(targ);
                    }
                }
            }
           
            Field[] fields = clazz.getDeclaredFields();
            for (int i = 0; i < fields.length; i++) {
                if (fields[i].isAnnotationPresent(Inject.class)) {
                    if (fields[i].isAnnotationPresent(Reference.class)) {
                        // the field is also annotated with @Reference
                        Reference ref = (Reference)fields[i].getAnnotation(Reference.class);
                        Treference tref = generateTref(ref, reflMap);
                        components.add(tref);
                    } else if (fields[i].isAnnotationPresent(ReferenceList.class)) {
                        // the field is also annotated with @ReferenceList
                        ReferenceList ref = (ReferenceList)fields[i].getAnnotation(ReferenceList.class);
                        TreferenceList tref = generateTrefList(ref, reflMap);
                        components.add(tref);
                       
                    } else {
                        Tproperty tp = createTproperty(fields[i].getName(), fields[i].getAnnotation(Inject.class));
                        props.add(tp);
                    }
                }
            }
                   
            // check if the bean also declares init, destroy or inject annotation on methods
            Method[] methods = clazz.getDeclaredMethods();
            for (int i = 0; i < methods.length; i++) {
                if (methods[i].isAnnotationPresent(Init.class)) {
                    tbean.setInitMethod(methods[i].getName());
                } else if (methods[i].isAnnotationPresent(Destroy.class)) {
                    tbean.setDestroyMethod(methods[i].getName());
                } else if (methods[i].isAnnotationPresent(Inject.class)) {
                    String propertyName = convertFromMethodName(methods[i].getName());
                    Tproperty tp = createTproperty(propertyName, methods[i].getAnnotation(Inject.class));
                    props.add(tp)
                } else if (methods[i].isAnnotationPresent(Arg.class)) {
                    Targument targ = createTargument(methods[i].getAnnotation(Arg.class));
                    props.add(targ);    
                }
            }
           
            // check if the bean also declares service
View Full Code Here

    }

    private Targument createTargument(Arg arg) {
        String value = arg.value();
        String ref = arg.ref();
        Targument targ = null;
        if (value.length() > 0) {
            targ = new Targument();
            targ.setValueAttribute(value);
        }
       
        if (ref.length() > 0) {
            if (targ == null) {
                targ = new Targument();
            }
           
            targ.setRefAttribute(ref);
        }
       
        // TODO process description, index of Arg annotation
        return targ;
    }
View Full Code Here

TOP

Related Classes of org.apache.aries.blueprint.jaxb.Targument

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.