├── src ├── main │ └── java │ │ ├── org │ │ └── azeckoski │ │ │ └── reflectutils │ │ │ ├── refmap │ │ │ ├── package.html │ │ │ ├── FinalizableReference.java │ │ │ ├── FinalizableSoftReference.java │ │ │ ├── FinalizableWeakReference.java │ │ │ └── ReferenceType.java │ │ │ ├── beanutils │ │ │ ├── package.html │ │ │ ├── FieldAdapterManager.java │ │ │ ├── DefaultFieldAdapter.java │ │ │ ├── FieldAdapter.java │ │ │ ├── Resolver.java │ │ │ └── DynaBeanAdapter.java │ │ │ ├── annotations │ │ │ ├── package.html │ │ │ ├── ReflectTransient.java │ │ │ ├── ReflectIncludeStaticFields.java │ │ │ ├── ReflectTransientClassFields.java │ │ │ └── ReflectIgnoreClassFields.java │ │ │ ├── transcoders │ │ │ ├── package.html │ │ │ ├── ObjectEncoder.java │ │ │ ├── Transcoder.java │ │ │ └── TranscoderUtils.java │ │ │ ├── converters │ │ │ ├── package.html │ │ │ ├── api │ │ │ │ ├── BaseConverter.java │ │ │ │ ├── InterfaceConverter.java │ │ │ │ ├── Converter.java │ │ │ │ └── VariableConverter.java │ │ │ ├── DoubleConverter.java │ │ │ ├── ByteConverter.java │ │ │ ├── LongConverter.java │ │ │ ├── FloatConverter.java │ │ │ ├── ShortConverter.java │ │ │ ├── IntegerConverter.java │ │ │ ├── BigIntegerConverter.java │ │ │ ├── SQLDateConverter.java │ │ │ ├── SQLTimeConverter.java │ │ │ ├── BigDecimalConverter.java │ │ │ ├── TimestampConverter.java │ │ │ ├── StringConverter.java │ │ │ ├── ClassConverter.java │ │ │ ├── FileConverter.java │ │ │ ├── CalendarConverter.java │ │ │ ├── CharacterConverter.java │ │ │ ├── URLConverter.java │ │ │ ├── EnumConverter.java │ │ │ ├── CollectionConverter.java │ │ │ ├── BaseDateFormatHolder.java │ │ │ ├── MapConverter.java │ │ │ ├── ArrayConverter.java │ │ │ ├── BooleanConverter.java │ │ │ └── ScalarConverter.java │ │ │ ├── map │ │ │ ├── package.html │ │ │ └── OrderedMap.java │ │ │ ├── Lifecycle.java │ │ │ ├── exceptions │ │ │ ├── FieldnameNotFoundException.java │ │ │ ├── FieldGetValueException.java │ │ │ └── FieldSetValueException.java │ │ │ ├── DateUtils.java │ │ │ ├── package.html │ │ │ ├── TypeReference.java │ │ │ ├── StringUtils.java │ │ │ ├── LifecycleManager.java │ │ │ └── ClassLoaderUtils.java │ │ └── overview.html └── test │ └── java │ └── org │ └── azeckoski │ └── reflectutils │ ├── interfaces │ ├── TestInterfaceOne.java │ └── TestInterfaceFour.java │ ├── classes │ ├── TestNone.java │ ├── TestImplOne.java │ ├── TestExcludeFields.java │ ├── TestBaseOne.java │ ├── TestGettersOnly.java │ ├── TestLoopOne.java │ ├── TestDateSpecial.java │ ├── TestNoPubConstructor.java │ ├── TestImplFour.java │ ├── TestSettersOnly.java │ ├── TestUltraNested.java │ ├── TestCollections.java │ ├── TestExtendBean.java │ ├── TestPeaAndSetters.java │ ├── TestStaticsExclude.java │ ├── TestStaticsInclude.java │ ├── TestPea.java │ ├── TestBeanAndGetters.java │ ├── TestBean.java │ ├── TestTransientFinal.java │ ├── TestCompound.java │ ├── TestFilter.java │ ├── TestEntity.java │ ├── TestHibernateLikeBean.java │ └── TestNesting.java │ ├── annotations │ ├── TestAnnoteClass1.java │ ├── TestAnnote.java │ ├── TestAnnoteField1.java │ ├── TestAnnoteClass2.java │ └── TestAnnoteField2.java │ └── ArrayUtilsTest.java ├── .gitignore ├── readme.txt └── README.md /src/main/java/org/azeckoski/reflectutils/refmap/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | A map for holding soft/weak references to objects (key and values) 4 | 5 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/beanutils/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | The beanutils compatibility classes that add support for dynabeans and dynaclasses 4 | 5 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/annotations/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Marker annotations which are used to control the way the reflect utils work with classes 4 | 5 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/transcoders/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | These transcoders (encoders/decoders) are used to convert java objects => JSON/XML => java objects 4 | 5 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/converters/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | The converters which convert various java objects into other java objects (e.g. string => int, array => string, etc.) 4 | 5 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/map/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | A map implementation which supports insertion order retrieval of the keys and values, fully supports removal and interation 4 | 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/Lifecycle.java: -------------------------------------------------------------------------------- 1 | package org.azeckoski.reflectutils; 2 | 3 | /** 4 | * Interface for objects that wish to participate in lifecycle events. 5 | */ 6 | public interface Lifecycle 7 | { 8 | void shutdown(); 9 | } 10 | -------------------------------------------------------------------------------- /src/test/java/org/azeckoski/reflectutils/interfaces/TestInterfaceOne.java: -------------------------------------------------------------------------------- 1 | package org.azeckoski.reflectutils.interfaces; 2 | 3 | import java.io.Serializable; 4 | 5 | 6 | /** 7 | * Simple test interface which extends one other interface 8 | * 9 | * @author Aaron Zeckoski (azeckoski@gmail.com) 10 | */ 11 | public interface TestInterfaceOne extends Serializable { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/test/java/org/azeckoski/reflectutils/classes/TestNone.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: TestNone.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/test/java/org/azeckoski/reflectutils/classes/TestNone.java $ 4 | * MyNone.java - genericdao - May 18, 2008 10:11:01 PM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski@gmail.com) (aaronz@vt.edu) (aaron@caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.classes; 16 | 17 | /** 18 | * Empty class with no methods or annotations 19 | * 20 | * @author Aaron Zeckoski (azeckoski@gmail.com) 21 | */ 22 | public class TestNone { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/test/java/org/azeckoski/reflectutils/interfaces/TestInterfaceFour.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: TestInterfaceFour.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/test/java/org/azeckoski/reflectutils/interfaces/TestInterfaceFour.java $ 4 | * TestInterfaceFour.java - entity-broker - May 5, 2008 1:29:50 PM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2 8 | * 9 | * A copy of the Apache License, Version 2 has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski@gmail.com) (aaronz@vt.edu) (aaron@caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.interfaces; 16 | 17 | 18 | /** 19 | * Test interface that extends 4 others 20 | * 21 | * @author Aaron Zeckoski (azeckoski@gmail.com) 22 | */ 23 | public interface TestInterfaceFour extends TestInterfaceOne, Runnable, Cloneable, Readable { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/converters/api/BaseConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: BaseConverter.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/main/java/org/azeckoski/reflectutils/converters/api/BaseConverter.java $ 4 | * BaseConverter.java - genericdao - Sep 10, 2008 1:18:32 PM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski @ gmail.com) (aaronz @ vt.edu) (aaron @ caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.converters.api; 16 | 17 | 18 | /** 19 | * This is the common interface for all converters, 20 | * it is empty and just meant to serve as a way to include 21 | * all converters in a common set 22 | * 23 | * @author Aaron Zeckoski (azeckoski @ gmail.com) 24 | */ 25 | public interface BaseConverter { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/refmap/FinalizableReference.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.azeckoski.reflectutils.refmap; 18 | 19 | /** 20 | * Implemented by references that have code to run after garbage collection of 21 | * their referents. 22 | * 23 | * @see FinalizableReferenceQueue 24 | * @author Bob Lee 25 | */ 26 | public interface FinalizableReference { 27 | 28 | /** 29 | * Invoked on a background thread after the referent has been garbage 30 | * collected. 31 | */ 32 | void finalizeReferent(); 33 | } 34 | -------------------------------------------------------------------------------- /src/test/java/org/azeckoski/reflectutils/classes/TestImplOne.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: TestImplOne.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/test/java/org/azeckoski/reflectutils/classes/TestImplOne.java $ 4 | * TestImplOne.java - genericdao - May 18, 2008 10:13:32 PM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski@gmail.com) (aaronz@vt.edu) (aaron@caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.classes; 16 | 17 | import org.azeckoski.reflectutils.interfaces.TestInterfaceOne; 18 | 19 | /** 20 | * Simple class which implements interface one
21 | * (f) String id = "identity"
22 | * (f) Long nullVal = null
23 | * 24 | * @author Aaron Zeckoski (azeckoski@gmail.com) 25 | */ 26 | public class TestImplOne implements TestInterfaceOne { 27 | public String id = "identity"; 28 | public Long nullVal = null; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/converters/DoubleConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: DoubleConverter.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/main/java/org/azeckoski/reflectutils/converters/DoubleConverter.java $ 4 | * DoubleConverter.java - genericdao - Sep 8, 2008 11:27:44 AM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski @ gmail.com) (aaronz @ vt.edu) (aaron @ caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.converters; 16 | 17 | import org.azeckoski.reflectutils.converters.api.Converter; 18 | 19 | 20 | 21 | /** 22 | * Double passthrough 23 | * 24 | * @author Aaron Zeckoski (azeckoski @ gmail.com) 25 | */ 26 | public class DoubleConverter implements Converter { 27 | 28 | public Double convert(Object value) { 29 | return NumberConverter.convertToType(Double.class, value); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/azeckoski/reflectutils/classes/TestExcludeFields.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: TestExcludeFields.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/test/java/org/azeckoski/reflectutils/classes/TestExcludeFields.java $ 4 | * TestExcludeFields.java - genericdao - Sep 21, 2008 2:12:28 PM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski @ gmail.com) (aaronz @ vt.edu) (aaron @ caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.classes; 16 | 17 | import org.azeckoski.reflectutils.annotations.ReflectIgnoreClassFields; 18 | 19 | 20 | /** 21 | * For testing out exclusion of fields by annotations 22 | * 23 | * @author Aaron Zeckoski (azeckoski @ gmail.com) 24 | */ 25 | @ReflectIgnoreClassFields("password") 26 | public class TestExcludeFields { 27 | 28 | public String name; 29 | public String email; 30 | public String password; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/converters/ByteConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: ByteConverter.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/main/java/org/azeckoski/reflectutils/converters/ByteConverter.java $ 4 | * ByteConverter.java - genericdao - Sep 8, 2008 11:26:38 AM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski @ gmail.com) (aaronz @ vt.edu) (aaron @ caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.converters; 16 | 17 | import org.azeckoski.reflectutils.converters.api.Converter; 18 | 19 | 20 | 21 | /** 22 | * Byte passthrough 23 | * @see NumberConverter for more details 24 | * 25 | * @author Aaron Zeckoski (azeckoski @ gmail.com) 26 | */ 27 | public class ByteConverter implements Converter { 28 | 29 | public Byte convert(Object value) { 30 | return NumberConverter.convertToType(Byte.class, value); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/converters/LongConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: LongConverter.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/main/java/org/azeckoski/reflectutils/converters/LongConverter.java $ 4 | * LongConverter.java - genericdao - Sep 8, 2008 11:29:32 AM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski @ gmail.com) (aaronz @ vt.edu) (aaron @ caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.converters; 16 | 17 | import org.azeckoski.reflectutils.converters.api.Converter; 18 | 19 | 20 | 21 | /** 22 | * Long passthrough 23 | * @see NumberConverter for more details 24 | * 25 | * @author Aaron Zeckoski (azeckoski @ gmail.com) 26 | */ 27 | public class LongConverter implements Converter { 28 | 29 | public Long convert(Object value) { 30 | return NumberConverter.convertToType(Long.class, value); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/converters/FloatConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: FloatConverter.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/main/java/org/azeckoski/reflectutils/converters/FloatConverter.java $ 4 | * FloatConverter.java - genericdao - Sep 8, 2008 11:28:33 AM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski @ gmail.com) (aaronz @ vt.edu) (aaron @ caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.converters; 16 | 17 | import org.azeckoski.reflectutils.converters.api.Converter; 18 | 19 | 20 | 21 | /** 22 | * Float passthrough 23 | * @see NumberConverter for more details 24 | * 25 | * @author Aaron Zeckoski (azeckoski @ gmail.com) 26 | */ 27 | public class FloatConverter implements Converter { 28 | 29 | public Float convert(Object value) { 30 | return NumberConverter.convertToType(Float.class, value); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/converters/ShortConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: ShortConverter.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/main/java/org/azeckoski/reflectutils/converters/ShortConverter.java $ 4 | * ShortConverter.java - genericdao - Sep 8, 2008 11:30:34 AM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski @ gmail.com) (aaronz @ vt.edu) (aaron @ caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.converters; 16 | 17 | import org.azeckoski.reflectutils.converters.api.Converter; 18 | 19 | 20 | 21 | /** 22 | * Short passthrough 23 | * @see NumberConverter for more details 24 | * 25 | * @author Aaron Zeckoski (azeckoski @ gmail.com) 26 | */ 27 | public class ShortConverter implements Converter { 28 | 29 | public Short convert(Object value) { 30 | return NumberConverter.convertToType(Short.class, value); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/test/java/org/azeckoski/reflectutils/annotations/TestAnnoteClass1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: TestAnnoteClass1.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/test/java/org/azeckoski/reflectutils/annotations/TestAnnoteClass1.java $ 4 | * TestAnnoteClass1.java - genericdao - May 19, 2008 10:30:19 AM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski@gmail.com) (aaronz@vt.edu) (aaron@caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.annotations; 16 | 17 | import java.lang.annotation.ElementType; 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.RetentionPolicy; 20 | import java.lang.annotation.Target; 21 | 22 | /** 23 | * Test annotation which goes on a class 24 | * 25 | * @author Aaron Zeckoski (azeckoski@gmail.com) 26 | */ 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target(ElementType.TYPE) 29 | public @interface TestAnnoteClass1 { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/converters/IntegerConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: IntegerConverter.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/main/java/org/azeckoski/reflectutils/converters/IntegerConverter.java $ 4 | * IntegerConverter.java - genericdao - Sep 8, 2008 10:36:32 AM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski @ gmail.com) (aaronz @ vt.edu) (aaron @ caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.converters; 16 | 17 | import org.azeckoski.reflectutils.converters.api.Converter; 18 | 19 | 20 | 21 | /** 22 | * Integer passthrough 23 | * @see NumberConverter for more details 24 | * 25 | * @author Aaron Zeckoski (azeckoski @ gmail.com) 26 | */ 27 | public class IntegerConverter implements Converter { 28 | public Integer convert(Object value) { 29 | return NumberConverter.convertToType(Integer.class, value); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/org/azeckoski/reflectutils/annotations/TestAnnote.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: TestAnnote.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/test/java/org/azeckoski/reflectutils/annotations/TestAnnote.java $ 4 | * TestAnnote.java - entity-broker - May 5, 2008 1:23:37 PM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2 8 | * 9 | * A copy of the Apache License, Version 2 has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski@gmail.com) (aaronz@vt.edu) (aaron@caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.annotations; 16 | 17 | import java.lang.annotation.ElementType; 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.RetentionPolicy; 20 | import java.lang.annotation.Target; 21 | 22 | /** 23 | * An annotation to be used for testing annotations support 24 | * 25 | * @author Aaron Zeckoski (azeckoski@gmail.com) 26 | */ 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target({ElementType.METHOD, ElementType.FIELD}) 29 | public @interface TestAnnote { } 30 | -------------------------------------------------------------------------------- /src/test/java/org/azeckoski/reflectutils/classes/TestBaseOne.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: TestBaseOne.java 22 2008-10-02 15:32:02Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/test/java/org/azeckoski/reflectutils/classes/TestBaseOne.java $ 4 | * TestBaseOne.java - reflectutils - Oct 2, 2008 2:43:30 PM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski @ gmail.com) (aaronz @ vt.edu) (aaron @ caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.classes; 16 | 17 | 18 | /** 19 | * This is testing our ability to deal with stupid classes that would infinitely loop 20 | * 21 | * @author Aaron Zeckoski (azeckoski @ gmail.com) 22 | */ 23 | public class TestBaseOne { 24 | 25 | public String name = "AZ"; 26 | private int number = 10; 27 | public int getNumber() { 28 | return number; 29 | } 30 | 31 | public TestLoopOne getContained() { 32 | return new TestLoopOne(1); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/converters/BigIntegerConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: BigIntegerConverter.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/main/java/org/azeckoski/reflectutils/converters/BigIntegerConverter.java $ 4 | * BigIntegerConverter.java - genericdao - Sep 8, 2008 11:22:47 AM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski @ gmail.com) (aaronz @ vt.edu) (aaron @ caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.converters; 16 | 17 | import java.math.BigInteger; 18 | 19 | import org.azeckoski.reflectutils.converters.api.Converter; 20 | 21 | 22 | 23 | /** 24 | * BigInteger passthrough 25 | * 26 | * @author Aaron Zeckoski (azeckoski @ gmail.com) 27 | */ 28 | public class BigIntegerConverter implements Converter { 29 | public BigInteger convert(Object value) { 30 | return NumberConverter.convertToType(BigInteger.class, value); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/azeckoski/reflectutils/annotations/TestAnnoteField1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: TestAnnoteField1.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/test/java/org/azeckoski/reflectutils/annotations/TestAnnoteField1.java $ 4 | * TestAnnoteField1.java - genericdao - May 19, 2008 10:35:54 AM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski@gmail.com) (aaronz@vt.edu) (aaron@caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.annotations; 16 | 17 | import java.lang.annotation.ElementType; 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.RetentionPolicy; 20 | import java.lang.annotation.Target; 21 | 22 | 23 | /** 24 | * Test annotation which is used to mark a field 25 | * 26 | * @author Aaron Zeckoski (azeckoski@gmail.com) 27 | */ 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @Target({ElementType.METHOD, ElementType.FIELD}) 30 | public @interface TestAnnoteField1 { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/azeckoski/reflectutils/annotations/TestAnnoteClass2.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: TestAnnoteClass2.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/test/java/org/azeckoski/reflectutils/annotations/TestAnnoteClass2.java $ 4 | * TestAnnoteClass2.java - genericdao - May 19, 2008 10:32:37 AM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski@gmail.com) (aaronz@vt.edu) (aaron@caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.annotations; 16 | 17 | import java.lang.annotation.ElementType; 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.RetentionPolicy; 20 | import java.lang.annotation.Target; 21 | 22 | 23 | /** 24 | * Test annotation which goes on a class and has a field value 25 | * 26 | * @author Aaron Zeckoski (azeckoski@gmail.com) 27 | */ 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @Target(ElementType.TYPE) 30 | public @interface TestAnnoteClass2 { 31 | String value(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/converters/SQLDateConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: SQLDateConverter.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/main/java/org/azeckoski/reflectutils/converters/SQLDateConverter.java $ 4 | * SQLDateConverter.java - genericdao - Sep 8, 2008 2:31:38 PM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski @ gmail.com) (aaronz @ vt.edu) (aaron @ caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.converters; 16 | 17 | import java.sql.Date; 18 | 19 | import org.azeckoski.reflectutils.converters.api.Converter; 20 | 21 | 22 | 23 | /** 24 | * Passthrough to {@link DateConverter} for {@link Date} 25 | * @see DateConverter 26 | * 27 | * @author Aaron Zeckoski (azeckoski @ gmail.com) 28 | */ 29 | public class SQLDateConverter implements Converter { 30 | 31 | public Date convert(Object value) { 32 | return DateConverter.convertToType(Date.class, value); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/azeckoski/reflectutils/converters/SQLTimeConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: SQLTimeConverter.java 2 2008-10-01 10:04:26Z azeckoski $ 3 | * $URL: http://reflectutils.googlecode.com/svn/trunk/src/main/java/org/azeckoski/reflectutils/converters/SQLTimeConverter.java $ 4 | * SQLTimeConverter.java - genericdao - Sep 8, 2008 2:32:59 PM - azeckoski 5 | ************************************************************************** 6 | * Copyright (c) 2008 Aaron Zeckoski 7 | * Licensed under the Apache License, Version 2.0 8 | * 9 | * A copy of the Apache License has been included in this 10 | * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt 11 | * 12 | * Aaron Zeckoski (azeckoski @ gmail.com) (aaronz @ vt.edu) (aaron @ caret.cam.ac.uk) 13 | */ 14 | 15 | package org.azeckoski.reflectutils.converters; 16 | 17 | import java.sql.Time; 18 | 19 | import org.azeckoski.reflectutils.converters.api.Converter; 20 | 21 | 22 | 23 | /** 24 | * Passthrough to {@link DateConverter} for {@link Time} 25 | * @see DateConverter 26 | * 27 | * @author Aaron Zeckoski (azeckoski @ gmail.com) 28 | */ 29 | public class SQLTimeConverter implements Converter