Commit Graph
893 Commits
Author SHA1 Message Date
Adrian Crum 690df1644b Fixed misspelling in conversion framework - no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910367 13f79535-47bb-0310-9956-ffa450edef68
2010-02-16 00:10:36 +00:00
Adam Heath 679342925f Add more DateTime conversion tests.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910357 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 22:25:33 +00:00
Adam Heath c9099d5741 Explicitly test the canConvert method on each converter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910356 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 22:24:54 +00:00
Adam Heath b75fb11cb2 Refactored the DateTime conversion tests.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910355 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 22:24:27 +00:00
Adam Heath 3e476eedcd Move DateTime conversion tests to separate class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910354 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 22:23:55 +00:00
Adam Heath 1f90f3dfd3 Fix errors and warnings with the JSON grammar.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910353 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 22:23:15 +00:00
Adam Heath 95ba1bdffd s/Hex onversions/Hex conversions/
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910352 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 22:22:45 +00:00
Adrian Crum 341526dd5a Cleaned up imports in the conversion framework.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910241 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 15:52:10 +00:00
Adam Heath 035e852ef7 Make PassThruConverterCreater function like NullConverter, which handles
any class to Object conversion, and also handles FooObject ->
FooInterface.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910167 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 07:16:51 +00:00
Adam Heath 5da12fa6cd Move all JSON converters to a separate class, change the collection
converters that used to use JSON back to calling toString, and implement
separate JSON conversion.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910112 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:44:39 +00:00
Adam Heath a24c178c3e StringToEnum conversions now go thru the creation system.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910111 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:41:52 +00:00
Adam Heath 0bbbb00531 Implement a creation framework; this allows creaters to provide
optimized versions of converters.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910110 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:41:19 +00:00
Adam Heath ba40d13675 Fix several generics warnings.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910109 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:40:44 +00:00
Adam Heath 8d00d8d2fa Improve the targeted class convert methods, to have a more strict
generics type.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910108 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:39:53 +00:00
Adam Heath 62861a8ed5 AbstractConverter now implement ConverterLoader, and thee register call
was moved to loadConverters().

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910105 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:39:03 +00:00
Adam Heath 68e313b5d0 In loadConverters, if the contained class implements ConverterLoader,
call it's loadConverters method.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910104 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:38:26 +00:00
Adam Heath 89390ab5fa Make the enum converters extend AbstractConverter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910103 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:37:52 +00:00
Adam Heath 150b144e44 Protect against public classes with non-public constructors.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910101 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:37:14 +00:00
Adam Heath 2d278dde6d getSourceClass and getTargetClass are no longer final.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910100 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:36:46 +00:00
Adam Heath ea485e191f Make AbstractLocalizedConverter extend AbstractConverter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910099 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:36:11 +00:00
Adam Heath 5cafceca54 Make AbstractLocalizedConverter more like AbstractConverter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910098 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:35:41 +00:00
Adam Heath c436afc999 Remove checkExtendsImplements; in actuality, each converter should
handle this itself.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910097 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:35:13 +00:00
Adam Heath 732a9b62d6 Implement unsynchronized(non-blocking) access to converterMap and
noConversion.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910096 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:34:46 +00:00
Adam Heath 31976663c0 Remove temporary values variable in getConverter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910095 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:34:13 +00:00
Adam Heath 590a2a0a9b Use generics for loop in loadContainedConverters.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910094 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:32:49 +00:00
Adam Heath d3a12cdd13 Remove debug print statement.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910093 13f79535-47bb-0310-9956-ffa450edef68
2010-02-14 22:32:21 +00:00
Adam Heath 1d4257f190 Fix ordering of Enum converter class comparisons.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@909718 13f79535-47bb-0310-9956-ffa450edef68
2010-02-13 03:54:42 +00:00
Adrian Crum 668e940a69 Added the XStream library to the project:
http://xstream.codehaus.org/


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@909650 13f79535-47bb-0310-9956-ffa450edef68
2010-02-12 23:09:20 +00:00
Adam Heath 02f0f513ea Add allowJsonResolve support.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908715 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:50:00 +00:00
Adam Heath 43fd79184f Allow readObject/writeObject to fall back to JSON.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908714 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:48:41 +00:00
Adam Heath afd908e3e4 Switch the collection/string converters to the json parser.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908713 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:48:07 +00:00
Adam Heath 852ceb0866 JSON reading/writing. May seem like it is uneeded, but a later commit
will add support for this becoming more extensible.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908712 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:47:30 +00:00
Adam Heath d946201a4b A writer that allows calling code to add non-important spaces, tabs, and
new lines, then this extra formatting can easily be turned off.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908711 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:46:29 +00:00
Adam Heath b182186e6a Wrap the conversion system with some readObject/writeObject calls.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908708 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:45:29 +00:00
Adam Heath fcfa765c24 Add UtilIO.writeString() variants.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908705 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:43:46 +00:00
Adam Heath 93f5a082d7 UtilIO.readString enhancements.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908702 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:42:51 +00:00
Adam Heath 1fdf876337 Add Enum converters.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908700 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:41:47 +00:00
Adam Heath 6bbf06e0bf Check the super class and interfaces of the source and target,
attempting to find a match.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908698 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:40:16 +00:00
Adam Heath 1bf146fcca Allow for converting to an object that extends the target class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908695 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:37:51 +00:00
Adam Heath 9eba46bc46 Add registerConverter variant that allows for specifying the
source/target classes.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908692 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:34:10 +00:00
Adam Heath f10280139d Correct pass thru conversion, to return the correct source/target types.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908691 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:32:51 +00:00
Adam Heath dd9886331a Add Charset converters.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908689 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:29:46 +00:00
Adam Heath 75bd046632 Add Byte converters.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908686 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:20:48 +00:00
Adam Heath 3645dcee6b Add Short converters.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908684 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:17:52 +00:00
Adam Heath 089a817e62 Add BigInteger converters.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908681 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:14:45 +00:00
Adam Heath fa8dc60733 Upgrade javolution library.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908678 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:12:50 +00:00
Adam Heath 85ddfba2fe Full code coverage on the unit tests.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908676 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:10:44 +00:00
Adam Heath f98ed2d050 Remove embedded tabs added by Adrian.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908673 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:09:34 +00:00
Jacopo Cappellato 75a3c9f270 Added a bunch of missing license headers; we'll have to pay more attention on this in the future.
Still some work needs to be done in order to have the codebase inline with the ASF policies as it used to be.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@907413 13f79535-47bb-0310-9956-ffa450edef68
2010-02-07 11:24:45 +00:00
Adrian Crum 6f120ae631 Added JavaDocs and changed some parameter names in FlexibleStringExpander.java. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@907117 13f79535-47bb-0310-9956-ffa450edef68
2010-02-05 22:34:53 +00:00