Package org.jgroups.annotations

Examples of org.jgroups.annotations.Property.converter()


            for(Field field: fields) {
                if(field.isAnnotationPresent(Property.class)) {
                    Object value=Configurator.getField(field, prot);
                    if(value != null) {
                        annotation=field.getAnnotation(Property.class);
                        Class<?> conv_class=annotation.converter();
                        PropertyConverter conv=null;
                        try {
                            conv=(PropertyConverter)conv_class.newInstance();
                        }
                        catch(Exception e) {
View Full Code Here


                    possible_names.add(Configurator.renameFromJavaCodingConvention(methodName.substring(3)));
                    Field field=findField(prot, possible_names);
                    if(field != null) {
                        Object value=Configurator.getField(field, prot);
                        if(value != null) {
                            Class<?> conv_class=annotation.converter();
                            PropertyConverter conv=null;
                            try {
                                conv=(PropertyConverter)conv_class.newInstance();
                            }
                            catch(Exception e) {
View Full Code Here

                Property annotation=method.getAnnotation(Property.class);
                String propertyName=annotation.name().length() > 0? annotation.name() : methodName.substring(3);
                propertyName=renameFromJavaCodingConvention(propertyName);
                String prop=props.getProperty(propertyName);
                if(prop != null) {
                    PropertyConverter propertyConverter=(PropertyConverter)annotation.converter().newInstance();
                    if(propertyConverter == null) {
                        String name=obj instanceof Protocol? ((Protocol)obj).getName() : obj.getClass().getName();
                        throw new Exception("Could not find property converter for field " + propertyName
                                + " in " + name);
                    }
View Full Code Here

                        if(isDeprecated && log.isWarnEnabled()) {
                            log.warn(annotation.deprecatedMessage());
                        }
                    }
                    String propertyValue=props.getProperty(propertyName);
                    if(propertyValue != null || !annotation.converter().equals(PropertyConverters.Default.class)){
                        PropertyConverter propertyConverter=(PropertyConverter)annotation.converter().newInstance();
                        if(propertyConverter == null) {
                            String name=obj instanceof Protocol? ((Protocol)obj).getName() : obj.getClass().getName();
                            throw new Exception("Could not find property converter for field " + propertyName
                                    + " in " + name);
View Full Code Here

                            log.warn(annotation.deprecatedMessage());
                        }
                    }
                    String propertyValue=props.getProperty(propertyName);
                    if(propertyValue != null || !annotation.converter().equals(PropertyConverters.Default.class)){
                        PropertyConverter propertyConverter=(PropertyConverter)annotation.converter().newInstance();
                        if(propertyConverter == null) {
                            String name=obj instanceof Protocol? ((Protocol)obj).getName() : obj.getClass().getName();
                            throw new Exception("Could not find property converter for field " + propertyName
                                    + " in " + name);
                        }
View Full Code Here

              field.getName() + " which is not annotated with @Property") ;
        }
      String propertyName = getPropertyName(field, props) ;
      String name = obj instanceof Protocol? ((Protocol)obj).getName() : obj.getClass().getName();

        PropertyConverter propertyConverter=(PropertyConverter)annotation.converter().newInstance();
        if(propertyConverter == null) {           
          throw new Exception("Could not find property converter for field " + propertyName
              + " in " + name);
        }
        Object converted = null ;
View Full Code Here

                        field.getName() + " which is not annotated with @Property");
            }
            String propertyName=field.getName();
            String name=obj instanceof Protocol? ((Protocol)obj).getName() : obj.getClass().getName();

            PropertyConverter propertyConverter=(PropertyConverter)annotation.converter().newInstance();
            if(propertyConverter == null) {
                throw new Exception("Could not find property converter for field " + propertyName
                        + " in " + name);
            }
            Object converted=null;
View Full Code Here

          throw new IllegalArgumentException("Cannot get property name for method " +
              method.getName() + " which is not annotated with @Property") ;
        }
        String propertyName = getPropertyName(method) ;
        String name = obj instanceof Protocol? ((Protocol)obj).getName() : obj.getClass().getName();
        PropertyConverter propertyConverter=(PropertyConverter)annotation.converter().newInstance();
        if(propertyConverter == null) {           
          throw new Exception("Could not find property converter for method " + propertyName
              + " in " + name);
        }
        Object converted = null ;
View Full Code Here

        Property annotation=field.getAnnotation(Property.class);
        if (annotation == null) {
          throw new IllegalArgumentException("Cannot check converter for field " +
              field.getName() + " which is not annotated with @Property") ;
        }
          return annotation.converter().equals(PropertyConverters.Default.class) ;
        }
       
    }
View Full Code Here

            for(Field field: fields) {
                if(field.isAnnotationPresent(Property.class)) {
                    Object value=Util.getField(field, prot);
                    if(value != null) {
                        annotation=field.getAnnotation(Property.class);
                        Class<?> conv_class=annotation.converter();
                        PropertyConverter conv=null;
                        try {
                            conv=(PropertyConverter)conv_class.newInstance();
                        }
                        catch(Exception e) {
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.