From 0a34816ffeb19d7ac76530e1b758abaada2c9fbf Mon Sep 17 00:00:00 2001 From: Jay Jay Billings Date: Fri, 9 Jan 2015 11:29:56 -0500 Subject: [PATCH] Removed 588 lines of useless comments. Signed-off-by: Jay Jay Billings --- .../src/org/eclipse/ice/item/Item.java | 683 ++---------------- 1 file changed, 47 insertions(+), 636 deletions(-) diff --git a/src/org.eclipse.ice.item/src/org/eclipse/ice/item/Item.java b/src/org.eclipse.ice.item/src/org/eclipse/ice/item/Item.java index 785d2d6d6..43b8ad639 100644 --- a/src/org.eclipse.ice.item/src/org/eclipse/ice/item/Item.java +++ b/src/org.eclipse.ice.item/src/org/eclipse/ice/item/Item.java @@ -89,8 +89,6 @@ import java.nio.file.StandardCopyOption; /** - * - *

* The Item class is responsible for carrying out activities necessary to * perform certain tasks with ICE. The operations process(), setupForm(), and * reviewEntries() should be tailored and called by subclasses as needed. The @@ -100,8 +98,7 @@ * FormStatus.ReadyToProcess state and all subclasses shall obey the rule that * Items are initialized with an acceptable set of default parameters such that * they could be processed immediately. - *

- *

+ * * Instances of classes that realize the IUpdateable interface can be registered * to receive updates from others in the Item with the Registry. Subclasses * should override registerUpdateables(). This operation performs parent-child @@ -111,35 +108,29 @@ * re-registered if the Item is copied. IUpdateables should never be registered * outside of this operation. (We'll cross the bridge of dynamically updated * dependencies when we get to it...) - *

- *

+ * * Items may be loaded from a file. This file is either an XML file of the form * required by the Item's JAXB annotations or it is in the Painfully Simple Form * file format. Items may be initialized using either file type, but they will * only persist to the ICE database or to the XML form of an Item. Items must be * loaded by calling either loadFromXML() or loadFromPSF() after construction. * If it can not read properly either a PSF or XML format, it will fail. - *

- *

+ * * By default, the reviewEntries() operation on an Item only performs simple * dependency checks to determine if Entries should or should not be notified * that their parents have changed or been marked ready. The default * implementation of setupForm() will add Entries with parents to the Registry * if the Item is loaded from a file, otherwise it will do nothing. - *

- *

+ * * The only Actions available to the Item by default are actions to write the * Item's Form to an XML file or a "tagged output" where the tags of Entries are * used as keys associated with the values of the Entry. If the Entries do not * have tags, then the names of the Entries are used. - *

- *

+ * * The Item class realizes the IComponent Visitor interface so that it can map * the Components in the Form and determine their types. - *

- *

- * The Item behaves as follows for each state: - *

+ * + * The Item behaves as follows for each state:

* * * @@ -251,15 +242,13 @@ * Items can be stored to JPA databases. See the *Database() operations for more * information. *

- *

* Items can be disabled and put in to a "read-only" mode where their forms can * be read, but the Item will not accept updated Forms or process actions. * Attempts to process the Item or submit a form will return * FormStatus.Unacceptable if the Item is disabled. Checking the Item's status * with getStatus() will also return FormStatus.Unacceptable. Items are enabled * by default. - *

- *

+ * * The Item class also logs output to an output file. This file includes any * information that the author of the subclass of the Item wants to persist when * the Item is processed. It may or may not include, at the discretion of the @@ -273,72 +262,47 @@ * clients should be careful to only read from the file. Unfortunately there is * no good way to pass a read-only file in Java because that is an OS dependent * operation. - *

- *

+ * * If the project space for the Item has not be set upon construction, the * output file will not be configured and getOutputFile() will be null. - *

- *

+ * * Items can also be observed by ItemListeners. Subclasses must implement the * calls to update the listeners on their own, although some protected utility * operations like notifyListenersOfProjectChange() exist. - *

- *

+ * * Every Item has a directory at its disposal for storing preferences or scratch * data. This directory can be retrieved by subclasses by calling * getPreferencesDirectory(). This directory should only include preferences, * configuration information, scratch data or other types of data that are not * directly consumed by users. - *

- *

+ * * Subclasses may override the loadInput() operation to handle input data * import. This operation is passed an inputstream that should contain data of * the proper format when a client tries to import data. - *

- *

+ * * Items can also receive updates from other ICE subsystems, remote ICE * subsystems or external third-party processes through via the update() * operation. In practice, these messages are filtered by classes higher up the * call stack and acted upon by the Item. - *

- * * * @author Jay Jay Billings - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ @XmlRootElement(name = "Item") public class Item implements IComponentVisitor, Identifiable, IUpdateableListener { /** - * - *

* The ItemType of the Item. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ @XmlAttribute() protected ItemType itemType; /** - * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" + * The Registry used to manage registration and update events between the + * Item and the various data structures. */ @XmlTransient() protected Registry registry; /** - * - *

* The Item's Form. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ @XmlAnyElement() @XmlElementRefs(value = { @@ -346,238 +310,116 @@ public class Item implements IComponentVisitor, Identifiable, @XmlElementRef(name = "JobLauncherForm", type = JobLauncherForm.class) }) protected Form form; /** - * - *

* The action that is currently being performed by the Item. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ @XmlTransient() protected Action action; /** - * - *

* The list of Actions that the Item can perform. It must be specified by a * subclass during construction. - *

- * * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ @XmlElement(name = "AllowedActions") protected ArrayList allowedActions; /** - * - *

* The Eclipse Project where the ICEResources created by this project should * be stored. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ @XmlTransient() protected IProject project; /** - * - *

* The most recent status of the Item. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ @XmlAttribute() protected FormStatus status; /** - * - *

* The list of Entries from the Form. This list is maintained to improve the * speed of reviewEntries() and is created in setupForm() when it is called * by loadFromXML() or loadFromPSF(). - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ protected ArrayList entryList; /** - * - *

* The string that is used to describe the process by which the Item class * writes the Form in ICE's native XML format. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ protected String nativeExportActionString = "Export to ICE Native Format"; /** - * - *

* The string that is used to describe the process by which the Item class * writes the values of the Entries in the Form to a file using their tags, * or their names if no tags are available, as keys. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ protected String taggedExportActionString = "Export to key-value pair output"; /** - * - *

* A map that contains all of the Components of the Form with each Component * type as a key (data, output or table) and an arraylist of the Components * as the value. - *

- * */ protected HashMap> componentMap; /** - * - *

* The unique identification number of the Item. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ protected int uniqueId; /** - * - *

* The name of the Item. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ protected String itemName; /** - * - *

* The description of the Item. This description should be different than * the name of the Item and should contain information that would be useful * to a human user. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ protected String itemDescription; /** - * - *

* The ICEJAXBHandler used to marshal Items to and from XML. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ @XmlTransient protected ICEJAXBHandler jaxbManipulator; /** - * - *

* A specifically attribute designed to be utilized by the JPA database. * This variable should not be accessed normally by ICE, only by JPA. DO NOT * OVERRIDE THIS VARIABLE! - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ protected int DB_ID; /** - * - *

* The itemBuilder's name. The default value is null and can only be set * once. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ @XmlAttribute(name = "builderName") protected String builderName; /** - * - *

* True if the Item is enabled, false if the Item is disabled. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ @XmlTransient private boolean enabled = true; /** - * - *

* The last status of the Item before it was process or modified. This is * used, for example, when killing processes or disabling the Item so that * the it can be reverted to the last state. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ @XmlTransient private FormStatus lastStatus; /** - * - *

* The file handle to the output file that stores output generated by this * Item during processing. The data in this file is information provided by * the Item and may or may not include, at the discretion of the author of * the subclass, output collected from externally launched programs. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ @XmlTransient protected File outputFile; /** - * - *

* The list of listeners observing this Item. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ @XmlTransient() protected ArrayList listeners; @@ -603,8 +445,6 @@ public class Item implements IComponentVisitor, Identifiable, private IActionFactory actionFactory; /** - * - *

* The constructor. Subclasses of Item should implement their own * constructor, but creating the Form should be done in the setupForm() * operation, which is called by this constructor. Creating the Form @@ -612,19 +452,12 @@ public class Item implements IComponentVisitor, Identifiable, * project where the Item should store files is passed as an argument. Since * there is no guarantee that the Item will actually need this argument, it * may be null. - *

- * * * @param projectSpace - *

* The Eclipse project where files should be stored for this * Item. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public Item(IProject projectSpace) { - // begin-user-code // Determine whether or not ICE is in debug mode if (System.getProperty("DebugICE") != null) { @@ -693,29 +526,19 @@ public Item(IProject projectSpace) { setupOutputFile(); return; - // end-user-code } /** - * - *

* A nullary constructor. This constructor should only be used by JAXB or * JPA for loading the Item from a serialized or transactional form * respectively. If this constructor is used, setProject() must be called * immediately after or an Item will not function. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public Item() { - // begin-user-code // Just call the other constructor with a null argument. this(null); - // end-user-code } /** @@ -789,11 +612,8 @@ public void setActionFactory(IActionFactory factory) { * (non-Javadoc) * * @see Identifiable#setId(int id) - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void setId(int id) { - // begin-user-code if (id >= 0) { // Set the unique id @@ -805,94 +625,70 @@ public void setId(int id) { return; - // end-user-code } /** * (non-Javadoc) * * @see Identifiable#getDescription() - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ @XmlAttribute() public String getDescription() { - // begin-user-code return itemDescription; - // end-user-code } /** * (non-Javadoc) * * @see Identifiable#getId() - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ @XmlAttribute() public int getId() { - // begin-user-code return uniqueId; - // end-user-code } /** * (non-Javadoc) * * @see Identifiable#setName(String name) - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void setName(String name) { - // begin-user-code if (name != null) { itemName = name; } - // end-user-code } /** * (non-Javadoc) * * @see Identifiable#getName() - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ @XmlAttribute public String getName() { - // begin-user-code return itemName; - // end-user-code } /** * (non-Javadoc) * * @see Identifiable#setDescription(String description) - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void setDescription(String description) { - // begin-user-code if (description != null) { this.itemDescription = description; } - // end-user-code } /** * (non-Javadoc) * * @see Identifiable#equals(Object otherObject) - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public boolean equals(Object otherObject) { - // begin-user-code // Local Declarations boolean retVal = false; @@ -923,52 +719,31 @@ public boolean equals(Object otherObject) { return retVal; - // end-user-code } /** - * - *

* This operation returns the type of the Item. The type of the Item is * determined by the Item class or a subclass and can not be set. - *

- * * - * @return

- * The type of the Item. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" + * @return The type of the Item. */ public ItemType getItemType() { - // begin-user-code return this.itemType; - // end-user-code } /** - * - *

* This operation returns a Form for the Item. - *

- *

+ * * If this operation is called immediately after processItem() with the same * Item id and the call to processItem() returns FormStatus.NeedsInfo, then * this operation will return a simple Form composed of a single * DataComponent with Entries for all of the additional required * information. The smaller Form is created by the Action that is executed * during the call to processItem(). - *

- * * - * @return

- * The Form that Eclipse User must prepare. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" + * @return The Form that Eclipse User must prepare. */ public Form getForm() { - // begin-user-code // Local Declarations Form actionForm = null; @@ -984,37 +759,24 @@ public Form getForm() { return actionForm; } - // end-user-code } /** - * - *

* This operation submits a Form to the Item for processing. - *

- *

+ * * This operation only reviews the contractual obligations of the Form and * the Item class, such as matching Item and Form.getItemId() values. * Business concerns are reviewed in Item.reviewEntries, which is called by * this class. This class also handles overwriting or discarding Forms as * required. - *

- * * * @param preparedForm - *

* A Form that has been prepared by the Eclipse User with * information that is required by the Item. - *

- * @return

- * The ItemStatus value that specifies whether or not the Form was + * @return The ItemStatus value that specifies whether or not the Form was * accepted by the Item. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public FormStatus submitForm(Form preparedForm) { - // begin-user-code // Local Declarations FormStatus retVal = FormStatus.InfoError; @@ -1088,17 +850,13 @@ public FormStatus submitForm(Form preparedForm) { status = retVal; return retVal; - // end-user-code } /** - * - *

* The process operation processes the data in the Form to perform a certain * action. The action name must be one of the set of actions from the Form * that represents this Item. - *

- *

+ * * It is possible that ICE may require information in addition to that which * was requested in the original Form, such as for a username and password * for a remote machine. If this is the case, process will return @@ -1106,8 +864,7 @@ public FormStatus submitForm(Form preparedForm) { * Item by calling getItem(). Once this new Form is submitted (by calling * Item.submitForm() with the completed Form), the Item will finish * processing. - *

- *

+ * * This operation must be tailored by subclasses to initiate specific * Actions. The only Actions available to the Item by default are actions to * write the Item's Form to an XML file or a "tagged output" where the tags @@ -1120,25 +877,16 @@ public FormStatus submitForm(Form preparedForm) { * actions are be "Export to ICE Native Format" and * "Export to key-value pair output." Subclasses may choose to add * additional actions or to remove the default actions. - *

- * * * @param actionName - *

* The name of action that should be performed using the * processed Form data. - *

- * @return

- * The status of the Item after processing the Form and executing + * @return The status of the Item after processing the Form and executing * the action. It returns FormStatus.InfoError if it is unable to * run for any reason, including being asked to run actions that are * not in the list of available actions. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public FormStatus process(String actionName) { - // begin-user-code // Local Declarations FormStatus retStatus = FormStatus.InfoError; @@ -1210,50 +958,28 @@ public FormStatus process(String actionName) { return FormStatus.Unacceptable; } - // end-user-code } /** - * - *

* This operation cancels all processes with the specified name. - *

- * * * @param actionName - *

* The name of action that should be canceled. - *

- * @return

- * The status of the Item after canceling or trying to cancel an + * @return The status of the Item after canceling or trying to cancel an * action. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public FormStatus cancelProcess(String actionName) { - // begin-user-code // TODO Auto-generated method stub return FormStatus.InfoError; - // end-user-code } /** - * - *

* This operation cancels the last process request sent to the Item. - *

- * * - * @return

- * The status of the Item after canceling or trying to cancel an + * @return The status of the Item after canceling or trying to cancel an * action. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public FormStatus cancelProcess() { - // begin-user-code // Only cancel if the Item is actuallly processing if (action != null && status.equals(FormStatus.Processing)) { @@ -1264,41 +990,23 @@ public FormStatus cancelProcess() { } return status; - // end-user-code } /** - * - *

* This operation returns the list of available actions for an Item. - *

- * * - * @return

- * The list of actions available in the Item. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" + * @return The list of actions available in the Item. */ public ArrayList getAvailableActions() { - // begin-user-code return (ArrayList) allowedActions.clone(); - // end-user-code } /** - * - *

* This operation returns the status of the Item. - *

- * * - * @return - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" + * @return The current status of the Item. */ public FormStatus getStatus() { - // begin-user-code // If the Item is disabled, do not do any further checks. Just report // it. @@ -1313,88 +1021,58 @@ public FormStatus getStatus() { } return status; - // end-user-code } /** - * - *

* This protected operation setups the Entries, DataComponents and Form for * a subclass of Item. The default implementation of setupForm() will add * Entries with parents to the Registry if the Item is loaded from a file, * otherwise it will do nothing. Subclasses should tailor this operation as * needed. The list of allowed Actions may also be specified here. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ protected void setupForm() { - // begin-user-code // Initialize the Form it should be a PSF in case the Item is loaded // from a PSF file. form = new PainfullySimpleForm(); return; - // end-user-code } /** - * - *

* This operation is used to setup the name and description of an Item. This * information can be provided by the ItemBuilder responsible for this Item * or any client, but it is convenient to define it on the class. It is also * convenient to define it separately of the work in setupForm(). The * default implementation of this operation does nothing and subclasses must * override it. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ protected void setupItemInfo() { - // begin-user-code // Do nothing by default - // end-user-code } /** - * - *

* The reviewEntries operations reviews and updates Entry values as needed. * This is an abstract operation that must be implemented by a subclass. - *

- *

+ * * This operation is only concerned with the business issues of the Form and * not the contractual obligations that it must fulfill to satisfy ICE. For * example, reviewEntries() should make sure that the Form has acceptable * Entries for the particular business problem instead of worrying about * unique identifiers. This operation should also return the status of the * Form as a literal from the FormStatus enumeration. - *

- *

+ * * By default, the reviewEntries() operation on an Item only performs simple * dependency checks to determine if Entries should or should not be * notified that their parents have changed or been marked ready. - *

- * * * @param preparedForm - * @return

- * True if the Entries are completely specified and the Item can be + * @return True if the Entries are completely specified and the Item can be * processed, false otherwise. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ protected FormStatus reviewEntries(Form preparedForm) { - // begin-user-code // Local Declarations FormStatus retStatus = FormStatus.InfoError; @@ -1421,31 +1099,21 @@ protected FormStatus reviewEntries(Form preparedForm) { } return retStatus; - // end-user-code } /** - * - *

* This operation performs dependency matching by registering IUpdateable * objects with the registry based on values and child names. Subclasses * should always override this operation to register their dependencies * since dependencies must be re-registered if the Item is copied. This * operation does a non-trivial task, so subclasses should always call * super.registerUpdateables() too. - *

- *

+ * * The default implementation pulls all Entries from all Data, Table and * Output components and registers parent-child dependencies for those * Entries. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ protected void registerUpdateables() { - // begin-user-code // Create the registry registry = new Registry(); @@ -1481,24 +1149,14 @@ protected void registerUpdateables() { // can mark themselves ready. registry.dispatch(); - // end-user-code } /** - * - *

* This operation returns the hashcode value of the Item. - *

- * * - * @return

- * The hashcode - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" + * @return The hashcode */ public int hashCode() { - // begin-user-code // Local Declaration int hash = 9; @@ -1522,26 +1180,16 @@ public int hashCode() { hash += 31 * this.builderName.hashCode(); return hash; - // end-user-code } /** - * - *

* This operation performs a deep copy of the attributes of another Item * into the current Item. - *

- * * * @param otherItem - *

* The Item from which information should be copied. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void copy(Item otherItem) { - // begin-user-code // Return if otherItem is null if (otherItem == null) { @@ -1568,24 +1216,14 @@ public void copy(Item otherItem) { setupEntryList(); return; - // end-user-code } /** - * - *

* This operation provides a deep copy of the Item. - *

- * * - * @return

- * A clone of the Item. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" + * @return A clone of the Item. */ public Object clone() { - // begin-user-code // Create a new instance, copy contents, and return it // create a new instance of Item and copy contents @@ -1593,31 +1231,22 @@ public Object clone() { item.copy(this); return item; - // end-user-code - } /** - * - *

* This operation loads the SerializedItem from a Painfully Simple Form file * format. If it is unable to load the InputStream or determines that the * contents of the stream are not consistent with the PSF format, then it * will throw an IOException. It delegates the actual work to a * PainfullySimpleForm. - *

- * * * @param inputStream - *

* The InputStream that contains a PSF file. - *

* @throws IOException - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" + * This exception is thrown if there is a problem with the + * Inputstream. */ public void loadFromPSF(InputStream inputStream) throws IOException { - // begin-user-code // Local Declarations InputStreamReader inputStreamReader = null; @@ -1658,54 +1287,34 @@ public void loadFromPSF(InputStream inputStream) throws IOException { throw new IOException( "PSF cannot be loaded from a null InputStream!"); } - // end-user-code } /** - * - *

* This operation returns true if the Item is already associated with a * project space that it can use for storing and retrieving files. That is, * it returns true if the non-nullary constructor was called or setProject() * has been called. - *

- * * - * @return

- * True if the Item has a project, false otherwise. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" + * @return True if the Item has a project, false otherwise. */ public boolean hasProject() { - // begin-user-code // Return true if the Project is set return (project != null); - // end-user-code } /** - * - *

* This operation sets the project for the Item. It should only be called * after the Item is constructed with its nullary constructor. Calling it * after the Item has been running for a time could lead to unintended * consequences. - *

- * * * @param projectSpace - *

* The Eclipse Platform IProject that should be referenced for * project space information by this Item. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void setProject(IProject projectSpace) { - // begin-user-code // Set the project so long as it is not null if (projectSpace != null) { @@ -1717,24 +1326,15 @@ public void setProject(IProject projectSpace) { // FIXME - SHOULD THIS ONLY BE ALLOWED TO BE CALLED ONCE??? ~JJB // 20120502 14:01 - // end-user-code } /** - * - *

* This operation sets up a master list of Entries that are managed by the * Item base class to handle dependencies and accelerate dependency * checking. It is called by the non-nullary constructor and the loadFrom* * operations. It also add the components to the Item's component map. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ private void setupEntryList() { - // begin-user-code // Local Declarations int numComps = 0; @@ -1761,32 +1361,20 @@ private void setupEntryList() { } } - // end-user-code } /** - * - *

* This operation adds a Component to the component map with the specified * key (data, output or table). It is called by the visit() operations that * the Item realizes to satisfy the IComponentVisitor interface. - *

- * * * @param component - *

* The Component to insert into the map of Components. - *

* @param key - *

* The key that identifies the type of the Component, equal to * one of "data," "output" or "table." - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ private void addComponentToMap(Component component, String key) { - // begin-user-code // Local Declarations ArrayList components = null; @@ -1800,21 +1388,12 @@ private void addComponentToMap(Component component, String key) { } return; - // end-user-code } /** - * - *

* This operation instantiates the output file. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ private void setupOutputFile() { - // begin-user-code // Setup the output file handle name String outputFilename = form.getName().replaceAll("\\s+", "_") + "_" @@ -1837,35 +1416,23 @@ private void setupOutputFile() { } return; - // end-user-code } /** - * - *

* This operation returns a list of files in the current project space with * the given type or all of the files in the project space if no type is * selected (type = null) if and only if the project space is available. If * the project space is not available, it will return null. - *

- * * * @param type - *

* The file extension or type of the file that should be * discovered in the project or null if all files should be * returned by this operation. - *

- * @return

- * The names of the files in the project space with the given type + * @return The names of the files in the project space with the given type * or names of all of the files in the project space if no type is * specified. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ protected ArrayList getProjectFileNames(String type) { - // begin-user-code ArrayList files = null, allFiles = null; @@ -1908,72 +1475,42 @@ protected ArrayList getProjectFileNames(String type) { } return files; - // end-user-code } /** - * - *

* This operation directs the Item to reload data that it has read from its * project. Calling this operation signifies to the Item that new files have * been added or old files have been updated in the project. - *

- *

+ * * Calling this operation does not refresh the IProject. - *

- *

+ * * This operation is meant to be overridden by subclasses and customized. It * does nothing on the base class. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void reloadProjectData() { - // begin-user-code // TODO Auto-generated method stub - // end-user-code } /** - * - *

* This operation adds a listeners to the Item's set of listeners. - *

- * * * @param listener - *

* The new listener that is subscribing to the Item for updates. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void addListener(ItemListener listener) { - // begin-user-code if (listener != null) { listeners.add(listener); } return; - // end-user-code } /** - * - *

* This operation notifies the listeners of a change in the IProject, * normally do to a newly created or deleted resource. - *

- * - * - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ protected void notifyListenersOfProjectChange() { - // begin-user-code // Notify all of the listeners that they should reload their project // data because the project has been changed somehow. @@ -1982,27 +1519,17 @@ protected void notifyListenersOfProjectChange() { } return; - // end-user-code } /** - * - *

* This operation returns the Eclipse IFolder that points to the preferences * directory for this Item. This operation will try to create the directory * in the project if the project exists. It will return null if the project * space doesn't exist or it can't create the directory. - *

- * * - * @return

- * The directory where preferences should be stored. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" + * @return The directory where preferences should be stored. */ protected IFolder getPreferencesDirectory() { - // begin-user-code // Local Declarations String folderName = getName().replaceAll("\\s+", "_"); @@ -2024,7 +1551,6 @@ protected IFolder getPreferencesDirectory() { return folder; - // end-user-code } /** @@ -2245,67 +1771,43 @@ protected void copyFiles(String sourceDir, String destinationDir, } /** - * - *

* This operation loads data into the Item from an input file. This * operation should be overridden by subclasses and specialized for the * correct behavior. The implementation on the base class does nothing. - *

- *

+ * * Subclasses that override this operation should make sure that a failed * load does not result in a partially initialized or incorrect Form and an * erroneous Item state. - *

- *

+ * * This operation expects that the file is in the workspace and only needs * its name to find it. - *

- * * * @param input - *

* The file containing the input that should be loaded. It should * be a file in the project space. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void loadInput(String input) { - // begin-user-code // TODO Auto-generated method stub - // end-user-code } /** - * - *

* This operation updates the Item to let it know that a particular event * has occurred in an ICE subsystem, remote ICE subsystem or external * third-party process. - *

- *

+ * * The base class takes care of a small amount of worked related to * messages, namely writing them to the process log, and subclasses should * override this operation to specialize the behavior. Subclasses should * still call the operation on the base class (via super.update(msg)) from * their overridden operation so that the message can be properly logged. - *

- * * * @param msg - *

* The incoming Message. - *

- * @return

- * True if the Item was able to respond to the Message, false + * @return True if the Item was able to respond to the Message, false * otherwise. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public boolean update(Message msg) { - // begin-user-code // Dump the text to stdout if we are in debugging mode. if (debuggingEnabled) { @@ -2319,28 +1821,18 @@ public boolean update(Message msg) { // Just return true for now until the logging functionality can be moved // from JobLauncher to Item. return true; - // end-user-code } /** - * - *

* This operation sets the Item's builderName. This operation can only be * called once. Although this operation is public, it should only be called * in the respective ItemBuilder class. - *

- * * * @param builderName - *

* The builderName to be set. Can not be null or the empty * string. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void setItemBuilderName(String builderName) { - // begin-user-code // If the passed parameter is not null, not an empty string, and the // builder name has not been set. @@ -2351,76 +1843,43 @@ public void setItemBuilderName(String builderName) { this.builderName = builderName; } - // end-user-code } /** - * - *

* This operation sets the Item's builderName. This operation can only be * called once. Although this operation is public, it should only be called * in the respective ItemBuilder class. - *

- * * - * @return

- * Returns the builder name. This can be null. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" + * @return Returns the builder name. This can be null. */ public String getItemBuilderName() { - // begin-user-code return this.builderName; - // end-user-code } /** - * - *

* This operation disables the Item. Disabled Items will not accept changes * to their Forms and they cannot be processed. - *

- * * * @param state - *

* True if the Item is disabled, false if not. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void disable(boolean state) { - // begin-user-code // Enable is the opposite of disabled. enabled = !state; - // end-user-code } /** - * - *

* True if the Item is enabled, false if it is disabled. - *

- * * - * @return

- * True if the Item is enabled, false if not. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" + * @return True if the Item is enabled, false if not. */ public boolean isEnabled() { - // begin-user-code return enabled; - // end-user-code } /** - * - *

* This operation returns a file handle to the output file for the Item. It * returns a handle to the file whether or not it actually exists and * clients should check the File.exists() operation before attempting to @@ -2430,17 +1889,10 @@ public boolean isEnabled() { * to only read from the file. Nullerizing the file handle will not * nullerize it in the Item. If the output file for the Item has not been * configured, this operation will return null. - *

- * * - * @return

- * The output file for this Item, thoroughly documented elsewhere. - *

- * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" + * @return The output file for this Item, thoroughly documented elsewhere. */ public File getOutputFile() { - // begin-user-code // Local Declarations File copiedFileHandle = null; @@ -2450,7 +1902,6 @@ public File getOutputFile() { copiedFileHandle = new File(outputFile.toURI()); } return copiedFileHandle; - // end-user-code } /** @@ -2477,134 +1928,98 @@ protected IActionFactory getActionFactory() { * (non-Javadoc) * * @see IComponentVisitor#visit(DataComponent component) - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void visit(DataComponent component) { - // begin-user-code // Add the Component to the map of components addComponentToMap(component, "data"); return; - // end-user-code } /** * (non-Javadoc) * * @see IComponentVisitor#visit(ResourceComponent component) - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void visit(ResourceComponent component) { - // begin-user-code // TODO Auto-generated method stub - // end-user-code } /** * (non-Javadoc) * * @see IComponentVisitor#visit(TableComponent component) - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void visit(TableComponent component) { - // begin-user-code // Add the Component to the map of components addComponentToMap(component, "table"); return; - // end-user-code } /** * (non-Javadoc) * * @see IComponentVisitor#visit(MatrixComponent component) - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void visit(MatrixComponent component) { - // begin-user-code // TODO Auto-generated method stub - // end-user-code } /** * (non-Javadoc) * * @see IComponentVisitor#visit(IShape component) - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void visit(IShape component) { - // begin-user-code // TODO Auto-generated method stub - // end-user-code } /** * (non-Javadoc) * * @see IComponentVisitor#visit(GeometryComponent component) - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void visit(GeometryComponent component) { - // begin-user-code // TODO Auto-generated method stub - // end-user-code } /** * (non-Javadoc) * * @see IComponentVisitor#visit(MasterDetailsComponent component) - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void visit(MasterDetailsComponent component) { - // begin-user-code // TODO Auto-generated method stub - // end-user-code } /** * (non-Javadoc) * * @see IComponentVisitor#visit(TreeComposite component) - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void visit(TreeComposite component) { - // begin-user-code // TODO Auto-generated method stub - // end-user-code } /** * (non-Javadoc) * * @see IComponentVisitor#visit(IReactorComponent component) - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void visit(IReactorComponent component) { - // begin-user-code // TODO Auto-generated method stub - // end-user-code } @Override @@ -2619,14 +2034,10 @@ public void visit(TimeDataComponent component) { * (non-Javadoc) * * @see IComponentVisitor#visit(MeshComponent component) - * @generated - * "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public void visit(MeshComponent component) { - // begin-user-code // TODO Auto-generated method stub - // end-user-code } @Override