Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Camelon2003-07-31 09:20:37 -0400
committerJohn Camelon2003-07-31 09:20:37 -0400
commit851383895527019b9541a1ce5b31a9cd26f7f9c4 (patch)
treea0f70d5253e22795558d961d384a80d73812d8f9 /core/org.eclipse.cdt.core/build
parentc2e6e9ec5b93974325ce31c68107c16bf4a84e77 (diff)
downloadorg.eclipse.cdt-851383895527019b9541a1ce5b31a9cd26f7f9c4.tar.gz
org.eclipse.cdt-851383895527019b9541a1ce5b31a9cd26f7f9c4.tar.xz
org.eclipse.cdt-851383895527019b9541a1ce5b31a9cd26f7f9c4.zip
Patch for Sean Evoy
I am in the process of documenting the build model and as I go along, a number of things will have to be cleaned up in the actual model itself. This patch is purely a bookeeping change to make it easier for me to maintain the build model in the face of these changes as we go forward. Where I used to access XML elements using hard-coded strings, I have moved the string into the appropriate interface class. If the name of the attribute changes in the future, I only have to update it one place. I have also begun the process of renaming certain attributes of the schema to make them better reflect what they are doing. My hope is that if they have intuitive names, toolchain implementers will have less difficulty understanding their intent. In any case, I have changed four attribute names; optionRef -> optionReference, toolRef -> toolReference, optionValue -> listOptionValue, and optionEnum -> enumeratedOptionValue. Unfortunately, these changes will invalidate the dot-cdtbuild files for any managed build projects in your workspace. If you can't bear to create a new project, move the files over, and set-up the compiler options again, you can always hand-edit the changes in the file yourself. Just remember to restart CDT after you do so.
Diffstat (limited to 'core/org.eclipse.cdt.core/build')
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IBuildObject.java26
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IConfiguration.java3
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java17
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOptionCategory.java3
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ITool.java9
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java26
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java38
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionCategory.java8
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java30
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java28
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java8
11 files changed, 114 insertions, 82 deletions
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IBuildObject.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IBuildObject.java
index 1cce486b01..2529da7ec8 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IBuildObject.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IBuildObject.java
@@ -1,21 +1,21 @@
-/*
- * Created on Apr 9, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+/**********************************************************************
+ * Copyright (c) 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ **********************************************************************/
package org.eclipse.cdt.core.build.managed;
-/**
- * @author dschaefe
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
public interface IBuildObject {
+ // Schema element names
+ public static final String ID = "id";
+ public static final String NAME = "name";
public String getId();
-
public String getName();
}
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IConfiguration.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IConfiguration.java
index 65d8309258..84cf2f187c 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IConfiguration.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IConfiguration.java
@@ -13,6 +13,9 @@ package org.eclipse.cdt.core.build.managed;
import org.eclipse.core.resources.IResource;
public interface IConfiguration extends IBuildObject {
+ // Schema element names
+ public static final String TOOL_REF = "toolReference";
+ public static final String PARENT = "parent";
/**
* Returns the target for this configuration.
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java
index c4042236d2..006044796e 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java
@@ -23,6 +23,23 @@ public interface IOption extends IBuildObject {
public static final int PREPROCESSOR_SYMBOLS = 5;
public static final int LIBRARIES = 6;
+ // Schema element names for options
+ public static final String CATEGORY = "category";
+ public static final String COMMAND = "command";
+ public static final String DEFAULT_VALUE = "defaultValue";
+ public static final String ENUM_VALUE = "enumeratedOptionValue";
+ public static final String IS_DEFAULT = "isDefault";
+ public static final String LIST_VALUE = "listOptionValue";
+ public static final String TYPE_BOOL = "boolean";
+ public static final String TYPE_ENUM = "enumerated";
+ public static final String TYPE_INC_PATH = "includePath";
+ public static final String TYPE_LIB = "libs";
+ public static final String TYPE_STRING = "string";
+ public static final String TYPE_STR_LIST = "stringList";
+ public static final String VALUE_TYPE = "valueType";
+ public static final String VALUE = "value";
+
+
/**
* If this option is defined as an enumeration, this function returns
* the list of possible values for that enum.
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOptionCategory.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOptionCategory.java
index 4ba523abd7..e0b5a7bfcf 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOptionCategory.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOptionCategory.java
@@ -15,6 +15,9 @@ package org.eclipse.cdt.core.build.managed;
*/
public interface IOptionCategory extends IBuildObject {
+ // Schema element names
+ public static final String PARENT = "parent";
+
/**
* Returns the list of children of this node in the option category tree
*
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ITool.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ITool.java
index e7cef1c63c..d700296520 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ITool.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ITool.java
@@ -14,6 +14,15 @@ package org.eclipse.cdt.core.build.managed;
*
*/
public interface ITool extends IBuildObject {
+ // Schema element names
+ public static final String COMMAND = "command";
+ public static final String OPTION = "option";
+ public static final String OPTION_CAT = "optionCategory";
+ public static final String OPTION_REF = "optionReference";
+ public static final String OUTPUT_FLAG = "outputFlag";
+ public static final String OUTPUT_PREFIX = "outputPrefix";
+ public static final String OUTPUTS = "outputs";
+ public static final String SOURCES = "sources";
public static final String WHITE_SPACE = " ";
/**
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java
index 45af3a8f52..94b2b27acf 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java
@@ -74,18 +74,18 @@ public class Configuration extends BuildObject implements IConfiguration {
this.target = target;
// id
- setId(element.getAttribute("id"));
+ setId(element.getAttribute(IConfiguration.ID));
// hook me up
target.addConfiguration(this);
// name
- setName(element.getAttribute("name"));
+ setName(element.getAttribute(IConfiguration.NAME));
IConfigurationElement[] configElements = element.getChildren();
for (int l = 0; l < configElements.length; ++l) {
IConfigurationElement configElement = configElements[l];
- if (configElement.getName().equals("toolRef")) {
+ if (configElement.getName().equals(IConfiguration.TOOL_REF)) {
new ToolReference(this, configElement);
}
}
@@ -101,21 +101,21 @@ public class Configuration extends BuildObject implements IConfiguration {
this.target = target;
// id
- setId(element.getAttribute("id"));
+ setId(element.getAttribute(IConfiguration.ID));
// hook me up
target.addConfiguration(this);
// name
- if (element.hasAttribute("name"))
- setName(element.getAttribute("name"));
+ if (element.hasAttribute(IConfiguration.NAME))
+ setName(element.getAttribute(IConfiguration.NAME));
- if (element.hasAttribute("parent")) {
+ if (element.hasAttribute(IConfiguration.PARENT)) {
// See if the target has a parent
ITarget targetParent = target.getParent();
// If so, then get my parent from it
if (targetParent != null) {
- parent = targetParent.getConfiguration(element.getAttribute("parent"));
+ parent = targetParent.getConfiguration(element.getAttribute(IConfiguration.PARENT));
}
else {
parent = null;
@@ -125,7 +125,7 @@ public class Configuration extends BuildObject implements IConfiguration {
NodeList configElements = element.getChildNodes();
for (int i = 0; i < configElements.getLength(); ++i) {
Node configElement = configElements.item(i);
- if (configElement.getNodeName().equals("toolRef")) {
+ if (configElement.getNodeName().equals(IConfiguration.TOOL_REF)) {
new ToolReference(this, (Element)configElement);
}
}
@@ -139,18 +139,18 @@ public class Configuration extends BuildObject implements IConfiguration {
* @param element
*/
public void serialize(Document doc, Element element) {
- element.setAttribute("id", id);
+ element.setAttribute(IConfiguration.ID, id);
if (name != null)
- element.setAttribute("name", name);
+ element.setAttribute(IConfiguration.NAME, name);
if (parent != null)
- element.setAttribute("parent", parent.getId());
+ element.setAttribute(IConfiguration.PARENT, parent.getId());
if (toolReferences != null)
for (int i = 0; i < toolReferences.size(); ++i) {
ToolReference toolRef = (ToolReference)toolReferences.get(i);
- Element toolRefElement = doc.createElement("toolRef");
+ Element toolRefElement = doc.createElement(IConfiguration.TOOL_REF);
element.appendChild(toolRefElement);
toolRef.serialize(doc, toolRefElement);
}
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java
index 17a7cbfef3..e3e5cd5956 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java
@@ -47,37 +47,37 @@ public class Option extends BuildObject implements IOption {
this(tool);
// Get the unique id of the option
- setId(element.getAttribute("id"));
+ setId(element.getAttribute(IOption.ID));
// Hook me up to a tool
tool.addOption(this);
// Get the option Name (this is what the user will see in the UI)
- setName(element.getAttribute("name"));
+ setName(element.getAttribute(IOption.NAME));
// Options can be grouped into categories
- String categoryId = element.getAttribute("category");
+ String categoryId = element.getAttribute(IOption.CATEGORY);
if (categoryId != null)
setCategory(tool.getOptionCategory(categoryId));
// Get the command defined for the option
- command = element.getAttribute("command");
+ command = element.getAttribute(IOption.COMMAND);
// Options hold different types of values
- String valueTypeStr = element.getAttribute("valueType");
+ String valueTypeStr = element.getAttribute(IOption.VALUE_TYPE);
if (valueTypeStr == null)
valueType = -1;
- else if (valueTypeStr.equals("string"))
+ else if (valueTypeStr.equals(IOption.TYPE_STRING))
valueType = IOption.STRING;
- else if (valueTypeStr.equals("stringList"))
+ else if (valueTypeStr.equals(IOption.TYPE_STR_LIST))
valueType = IOption.STRING_LIST;
- else if (valueTypeStr.equals("boolean"))
+ else if (valueTypeStr.equals(IOption.TYPE_BOOL))
valueType = IOption.BOOLEAN;
- else if (valueTypeStr.equals("enumerated"))
+ else if (valueTypeStr.equals(IOption.TYPE_ENUM))
valueType = IOption.ENUMERATED;
- else if (valueTypeStr.equals("includePath"))
+ else if (valueTypeStr.equals(IOption.TYPE_INC_PATH))
valueType = IOption.INCLUDE_PATH;
- else if (valueTypeStr.equals("libs"))
+ else if (valueTypeStr.equals(IOption.TYPE_LIB))
valueType = IOption.LIBRARIES;
else
valueType = IOption.PREPROCESSOR_SYMBOLS;
@@ -87,21 +87,21 @@ public class Option extends BuildObject implements IOption {
switch (valueType) {
case IOption.BOOLEAN:
// Convert the string to a boolean
- value = new Boolean(element.getAttribute("defaultValue"));
+ value = new Boolean(element.getAttribute(IOption.DEFAULT_VALUE));
break;
case IOption.STRING:
// Just get the value out of the option directly
- value = element.getAttribute("defaultValue");
+ value = element.getAttribute(IOption.DEFAULT_VALUE);
break;
case IOption.ENUMERATED:
List enumList = new ArrayList();
- IConfigurationElement[] enumElements = element.getChildren("optionEnum");
+ IConfigurationElement[] enumElements = element.getChildren(IOption.ENUM_VALUE);
for (int i = 0; i < enumElements.length; ++i) {
- String optName = enumElements[i].getAttribute("name");
- String optCommand = enumElements[i].getAttribute("command");
+ String optName = enumElements[i].getAttribute(IOption.NAME);
+ String optCommand = enumElements[i].getAttribute(IOption.COMMAND);
enumList.add(optName);
enumCommands.put(optName, optCommand);
- Boolean isDefault = new Boolean(enumElements[i].getAttribute("isDefault"));
+ Boolean isDefault = new Boolean(enumElements[i].getAttribute(IOption.IS_DEFAULT));
if (isDefault.booleanValue()) {
defaultEnumName = optName;
}
@@ -113,9 +113,9 @@ public class Option extends BuildObject implements IOption {
case IOption.PREPROCESSOR_SYMBOLS:
case IOption.LIBRARIES:
List valueList = new ArrayList();
- IConfigurationElement[] valueElements = element.getChildren("optionValue");
+ IConfigurationElement[] valueElements = element.getChildren(IOption.LIST_VALUE);
for (int i = 0; i < valueElements.length; ++i) {
- valueList.add(valueElements[i].getAttribute("value"));
+ valueList.add(valueElements[i].getAttribute(IOption.VALUE));
}
value = valueList;
break;
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionCategory.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionCategory.java
index 41b4af476a..e8e6ec6e8a 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionCategory.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionCategory.java
@@ -34,17 +34,17 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
}
public OptionCategory(Tool tool, IConfigurationElement element) {
- String parentId = element.getAttribute("parent");
+ String parentId = element.getAttribute(IOptionCategory.PARENT);
if (parentId != null)
- owner = tool.getOptionCategory(element.getAttribute("parent"));
+ owner = tool.getOptionCategory(element.getAttribute(IOptionCategory.PARENT));
else
owner = tool;
// id
- setId(element.getAttribute("id"));
+ setId(element.getAttribute(IOptionCategory.ID));
// Name
- setName(element.getAttribute("name"));
+ setName(element.getAttribute(IOptionCategory.NAME));
// Hook me in
if (owner instanceof Tool)
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java
index e4db4b0530..f1c1549242 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java
@@ -60,17 +60,17 @@ public class OptionReference implements IOption {
*/
public OptionReference(ToolReference owner, IConfigurationElement element) {
this.owner = owner;
- option = owner.getTool().getOption(element.getAttribute("id"));
+ option = owner.getTool().getOption(element.getAttribute(IOption.ID));
owner.addOptionReference(this);
// value
switch (option.getValueType()) {
case IOption.BOOLEAN:
- value = new Boolean(element.getAttribute("defaultValue"));
+ value = new Boolean(element.getAttribute(IOption.DEFAULT_VALUE));
break;
case IOption.STRING:
- value = element.getAttribute("defaultValue");
+ value = element.getAttribute(IOption.DEFAULT_VALUE);
break;
case IOption.ENUMERATED:
try {
@@ -84,9 +84,9 @@ public class OptionReference implements IOption {
case IOption.PREPROCESSOR_SYMBOLS:
case IOption.LIBRARIES:
List valueList = new ArrayList();
- IConfigurationElement[] valueElements = element.getChildren("optionValue");
+ IConfigurationElement[] valueElements = element.getChildren(IOption.LIST_VALUE);
for (int i = 0; i < valueElements.length; ++i) {
- valueList.add(valueElements[i].getAttribute("value"));
+ valueList.add(valueElements[i].getAttribute(IOption.VALUE));
}
value = valueList;
break;
@@ -101,29 +101,29 @@ public class OptionReference implements IOption {
*/
public OptionReference(ToolReference owner, Element element) {
this.owner = owner;
- option = owner.getTool().getOption(element.getAttribute("id"));
+ option = owner.getTool().getOption(element.getAttribute(IOption.ID));
owner.addOptionReference(this);
// value
switch (option.getValueType()) {
case IOption.BOOLEAN:
- value = new Boolean(element.getAttribute("defaultValue"));
+ value = new Boolean(element.getAttribute(IOption.DEFAULT_VALUE));
break;
case IOption.STRING:
case IOption.ENUMERATED:
- value = (String) element.getAttribute("defaultValue");
+ value = (String) element.getAttribute(IOption.DEFAULT_VALUE);
break;
case IOption.STRING_LIST:
case IOption.INCLUDE_PATH:
case IOption.PREPROCESSOR_SYMBOLS:
case IOption.LIBRARIES:
List valueList = new ArrayList();
- NodeList nodes = element.getElementsByTagName("optionValue");
+ NodeList nodes = element.getElementsByTagName(IOption.LIST_VALUE);
for (int i = 0; i < nodes.getLength(); ++i) {
Node node = nodes.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
- valueList.add(((Element)node).getAttribute("value"));
+ valueList.add(((Element)node).getAttribute(IOption.VALUE));
}
}
value = valueList;
@@ -139,16 +139,16 @@ public class OptionReference implements IOption {
* @param element
*/
public void serialize(Document doc, Element element) {
- element.setAttribute("id", option.getId());
+ element.setAttribute(IOption.ID, option.getId());
// value
switch (option.getValueType()) {
case IOption.BOOLEAN:
- element.setAttribute("defaultValue", ((Boolean)value).toString());
+ element.setAttribute(IOption.DEFAULT_VALUE, ((Boolean)value).toString());
break;
case IOption.STRING:
case IOption.ENUMERATED:
- element.setAttribute("defaultValue", (String)value);
+ element.setAttribute(IOption.DEFAULT_VALUE, (String)value);
break;
case IOption.STRING_LIST:
case IOption.INCLUDE_PATH:
@@ -157,8 +157,8 @@ public class OptionReference implements IOption {
ArrayList stringList = (ArrayList)value;
ListIterator iter = stringList.listIterator();
while (iter.hasNext()) {
- Element valueElement = doc.createElement("optionValue");
- valueElement.setAttribute("value", (String)iter.next());
+ Element valueElement = doc.createElement(IOption.LIST_VALUE);
+ valueElement.setAttribute(IOption.VALUE, (String)iter.next());
element.appendChild(valueElement);
}
break;
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java
index 5564b5b72b..488e1fb8d9 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java
@@ -62,42 +62,42 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
this(target);
// id
- setId(element.getAttribute("id"));
+ setId(element.getAttribute(ITool.ID));
// hook me up
target.addTool(this);
// name
- setName(element.getAttribute("name"));
+ setName(element.getAttribute(ITool.NAME));
// Get the supported input file extension
- String inputs = element.getAttribute("sources") == null ?
+ String inputs = element.getAttribute(ITool.SOURCES) == null ?
new String() :
- element.getAttribute("sources");
+ element.getAttribute(ITool.SOURCES);
StringTokenizer tokenizer = new StringTokenizer(inputs, DEFAULT_SEPARATOR);
while (tokenizer.hasMoreElements()) {
getInputExtensions().add(tokenizer.nextElement());
}
// Get the output extension
- outputExtension = element.getAttribute("outputs") == null ?
+ outputExtension = element.getAttribute(ITool.OUTPUTS) == null ?
new String() :
- element.getAttribute("outputs");
+ element.getAttribute(ITool.OUTPUTS);
// Get the tool invocation
- command = element.getAttribute("command") == null ?
+ command = element.getAttribute(ITool.COMMAND) == null ?
new String() :
- element.getAttribute("command");
+ element.getAttribute(ITool.COMMAND);
// Get the flag to control output
- outputFlag = element.getAttribute("outputFlag") == null ?
+ outputFlag = element.getAttribute(ITool.OUTPUT_FLAG) == null ?
new String() :
- element.getAttribute("outputFlag");
+ element.getAttribute(ITool.OUTPUT_FLAG);
// Get the output prefix
- outputPrefix = element.getAttribute("outputPrefix") == null ?
+ outputPrefix = element.getAttribute(ITool.OUTPUT_PREFIX) == null ?
new String() :
- element.getAttribute("outputPrefix");
+ element.getAttribute(ITool.OUTPUT_PREFIX);
// set up the category map
categoryMap = new HashMap();
@@ -107,9 +107,9 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
IConfigurationElement[] toolElements = element.getChildren();
for (int l = 0; l < toolElements.length; ++l) {
IConfigurationElement toolElement = toolElements[l];
- if (toolElement.getName().equals("option")) {
+ if (toolElement.getName().equals(ITool.OPTION)) {
new Option(this, toolElement);
- } else if (toolElement.getName().equals("optionCategory")) {
+ } else if (toolElement.getName().equals(ITool.OPTION_CAT)) {
new OptionCategory(this, toolElement);
}
}
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java
index 3ce12a2890..a670db24dc 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java
@@ -65,7 +65,7 @@ public class ToolReference implements ITool {
IConfigurationElement[] toolElements = element.getChildren();
for (int m = 0; m < toolElements.length; ++m) {
IConfigurationElement toolElement = toolElements[m];
- if (toolElement.getName().equals("optionRef")) {
+ if (toolElement.getName().equals(ITool.OPTION_REF)) {
new OptionReference(this, toolElement);
}
}
@@ -89,7 +89,7 @@ public class ToolReference implements ITool {
NodeList configElements = element.getChildNodes();
for (int i = 0; i < configElements.getLength(); ++i) {
Node configElement = configElements.item(i);
- if (configElement.getNodeName().equals("optionRef")) {
+ if (configElement.getNodeName().equals(ITool.OPTION_REF)) {
new OptionReference(this, (Element)configElement);
}
}
@@ -103,12 +103,12 @@ public class ToolReference implements ITool {
* to persist settings.
*/
public void serialize(Document doc, Element element) {
- element.setAttribute("id", parent.getId());
+ element.setAttribute(ITool.ID, parent.getId());
if (optionReferences != null)
for (int i = 0; i < optionReferences.size(); ++i) {
OptionReference optionRef = (OptionReference)optionReferences.get(i);
- Element optionRefElement = doc.createElement("optionRef");
+ Element optionRefElement = doc.createElement(ITool.OPTION_REF);
element.appendChild(optionRefElement);
optionRef.serialize(doc, optionRefElement);
}

Back to the top