|
|
@@ -431,6 +431,7 @@ public class MacroDef extends AntlibDefinition { |
|
|
|
private boolean optional; |
|
|
|
private boolean trim; |
|
|
|
private String description; |
|
|
|
private String defaultString; |
|
|
|
|
|
|
|
/** |
|
|
|
* The name of the attribute. |
|
|
@@ -500,6 +501,20 @@ public class MacroDef extends AntlibDefinition { |
|
|
|
return description; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param defaultString default text for the string. |
|
|
|
*/ |
|
|
|
public void setDefault(String defaultString) { |
|
|
|
this.defaultString = defaultString; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the default text if set, null otherwise. |
|
|
|
*/ |
|
|
|
public String getDefault() { |
|
|
|
return defaultString; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* equality method |
|
|
|
* |
|
|
@@ -514,20 +529,10 @@ public class MacroDef extends AntlibDefinition { |
|
|
|
return false; |
|
|
|
} |
|
|
|
Text other = (Text) obj; |
|
|
|
if (name == null) { |
|
|
|
if (other.name != null) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
} else if (!name.equals(other.name)) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
if (optional != other.optional) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
if (trim != other.trim) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
return safeCompare(name, other.name) |
|
|
|
&& optional == other.optional |
|
|
|
&& trim == other.trim |
|
|
|
&& safeCompare(defaultString, other.defaultString); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -538,6 +543,10 @@ public class MacroDef extends AntlibDefinition { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private static boolean safeCompare(Object a, Object b) { |
|
|
|
return a == null ? b == null : a.equals(b); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* A nested element for the MacroDef task. |
|
|
|
*/ |
|
|
|