aboutsummaryrefslogtreecommitdiff
path: root/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TypedVariable.java
diff options
context:
space:
mode:
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TypedVariable.java')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TypedVariable.java50
1 files changed, 0 insertions, 50 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TypedVariable.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TypedVariable.java
deleted file mode 100644
index 468a10c77..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TypedVariable.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.android.ide.eclipse.adt.internal.wizards.templates;
-
-import java.util.Locale;
-
-import org.xml.sax.Attributes;
-
-public class TypedVariable {
- public enum Type {
- STRING,
- BOOLEAN,
- INTEGER;
-
- public static Type get(String name) {
- if (name == null) {
- return STRING;
- }
- try {
- return valueOf(name.toUpperCase(Locale.US));
- } catch (IllegalArgumentException e) {
- System.err.println("Unexpected global type '" + name + "'");
- System.err.println("Expected one of :");
- for (Type s : Type.values()) {
- System.err.println(" " + s.name().toLowerCase(Locale.US));
- }
- }
-
- return STRING;
- }
- }
-
- public static Object parseGlobal(Attributes attributes) {
- String value = attributes.getValue(TemplateHandler.ATTR_VALUE);
- Type type = Type.get(attributes.getValue(TemplateHandler.ATTR_TYPE));
-
- switch (type) {
- case STRING:
- return value;
- case BOOLEAN:
- return Boolean.parseBoolean(value);
- case INTEGER:
- try {
- return Integer.parseInt(value);
- } catch (NumberFormatException e) {
- return value;
- }
- }
-
- return value;
- }
-}