diff options
| author | Benjamin Culkin <scorpress@gmail.com> | 2024-07-05 12:43:13 -0400 |
|---|---|---|
| committer | Benjamin Culkin <scorpress@gmail.com> | 2024-07-05 12:43:13 -0400 |
| commit | 6d46c473d41c6c47e6b8bd8c676d925e544bd378 (patch) | |
| tree | 796d51bfff52f8f3fa383b2d26847b7c8160677b /projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOSession.java | |
| parent | 02bc52037e9ccccca672d6156d9c325c74fe28b3 (diff) | |
More cleanup
Diffstat (limited to 'projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOSession.java')
| -rw-r--r-- | projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOSession.java | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOSession.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOSession.java index c8c1f4d..d0f91e9 100644 --- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOSession.java +++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOSession.java @@ -20,15 +20,13 @@ package net.wotonomy.web; import java.io.Serializable; import java.util.LinkedList; -import java.util.List; -import java.util.Map; import jakarta.servlet.http.HttpSession; + import net.wotonomy.control.EOEditingContext; import net.wotonomy.control.KeyValueCodingUtilities; import net.wotonomy.foundation.NSArray; import net.wotonomy.foundation.NSDate; -import net.wotonomy.foundation.NSDictionary; import net.wotonomy.foundation.NSKeyValueCodingAdditions; import net.wotonomy.foundation.NSKeyValueCodingSupport; import net.wotonomy.foundation.NSMutableArray; @@ -58,16 +56,15 @@ public class WOSession implements Serializable, NSKeyValueCodingAdditions { // FIXME: transient until ec's implement serializable private transient EOEditingContext defaultEditingContext; - private NSMutableDictionary state; - private NSMutableDictionary pages; - private NSMutableDictionary permanentPages; - private NSMutableArray stateStack; - private NSMutableArray pageStack; - private NSMutableArray permanentPageStack; + private NSMutableDictionary<String, Object> state; + private NSMutableDictionary<String, Object> pages; + private NSMutableDictionary<String, Object> permanentPages; + private NSMutableArray<String> pageStack; + private NSMutableArray<String> permanentPageStack; private boolean terminating; // used by WOResourceManager to cache dynamic resources - transient NSMutableDictionary dynamicDataCache; + transient NSMutableDictionary<String, TypedData> dynamicDataCache; public static final String WOSessionDidTimeOutNotification = "WOSessionDidTimeOutNotification"; public static final String WOSessionDidRestoreNotification = "WOSessionDidRestoreNotification"; @@ -78,12 +75,12 @@ public class WOSession implements Serializable, NSKeyValueCodingAdditions { */ public WOSession() { session = null; - state = new NSMutableDictionary(); - pages = new NSMutableDictionary(); - permanentPages = new NSMutableDictionary(); - stateStack = NSMutableArray.mutableArrayBackedByList(new LinkedList()); - pageStack = NSMutableArray.mutableArrayBackedByList(new LinkedList()); - permanentPageStack = NSMutableArray.mutableArrayBackedByList(new LinkedList()); + state = new NSMutableDictionary<>(); + pages = new NSMutableDictionary<>(); + permanentPages = new NSMutableDictionary<>(); + NSMutableArray.mutableArrayBackedByList(new LinkedList<>()); + pageStack = NSMutableArray.mutableArrayBackedByList(new LinkedList<>()); + permanentPageStack = NSMutableArray.mutableArrayBackedByList(new LinkedList<>()); defaultEditingContext = null; terminating = false; } @@ -215,7 +212,7 @@ public class WOSession implements Serializable, NSKeyValueCodingAdditions { * preference. The application will be responsible for localizing the content * based on the languages found in this array. */ - public void setLanguages(NSArray anArray) { + public void setLanguages(NSArray<Object> anArray) { throw new RuntimeException("Not implemented yet."); } @@ -224,7 +221,7 @@ public class WOSession implements Serializable, NSKeyValueCodingAdditions { * preference. The application will be responsible for localizing the content * based on the languages found in this array. */ - public NSArray languages() { + public NSArray<Object> languages() { throw new RuntimeException("Not implemented yet."); } @@ -303,7 +300,7 @@ public class WOSession implements Serializable, NSKeyValueCodingAdditions { * Returns a list of pages accessed by this session in order of their access and * named by calling WOComponent.descriptionForResponse. */ - public NSArray statistics() { + public NSArray<Object> statistics() { throw new RuntimeException("Not implemented yet."); } @@ -409,24 +406,19 @@ public class WOSession implements Serializable, NSKeyValueCodingAdditions { // interface NSKeyValueCodingAdditions + @Override public Object valueForKeyPath(String aPath) { // currently key value coding support also handles keypaths return valueForKey(aPath); } + @Override public void takeValueForKeyPath(Object aValue, String aPath) { // currently key value coding support also handles keypaths takeValueForKey(aValue, aPath); } - public NSDictionary valuesForKeys(List aKeyList) { - throw new RuntimeException("Not implemented yet."); - } - - public void takeValuesFromDictionary(Map aValueMap) { - throw new RuntimeException("Not implemented yet."); - } - + @Override public Object valueForKey(String aKey) { // System.out.println( "valueForKey: " + aKey + "->" + this ); Object result = objectForKey(aKey); if (result == null) @@ -434,11 +426,13 @@ public class WOSession implements Serializable, NSKeyValueCodingAdditions { return result; } + @Override public void takeValueForKey(Object aValue, String aKey) { // System.out.println( "takeValueForKey: " + aKey + " : " // + aValue + "->" + this ); setObjectForKey(aValue, aKey); } + @Override public Object storedValueForKey(String aKey) { Object result = objectForKey(aKey); if (result == null) @@ -446,18 +440,22 @@ public class WOSession implements Serializable, NSKeyValueCodingAdditions { return result; } + @Override public void takeStoredValueForKey(Object aValue, String aKey) { setObjectForKey(aValue, aKey); } + @Override public Object handleQueryWithUnboundKey(String aKey) { return NSKeyValueCodingSupport.handleQueryWithUnboundKey(this, aKey); } + @Override public void handleTakeValueForUnboundKey(Object aValue, String aKey) { NSKeyValueCodingSupport.handleTakeValueForUnboundKey(this, aValue, aKey); } + @Override public void unableToSetNullForKey(String aKey) { NSKeyValueCodingSupport.unableToSetNullForKey(this, aKey); } |
