From 40a9d99496e098562f090fb7ffce9e749011b131 Mon Sep 17 00:00:00 2001 From: Benjamin Culkin Date: Mon, 20 May 2024 17:58:16 -0400 Subject: Formatting pass --- .../net/wotonomy/control/EOKeyValueUnarchiver.java | 46 +++++++++++----------- 1 file changed, 24 insertions(+), 22 deletions(-) (limited to 'projects/net.wotonomy.persistence/src/main/java/net/wotonomy/control/EOKeyValueUnarchiver.java') diff --git a/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/control/EOKeyValueUnarchiver.java b/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/control/EOKeyValueUnarchiver.java index caed8a4..5238c70 100644 --- a/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/control/EOKeyValueUnarchiver.java +++ b/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/control/EOKeyValueUnarchiver.java @@ -22,17 +22,18 @@ import java.lang.reflect.Method; import net.wotonomy.foundation.NSDictionary; import net.wotonomy.foundation.NSKeyValueCoding; -/** Creates objects from dictionaries that were created with - * EOKeyValueArchiver. -* @author michael@mpowers.net -* @author $Author: cgruber $ -* @version $Revision: 894 $ -*/ +/** + * Creates objects from dictionaries that were created with EOKeyValueArchiver. + * + * @author michael@mpowers.net + * @author $Author: cgruber $ + * @version $Revision: 894 $ + */ public class EOKeyValueUnarchiver { NSDictionary dict; Object _delegate; - protected static final Class[] METHOD_ARGS = new Class[]{ EOKeyValueUnarchiver.class }; + protected static final Class[] METHOD_ARGS = new Class[] { EOKeyValueUnarchiver.class }; public EOKeyValueUnarchiver(NSDictionary archive) { super(); @@ -54,7 +55,7 @@ public class EOKeyValueUnarchiver { if (x == null) return 0; if (x instanceof Number) - return ((Number)x).intValue(); + return ((Number) x).intValue(); try { int i = Integer.parseInt(x.toString()); return i; @@ -68,7 +69,7 @@ public class EOKeyValueUnarchiver { if (x == null) return null; if (x instanceof NSDictionary) { - NSDictionary d = (NSDictionary)x; + NSDictionary d = (NSDictionary) x; if (d.objectForKey("class") != null) { String cname = d.objectForKey("class").toString(); Class _class = null; @@ -82,11 +83,11 @@ public class EOKeyValueUnarchiver { if (d.objectForKey("value") != null) return d.objectForKey("value").toString(); } else if (cname.equals("EONull")) { - return NSKeyValueCoding.NullValue; + return NSKeyValueCoding.NullValue; } else if (cname.equals("EOFetchSpecification")) { _class = EOFetchSpecification.class; } else if (cname.equals("EOKeyValueQualifier")) { - _class = EOKeyValueQualifier.class; + _class = EOKeyValueQualifier.class; } else if (cname.equals("EONotQualifier")) { _class = EONotQualifier.class; } else if (cname.equals("EOAndQualifier")) { @@ -95,12 +96,12 @@ public class EOKeyValueUnarchiver { _class = EOOrQualifier.class; } else if (cname.equals("EOSortOrdering")) { _class = EOSortOrdering.class; - } else if (cname.indexOf(".") < 0) { //Load a class without package + } else if (cname.indexOf(".") < 0) { // Load a class without package try { _class = Class.forName("net.wotonomy.control." + cname); } catch (ClassNotFoundException ex) { } - //search for the class in access + // search for the class in access if (_class == null) { try { _class = Class.forName("net.wotonomy.access." + cname); @@ -117,7 +118,7 @@ public class EOKeyValueUnarchiver { return x; try { Method met = _class.getMethod("decodeWithKeyValueUnarchiver", METHOD_ARGS); - return met.invoke(null, new Object[]{ new EOKeyValueUnarchiver(d) }); + return met.invoke(null, new Object[] { new EOKeyValueUnarchiver(d) }); } catch (Exception ex) { ex.printStackTrace(); return x; @@ -144,22 +145,23 @@ public class EOKeyValueUnarchiver { public void setDelegate(Object del) { _delegate = del; } + public Object delegate() { return _delegate; } } /* - * $Log$ - * Revision 1.2 2006/02/16 16:47:14 cgruber - * Move some classes in to "internal" packages and re-work imports, etc. + * $Log$ Revision 1.2 2006/02/16 16:47:14 cgruber Move some classes in to + * "internal" packages and re-work imports, etc. * - * Also use UnsupportedOperationExceptions where appropriate, instead of WotonomyExceptions. + * Also use UnsupportedOperationExceptions where appropriate, instead of + * WotonomyExceptions. * - * Revision 1.1 2006/02/16 13:19:57 cgruber - * Check in all sources in eclipse-friendly maven-enabled packages. + * Revision 1.1 2006/02/16 13:19:57 cgruber Check in all sources in + * eclipse-friendly maven-enabled packages. * - * Revision 1.2 2003/08/11 18:17:41 chochos - * decoding of objects now works properly + * Revision 1.2 2003/08/11 18:17:41 chochos decoding of objects now works + * properly * */ \ No newline at end of file -- cgit v1.2.3