All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.javaetmoi.javabean.bean.Item Maven / Gradle / Ivy

Go to download

The JavaBeanMarshaller class is responsible for serializing an object (graph) to it's Java code.

There is a newer version: 1.0.3
Show newest version
package com.javaetmoi.javabean.bean;

/**
 * Wraps an item value in order to rework it before generating code.
 * 

* Usage: *

    *
  • Key or value of a Map
  • *
  • Value of an array
  • *
  • Custom generator
  • *
*/ public class Item { /** * Wrapped value. */ private Object val; /** * Class of the value. */ private final Class clazz; /** * Javapoet expression. */ private String pattern = "$L"; /** * Item constructor. * * @param val value to wrap */ public Item(Object val) { this.val = val; this.clazz = val.getClass(); } public void setVal(Object val) { this.val = val; } public Object getVal() { return val; } public Class getClazz() { return clazz; } public String getPattern() { return pattern; } public void setPattern(String pattern) { this.pattern = pattern; } public void appendAfterVal(String str) { val = val + str; } public void appendBeforeVal(String str) { val = str + val; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy