001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.uml.core.generativeframework;
043:
044: import org.dom4j.Node;
045:
046: import org.netbeans.modules.uml.core.metamodel.core.foundation.IElement;
047: import org.netbeans.modules.uml.core.support.umlutils.ETList;
048:
049: public interface IExpansionVariable {
050: /**
051: * Name of the expansion variable. This is what is used inline in template files.
052: */
053: public String getName();
054:
055: /**
056: * Name of the expansion variable. This is what is used inline in template files.
057: */
058: public void setName(String value);
059:
060: /**
061: * Retrieves the operator currently set on this variable.
062: * @return The operator (enumerated integer EOK).
063: */
064: public int getOperator();
065:
066: /**
067: * Sets the operator for this variable.
068: * @param operator The operator (enumerated integer EOK).
069: */
070: public void setOperator(int operator);
071:
072: /**
073: * A query that results in an xmi id after expansion.
074: */
075: public String getIDLookup();
076:
077: /**
078: * A query that results in an xmi id after expansion.
079: */
080: public void setIDLookup(String value);
081:
082: /**
083: * The name of an existing expansion variable that will be used after the initial query of this var is done.
084: */
085: public String getExpansionName();
086:
087: /**
088: * The name of an existing expansion variable that will be used after the initial query of this var is done.
089: */
090: public void setExpansionName(String value);
091:
092: /**
093: * A query generally resulting in various elements that can then be applied to other expansion variables.
094: */
095: public String getQuery();
096:
097: /**
098: * A query generally resulting in various elements that can then be applied to other expansion variables.
099: */
100: public void setQuery(String value);
101:
102: /**
103: * Name of the get property to be invoked on the result node of this expansion.
104: */
105: public String getMethodGet();
106:
107: /**
108: * Name of the get property to be invoked on the result node of this expansion.
109: */
110: public void setMethodGet(String value);
111:
112: /**
113: * Determines whether or not the result of this variable expansion is an xml attribute.
114: */
115: public boolean getIsAttributeResult();
116:
117: /**
118: * The context object passed through all expansions
119: */
120: public IVariableExpander getExecutionContext();
121:
122: /**
123: * The context object passed through all expansions
124: */
125: public void setExecutionContext(IVariableExpander value);
126:
127: /**
128: * The file location of an XSL transform to apply to the expanded results of this variable.
129: */
130: public String getXSLFilter();
131:
132: /**
133: * The file location of an XSL transform to apply to the expanded results of this variable.
134: */
135: public void setXSLFilter(String value);
136:
137: /**
138: * The actual variable used during post expansion.
139: */
140: public IExpansionVariable getExpansionVariable();
141:
142: /**
143: * The actual variable used during post expansion.
144: */
145: public void setExpansionVariable(IExpansionVariable value);
146:
147: /**
148: * The actual xml representation of this variable.
149: */
150: public Node getNode();
151:
152: /**
153: * The actual xml representation of this variable.
154: */
155: public void setNode(Node value);
156:
157: /**
158: * Expands this variable, using context to query against.
159: */
160: public String expand(Node context);
161:
162: /**
163: * Expands this variable, using context to query against.
164: */
165: public String expand(IElement context);
166:
167: /**
168: * The collection of nodes that were retrieved during the expansion process.
169: */
170: public ETList<Node> getResultNodes();
171:
172: /**
173: * The collection of nodes that were retrieved during the expansion process.
174: */
175: public void setResultNodes(ETList<Node> value);
176:
177: /**
178: * The kind of variable this is.
179: */
180: public int getKind();
181:
182: /**
183: * The kind of variable this is.
184: */
185: public void setKind( /* VariableKind */int value);
186:
187: /**
188: * Use in conjunction with the IDLookup property. Filters the result on nodes that have a node name of the value found in the 'type' attribute.
189: */
190: public String getTypeFilter();
191:
192: /**
193: * Use in conjunction with the IDLookup property. Filters the result on nodes that have a node name of the value found in the 'type' attribute.
194: */
195: public void setTypeFilter(String value);
196:
197: /**
198: * The text result of this variable's expansion process.
199: */
200: public String getResults();
201:
202: /**
203: * The text result of this variable's expansion process.
204: */
205: public void setResults(String value);
206:
207: /**
208: * A string in this format: <actual value>=<translated value>, ... Used for easy translation from meta values to user-defined values.
209: */
210: public String getValueFilter();
211:
212: /**
213: * A string in this format: <actual value>=<translated value>, ... Used for easy translation from meta values to user-defined values.
214: */
215: public void setValueFilter(String value);
216:
217: /**
218: * A string in this format: <string to replace>=<replace string>. Used to post-process an expansion result.
219: */
220: public String getReplaceFilter();
221:
222: /**
223: * A string in this format: <string to replace>=<replace string>. Used to post-process an expansion result.
224: */
225: public void setReplaceFilter(String value);
226:
227: /**
228: * Name of the expansion variable this expansion variable is overriding. Useful when reusing existing variables.
229: */
230: public String getOverrideName();
231:
232: /**
233: * Name of the expansion variable this expansion variable is overriding. Useful when reusing existing variables.
234: */
235: public void setOverrideName(String value);
236:
237: /**
238: * The value that will result in a 'true' value in the expansion. Used when the Kind property is of type VK_BOOLEAN.
239: */
240: public String getTrueValue();
241:
242: /**
243: * The value that will result in a 'true' value in the expansion. Used when the Kind property is of type VK_BOOLEAN.
244: */
245: public void setTrueValue(String value);
246:
247: /**
248: * Indicates whether or not this boolean expansion variable expanded into a true result or not.
249: */
250: public boolean getIsTrue();
251:
252: /**
253: * Indicates whether or not this boolean expansion variable expanded into a true result or not.
254: */
255: public void setIsTrue(boolean value);
256: }
|