001: //$Id: IAction.java 218 2006-03-02 23:23:29Z jg_hamburg $
002: /********************************************************************************
003: * DDTUnit, a Datadriven Approach to Unit- and Moduletesting
004: * Copyright (c) 2004, Joerg and Kai Gellien
005: * All rights reserved.
006: *
007: * The Software is provided under the terms of the Common Public License 1.0
008: * as provided with the distribution of DDTUnit in the file cpl-v10.html.
009: * Redistribution and use in source and binary forms, with or without
010: * modification, are permitted provided that the following conditions
011: * are met:
012: *
013: * + Redistributions of source code must retain the above copyright
014: * notice, this list of conditions and the following disclaimer.
015: *
016: * + Redistributions in binary form must reproduce the above
017: * copyright notice, this list of conditions and the following
018: * disclaimer in the documentation and/or other materials provided
019: * with the distribution.
020: *
021: * + Neither the name of the authors or DDTUnit, nor the
022: * names of its contributors may be used to endorse or promote
023: * products derived from this software without specific prior
024: * written permission.
025: *
026: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
027: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
028: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
029: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
030: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
031: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
032: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
033: * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
034: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
035: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
036: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
037: ********************************************************************************/package junitx.ddtunit.data.processing;
038:
039: import junitx.ddtunit.data.TypedObject;
040:
041: public interface IAction {
042: /**
043: * Used to append {@link TypedObject}that should be processed on this
044: * action.
045: */
046: IAction inject();
047:
048: /**
049: * Create injected object to according type specification on this action.
050: * Just do nothing if object allready instanciated.
051: *
052: * @return RecordBase
053: * @throws ClassNotFoundException
054: * @throws InstantiationException
055: * @throws IllegalAccessException
056: */
057: TypedObject createObject();
058:
059: TypedObject getObject();
060:
061: void setObject(TypedObject tObj);
062:
063: void setValue(Object obj);
064:
065: Object getValue();
066:
067: String getId();
068:
069: /**
070: * do process required action to transition from this state
071: */
072: IAction process();
073:
074: /**
075: * Process successor in action stack.
076: *
077: * @param successor action in stack
078: */
079: void processSuccessor(IAction successor);
080:
081: /**
082: * Process action if no successor exists on action stack.
083: */
084: void processNoSuccessor();
085:
086: IAction getNext();
087:
088: void setNext(IAction next);
089:
090: IAction getPrevious();
091:
092: void setPrevious(IAction previous);
093:
094: String getTypeFromRoot();
095:
096: String getType();
097:
098: void setType(String type);
099:
100: /**
101: * Extract field type information from object sitting on the stack. <br/>If
102: * rootAction is a generated container action used for construction of
103: * fields or constructor call of the underlying object then skip the
104: * container action and retrieve requested type from underlying object.
105: *
106: * @param fieldName to extract type from
107: * @return full type of field
108: */
109: String extractFieldType(String fieldName);
110:
111: String getHint();
112:
113: /**
114: * Insert a new Record entry after this.
115: *
116: * @param action to insert
117: */
118: void insert(IAction action);
119:
120: void promoteLinkChangeListener(IAction action);
121:
122: void registerLinkChangeListener(ILinkChangeListener listener);
123:
124: void removeLinkChangeListener(ILinkChangeListener listener);
125:
126: void registerReferenceListener(IReferenceListener listener);
127:
128: void removeReferenceListener(IReferenceListener listener);
129:
130: /**
131: * Retrieve attribute from Action object.
132: *
133: * @param key
134: * @return value of key
135: */
136: String getAttribute(String key);
137:
138: }
|