9 | * This singleton implementation performs class attribute introspection 10 | * on the basis of class declared fields 11 | *
12 | * 13 | * @author daivanov 14 | * 15 | * @since 5.1.0 16 | * 17 | */ 18 | 19 | public final class DefaultClassInfoStrategy extends 20 | AbstractClassInfoStrategy { 21 | 22 | // ------------------->> Constants 23 | 24 | /** The singleton instance of this implementation */ 25 | private static final DefaultClassInfoStrategy SINGLETON = new DefaultClassInfoStrategy(); 26 | 27 | // ------------------->> Instance / Static variables 28 | 29 | // ------------------->> Constructors 30 | 31 | /** 32 | * Implementation of the Singleton pattern 33 | */ 34 | private DefaultClassInfoStrategy() { 35 | super(); 36 | } 37 | 38 | // ------------------->> Public methods 39 | 40 | /** 41 | * Implementation of the Singleton pattern 42 | * 43 | * @return A singleton instance of this class 44 | */ 45 | public static DefaultClassInfoStrategy getInstance() { 46 | return SINGLETON; 47 | } 48 | 49 | // ------------------->> Getters / Setters 50 | 51 | // ------------------->> Private methods 52 | 53 | // ------------------->> equals() / hashcode() / toString() 54 | 55 | // ------------------->> Inner classes 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/uk/co/jemos/podam/api/MapArguments.java: -------------------------------------------------------------------------------- 1 | package uk.co.jemos.podam.api; 2 | 3 | import java.io.Serializable; 4 | import java.lang.reflect.Type; 5 | 6 | /** 7 | * Pojo which contains the arguments required to fill a Map as a POJO attribute 8 | * 9 | * @author Marco Tedone 10 | * 11 | */ 12 | public class MapArguments extends AbstractMapArguments implements Serializable { 13 | 14 | private static final long serialVersionUID = 1L; 15 | 16 | /** The type of the Map element. */ 17 | private Class> elementClass; 18 | 19 | /** 20 | * The generic type arguments for the current key generic class instance. 21 | */ 22 | private Type[] keyGenericTypeArgs; 23 | 24 | /** 25 | * The generic type arguments for the current element generic class 26 | * instance. 27 | */ 28 | private Type[] elementGenericTypeArgs; 29 | 30 | /** 31 | * @return the elementClass 32 | */ 33 | public Class> getElementClass() { 34 | return elementClass; 35 | } 36 | 37 | /** 38 | * @param elementClass 39 | * the elementClass to set 40 | */ 41 | public void setElementClass(Class> elementClass) { 42 | this.elementClass = elementClass; 43 | } 44 | 45 | /** 46 | * @return the keyGenericTypeArgs 47 | */ 48 | public Type[] getKeyGenericTypeArgs() { 49 | return keyGenericTypeArgs; 50 | } 51 | 52 | /** 53 | * @param keyGenericTypeArgs 54 | * the keyGenericTypeArgs to set 55 | */ 56 | public void setKeyGenericTypeArgs(Type[] keyGenericTypeArgs) { 57 | this.keyGenericTypeArgs = keyGenericTypeArgs.clone(); 58 | } 59 | 60 | /** 61 | * @return the elementGenericTypeArgs 62 | */ 63 | public Type[] getElementGenericTypeArgs() { 64 | return elementGenericTypeArgs; 65 | } 66 | 67 | /** 68 | * @param elementGenericTypeArgs 69 | * the elementGenericTypeArgs to set 70 | */ 71 | public void setElementGenericTypeArgs(Type[] elementGenericTypeArgs) { 72 | this.elementGenericTypeArgs = elementGenericTypeArgs.clone(); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/uk/co/jemos/podam/api/MapKeyOrElementsArguments.java: -------------------------------------------------------------------------------- 1 | package uk.co.jemos.podam.api; 2 | 3 | import java.io.Serializable; 4 | import java.lang.reflect.Type; 5 | 6 | import uk.co.jemos.podam.common.AttributeStrategy; 7 | 8 | /** 9 | * Contains attributes for the arguments to pass to the factory method to fill 10 | * map key or elements. 11 | * 12 | * @author Marco Tedone 13 | * 14 | */ 15 | public class MapKeyOrElementsArguments extends AbstractMapArguments implements 16 | Serializable { 17 | 18 | private static final long serialVersionUID = 1L; 19 | 20 | /** The strategy to use to fill the Map key or value element. */ 21 | private AttributeStrategy> elementStrategy; 22 | 23 | /** 24 | * The generic type arguments for the current generic class 25 | * instance. 26 | */ 27 | private Type[] genericTypeArgs; 28 | 29 | /** 30 | * @return the elementStrategy 31 | */ 32 | public AttributeStrategy> getElementStrategy() { 33 | return elementStrategy; 34 | } 35 | 36 | /** 37 | * @param elementStrategy 38 | * the elementStrategy to set 39 | */ 40 | public void setElementStrategy(AttributeStrategy> elementStrategy) { 41 | this.elementStrategy = elementStrategy; 42 | } 43 | 44 | /** 45 | * @return the genericTypeArgs 46 | */ 47 | public Type[] getGenericTypeArgs() { 48 | return genericTypeArgs; 49 | } 50 | 51 | /** 52 | * @param genericTypeArgs 53 | * the genericTypeArgs to set 54 | */ 55 | public void setGenericTypeArgs(Type[] genericTypeArgs) { 56 | this.genericTypeArgs = genericTypeArgs.clone(); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/uk/co/jemos/podam/api/NullExternalFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package uk.co.jemos.podam.api; 5 | 6 | 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | import java.lang.reflect.Type; 11 | import java.util.Arrays; 12 | 13 | /** 14 | * Default implementation of an external factory which does nothing. 15 | * 16 | * @author daivanov 17 | * 18 | * @since 4.3.0 19 | * 20 | */ 21 | public class NullExternalFactory extends AbstractExternalFactory { 22 | 23 | // ------------------->> Constants 24 | 25 | /** Application logger */ 26 | private static final Logger LOG = LoggerFactory.getLogger(NullExternalFactory.class); 27 | 28 | // ------------------->> Constructors 29 | 30 | /** 31 | * Implementation of the Singleton pattern 32 | */ 33 | private NullExternalFactory() { 34 | } 35 | 36 | // ------------------->> Public methods 37 | 38 | /** 39 | * Instantiation method 40 | * 41 | * @return A singleton instance of this class 42 | */ 43 | public static NullExternalFactory getInstance() { 44 | return new NullExternalFactory(); 45 | } 46 | 47 | /** 48 | * {@inheritDoc} 49 | */ 50 | @Override 51 | public