litesoft
@ 948
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
package org.litesoft.GWT.client.pavsupport; import org.litesoft.codec.*; import org.litesoft.core.util.*; import com.google.gwt.place.shared.*; import java.util.*; public abstract class IdTokenizer<T extends Place> implements PlaceTokenizer<T>, HasPlaceId { private String mPlaceId; protected IdTokenizer( Object pPlaceId ) { mPlaceId = pPlaceId.toString(); } @Override public String getPlaceId() { return mPlaceId; } /** * Encode the passed Strings into a single String. * * @return "" if null passed OR no strings, individual nulls treated as "" */ protected String encode( String... strings ) { return encodePacked( MultiStringPackaging.pack( strings ) ); } /** * Encode the passed Strings into a single String. * * @return "" if null passed OR no strings, individual nulls treated as "" */ protected String encode( List<String> strings ) { return encodePacked( MultiStringPackaging.pack( strings ) ); } /** * Decode the passed String into multiple Strings. * * @return empty if "" or null passed OR the data can not be unpacked, * otherwise the list will be at least one string and no entries * will be null */ protected List<String> decode( String encoded ) { return decode( encoded, 0 ); } /** * Decode the passed String into multiple Strings. * * @return empty if minimumListSize < 1 AND (null or "" passed, OR the data * can not be unpacked) otherwise the list will be at least * minimumListSize (or 1 if minimumListSize < 1) and no entries will * be null. */ protected static List<String> decode( String encoded, int minimumListSize ) { return MultiStringPackaging.unpack( VersioningCodec.INSTANCE.decode( encoded ), minimumListSize ); } private String encodePacked( String packed ) { return VersioningCodec.INSTANCE.encode( packed ); } protected String toString( Object object ) { return (object != null) ? object.toString() : null; } } |
Commits for litesoft/trunk/Java/GWT/Client/src/org/litesoft/GWT/client/pavsupport/IdTokenizer.java
Revision | Author | Commited | Message |
---|---|---|---|
948 Diff | GeorgeS | Sat 07 Jun, 2014 23:42:39 +0000 | Jusefuls Formatter Updated to New Code Format |
779 Diff | GeorgeS | Mon 16 Jul, 2012 04:34:33 +0000 | |
755 Diff | GeorgeS | Sun 08 Jul, 2012 21:59:08 +0000 | |
720 Diff | GeorgeS | Sun 10 Jun, 2012 16:20:42 +0000 | |
712 | GeorgeS | Sat 09 Jun, 2012 22:46:04 +0000 | Move PAV stuff into LiteSoft |