summaryrefslogtreecommitdiff
path: root/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/control/EOKeyValueUnarchiver.java
diff options
context:
space:
mode:
Diffstat (limited to 'projects/net.wotonomy.persistence/src/main/java/net/wotonomy/control/EOKeyValueUnarchiver.java')
-rw-r--r--projects/net.wotonomy.persistence/src/main/java/net/wotonomy/control/EOKeyValueUnarchiver.java46
1 files changed, 24 insertions, 22 deletions
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