-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
263 additions
and
269 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package qz.ws.substitutions; | ||
|
||
import org.codehaus.jettison.json.JSONException; | ||
|
||
public class SubstitutionException extends JSONException { | ||
public SubstitutionException(String message) { | ||
super(message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package qz.ws.substitutions; | ||
|
||
public enum Type { | ||
OPTIONS("options", "config"), | ||
PRINTER("printer"), | ||
DATA("data"); | ||
|
||
private String key; | ||
private boolean readOnly; | ||
private String[] alts; | ||
|
||
Type(String key, String ... alts) { | ||
this(key, false, alts); | ||
} | ||
Type(String key, boolean readOnly, String... alts) { | ||
this.key = key; | ||
this.readOnly = readOnly; | ||
this.alts = alts; | ||
} | ||
|
||
public boolean isReadOnly() { | ||
return readOnly; | ||
} | ||
|
||
public static Type parse(Object o) { | ||
for(Type root : values()) { | ||
if (root.key.equals(o)) { | ||
return root; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
public String getKey() { | ||
return key; | ||
} | ||
|
||
public String[] getAlts() { | ||
return alts; | ||
} | ||
} |
Oops, something went wrong.