- Timestamp:
- 06/22/13 21:51:33 (11 years ago)
- Location:
- java/main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main
-
Property
svn:ignore
set to
target
-
Property
svn:ignore
set to
-
java/main/src/main/java/com/framsticks/communication/Request.java
r77 r84 2 2 3 3 import com.framsticks.communication.queries.*; 4 5 import java.util.Collection;6 import java.util.regex.Matcher;7 import java.util.regex.Pattern;8 4 9 5 /** … … 12 8 public abstract class Request { 13 9 14 10 public static void quoteValue(StringBuilder builder, String value) { 15 11 String quote = ((value.indexOf(' ') > 0) || (value.length() == 0) ? "\"" : ""); 16 12 builder.append(quote).append(value).append(quote); … … 19 15 public abstract String getCommand(); 20 16 21 17 protected abstract StringBuilder construct(StringBuilder buffer); 22 18 //private static Pattern queryPattern = Pattern.compile("^(\\S+)\\s+(\\S+)(?:\\s+(\\S+))?$"); 23 19 … … 35 31 return new CallRequest(); 36 32 } 37 38 39 40 41 42 43 44 45 46 33 if (type.equals("reg")) { 34 return new RegistrationRequest(); 35 } 36 if (type.equals("use")) { 37 return new UseRequest(); 38 } 39 if (type.equals("version")) { 40 return new VersionRequest(); 41 } 42 return null; 47 43 } 48 44 49 45 public abstract void parseRest(String rest); 50 46 51 52 53 54 47 @Override 48 public String toString() { 49 return construct(new StringBuilder().append(getCommand())).toString(); 50 } 55 51 }
Note: See TracChangeset
for help on using the changeset viewer.