Package com.fasterxml.jackson.databind.introspect

Examples of com.fasterxml.jackson.databind.introspect.AnnotatedMethod


        String[] methodNames = new String[] {
                "getX", "getY", "get3", "get4", "get5", "get6", "get7"
        };
        for (String methodName : methodNames) {
            Method method = BeanN.class.getDeclaredMethod(methodName);
            AnnotatedMethod annMethod = new AnnotatedMethod(method, null, null);
            coll.addIntGetter(new BeanPropertyWriter(SimpleBeanPropertyDefinition.construct(null, annMethod, methodName),
                    annMethod, null,
                    null,
                    null, null, null,
                    false, null));
View Full Code Here


     */
   
    public void testSingleIntAccessorGeneration() throws Exception
    {
        Method method = Bean1.class.getDeclaredMethod("getX");
        AnnotatedMethod annMethod = new AnnotatedMethod(method, null, null);
        PropertyAccessorCollector coll = new PropertyAccessorCollector(Bean1.class);
        BeanPropertyWriter bpw = new BeanPropertyWriter(SimpleBeanPropertyDefinition.construct(null, annMethod, "x"),
                annMethod, null,
                null,
                null, null, null,
View Full Code Here

            boolean suppressNulls, Object suppressableValue)
         */
       
        for (String methodName : methodNames) {
            Method method = Bean3.class.getDeclaredMethod(methodName);
            AnnotatedMethod annMethod = new AnnotatedMethod(method, null, null);
            // should we translate from method name to property name?
            coll.addIntGetter(new BeanPropertyWriter(SimpleBeanPropertyDefinition.construct(null, annMethod, methodName),
                    annMethod, null,
                    null,
                    null, null, null,
View Full Code Here

    List<Descriptor> descriptors = new ArrayList<Descriptor>();

    for (BeanPropertyDefinition definition : new JacksonMetadata(mapper, type)) {

      AnnotatedMethod getter = definition.getGetter();
      Description description = getter.getAnnotation(Description.class);
      ResourceDescription fallback = SimpleResourceDescription.defaultFor(String.format("%s.%s", name,
          definition.getName()));
      ResourceDescription resourceDescription = description == null ? null : new AnnotationBasedResourceDescription(
          description, fallback);
View Full Code Here

    @Override
    public List<BeanPropertyWriter> changeProperties(SerializationConfig config,
        BeanDescription beanDesc, List<BeanPropertyWriter> beanProperties) {
      List<BeanPropertyWriter> result = new ArrayList<BeanPropertyWriter>();
      for (BeanPropertyWriter writer : beanProperties) {
        AnnotatedMethod setter = beanDesc.findMethod(
            "set" + StringUtils.capitalize(writer.getName()),
            new Class<?>[] { writer.getPropertyType() });
        if (setter != null
            && this.conversionService.canConvert(String.class,
                writer.getPropertyType())) {
View Full Code Here

    @Override
    public List<BeanPropertyWriter> changeProperties(SerializationConfig config,
        BeanDescription beanDesc, List<BeanPropertyWriter> beanProperties) {
      List<BeanPropertyWriter> result = new ArrayList<BeanPropertyWriter>();
      for (BeanPropertyWriter writer : beanProperties) {
        AnnotatedMethod setter = beanDesc.findMethod(
            "set" + StringUtils.capitalize(writer.getName()),
            new Class<?>[] { writer.getPropertyType() });
        if (setter != null
            && this.conversionService.canConvert(String.class,
                writer.getPropertyType())) {
View Full Code Here

            if (LOG.isLoggable(Level.FINE)) {
                LOG.fine("Ignoring transient member " + m);
            }
            return true;
        } else if (m instanceof AnnotatedMethod) {
            AnnotatedMethod method = (AnnotatedMethod) m;
            String methodName = method.getName();
            // lets see if there is a transient field of the same name as the getter
            if (methodName.startsWith("get") && method.getParameterCount() == 0) {
                String fieldName = Introspector.decapitalize(methodName.substring(3));
                Class<?> declaringClass = method.getDeclaringClass();
                Field field = findField(fieldName, declaringClass);
                if (field != null) {
                    int fieldModifiers = field.getModifiers();
                    if (Modifier.isTransient(fieldModifiers)) {
                        LOG.fine("Ignoring member " + m + " due to transient field called " + fieldName);
View Full Code Here

            if (LOG.isDebugEnabled()) {
                LOG.debug("Ignoring transient member " + m);
            }
            return true;
        } else if (m instanceof AnnotatedMethod) {
            AnnotatedMethod method = (AnnotatedMethod) m;
            String methodName = method.getName();
            // lets see if there is a transient field of the same name as the getter
            if (methodName.startsWith("get") && method.getParameterCount() == 0) {
                String fieldName = Introspector.decapitalize(methodName.substring(3));
                Class<?> declaringClass = method.getDeclaringClass();
                Field field = findField(fieldName, declaringClass);
                if (field != null) {
                    int fieldModifiers = field.getModifiers();
                    if (Modifier.isTransient(fieldModifiers)) {
                        if (LOG.isDebugEnabled()) {
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.databind.introspect.AnnotatedMethod

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.