You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2008/01/08 17:38:51 UTC
svn commit: r610062 [10/12] - in
/incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor: ./
src/main/java/org/apache/uima/aae/deployment/
src/main/java/org/apache/uima/aae/deployment/impl/
src/main/java/org/apache/uima/application/metadata...
Modified: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/ConfigParameterModel.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/ConfigParameterModel.java?rev=610062&r1=610061&r2=610062&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/ConfigParameterModel.java (original)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/ConfigParameterModel.java Tue Jan 8 08:38:45 2008
@@ -1,653 +1,653 @@
-/**
- *
- * Project UIMA Tooling
- *
- *
- * creation date: Jan 12, 2006, 1:58:21 PM
- * source: ConfigParameterModel.java
- */
-package org.apache.uima.cpe.model;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.List;
-
-import org.apache.uima.resource.metadata.ConfigurationParameter;
-import org.apache.uima.resource.metadata.impl.XmlizationInfo;
-import org.apache.uima.tools.debug.util.Trace;
-import org.apache.uima.util.InvalidXMLException;
-import org.apache.uima.util.XMLParser;
-import org.apache.uima.util.XMLParser.ParsingOptions;
-import org.w3c.dom.Element;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.AttributesImpl;
-
-
-/**
- * Encapsulate the following 3 UIMA classes into one class:
- * Config Parameter Declaration
- * Config Parameter Settings (value)
- * - for Cas Processor
- * - for CPE
- *
- */
-public class ConfigParameterModel {
-
- /**
- * MultiValues[] is used to represent the multi-values of the Configuration Parameter.
- * MultiValues[i] is the value of the i-th index of multivalues.
- * Example:
- * <nameValuePair>
- * <name>Locations</name>
- * <value>
- * <array> multiValues[]
- * <string>a</string> multiValues[0]= {Locations, "a", 0}
- * <string>b</string> multiValues[1]= {Locations, "b", 0}
- * <string>c</string> multiValues[2]= {Locations, "b", 0}
- * <array>
- * </value>
- * </nameValuePair>
- *
- */
- public static class MultiValues {
- public ConfigParameterModel parameterModel;
-
- // The "values" cannot be used since this MultiValues can be DYNAMICALLY created !
- public Object[] values;
- public int index; // index within values[] (0, 1, ...)
-// private boolean forCpe = false;
-
-
- public MultiValues(ConfigParameterModel paramModel, boolean forCpe, int index)
- {
- super();
- this.parameterModel = paramModel;
-// this.forCpe = forCpe;
- this.index = index;
- }
- public MultiValues(ConfigParameterModel paramModel, Object[] values, int index)
- {
- super();
- this.parameterModel = paramModel;
- this.values = values;
- this.index = index;
- }
-
- public String getType() {
- return parameterModel.getType();
- }
- public String getName() {
- return parameterModel.getName();
- }
-
- public Object getDefValue() {
- return values[index];
- }
-
- public void setDefValue(Object value) {
- values[index] = value;
- }
- public Object getCpeValue() {
- Object[] cpeValues = (Object[]) parameterModel.getCpeValue();
- if (cpeValues == null) {
- return null;
- }
- return cpeValues[index];
- }
-
- public void setCpeValue(Object value) {
- Object[] cpeValues = (Object[]) parameterModel.getCpeValue();
- // Trace.trace("setValue: index=" + index + " ; value:" + value.toString());
- cpeValues[index] = value;
- }
-
- /**
- * @return Returns the index.
- */
- public int getIndex() {
- return index;
- }
-
- /**
- * Get the total number of multi-values
- *
- * @return int
- */
- public int getMultiValuesSize () {
- Object[] cpeValues = (Object[]) parameterModel.getCpeValue();
- if (cpeValues == null) {
- Trace.err(getName() + ": getMultiValuesSize = 0");
- return 0;
- }
- return cpeValues.length;
- }
-
- /**
- * @return Returns the parameterModel.
- */
- public ConfigParameterModel getParameterModel() {
- return parameterModel;
- }
-
- /**
- * @param parameterModel The parameterModel to set.
- */
- public void setParameterModel(ConfigParameterModel parameterModel) {
- this.parameterModel = parameterModel;
- }
- /**
- * Use to moved value up/down
- * @param index the index to set
- */
- public void setIndex(int index) {
- this.index = index;
- }
- } // MultiValues
-
- private ConfigurationParameter configParam;
- private Object value; // for Cas Processor
- private Object cpeValue = null; // for CPE
-
- public ConfigParameterModel(ConfigurationParameter configParam) {
- super();
- this.configParam = configParam;
- }
-
- public void toXML(ContentHandler aContentHandler,
- boolean aWriteDefaultNamespaceAttribute)
- throws SAXException
- {
- if (getCpeValue() == null) {
- Trace.trace("No value");
- return;
- }
- AttributesImpl attrs = new AttributesImpl();
- // <nameValuePair>
- aContentHandler.startElement(getXmlizationInfo().namespace,
- "","nameValuePair",attrs);
-
- // <name> </name>
- aContentHandler.startElement(getXmlizationInfo().namespace,
- "","name",attrs);
- String valStr = getName();
- aContentHandler.characters(valStr.toCharArray(),0,valStr.length());
- aContentHandler.endElement(getXmlizationInfo().namespace,
- "","name");
-
- // <value>
- aContentHandler.startElement(getXmlizationInfo().namespace, "","value",attrs);
-
- String lowerCaseType = getType().toLowerCase();
- if (isMultiValued()) {
- aContentHandler.startElement(getXmlizationInfo().namespace, "","array",attrs);
- Object[] v = (Object[]) getCpeValue();
- for (int i=0; i<v.length; ++i) {
- aContentHandler.startElement(getXmlizationInfo().namespace, "", lowerCaseType, attrs);
- valStr ="" + v[i];
- aContentHandler.characters(valStr.toCharArray(),0,valStr.length());
- aContentHandler.endElement(getXmlizationInfo().namespace, "", lowerCaseType);
- }
- } else {
- aContentHandler.startElement(getXmlizationInfo().namespace, "", lowerCaseType, attrs);
- valStr = "" + getCpeValue();
- aContentHandler.characters(valStr.toCharArray(),0,valStr.length());
- aContentHandler.endElement(getXmlizationInfo().namespace, "", lowerCaseType);
- }
-
- if (isMultiValued()) {
- aContentHandler.endElement(getXmlizationInfo().namespace, "","array");
- }
-
- // </value>
- aContentHandler.endElement(getXmlizationInfo().namespace, "","value");
- // </nameValuePair>
- aContentHandler.endElement(getXmlizationInfo().namespace,
- "","nameValuePair");
- }
-
- protected XmlizationInfo getXmlizationInfo() {
- // return XMLIZATION_INFO;
- return new XmlizationInfo(null, null);
- //this object has custom XMLization routines
- }
-
- /**
- * @return Returns the value.
- */
- public Object getValue() {
- return value;
- }
-
- /**
- * @param value The value to set.
- */
- public void setValue(Object value) {
- this.value = value;
- }
-
- public void cloneValue ()
- {
- // cpeValue = value.clone();
- }
-
- /**
- * Get total number of multi-values
- *
- * @return int
- */
- public int getMultivalueSize ()
- {
- if (value == null) return 0;
- if (!isMultiValued()) return 1;
- return ((Object[]) value).length;
- }
-
- /**
- * Get total number of CPE values
- *
- * @return int
- */
- public int getCpeValueSize ()
- {
- if (cpeValue == null) return 0;
- if (!isMultiValued()) return 1;
- return ((Object[]) cpeValue).length;
- }
-
- /**
- * @return Returns the cpeValue.
- */
- public Object getCpeValue() {
- if (cpeValue != null && getCpeValueSize() > 0) {
- return cpeValue;
- }
- return null;
- }
-
- /**
- * @param cpeValue The cpeValue to set.
- */
- public void setCpeValue(Object cpeValue) {
- this.cpeValue = cpeValue;
- }
-
- public void setCpeValue (String aValueString)
- {
- if (!isMultiValued()) {
- // Single value
- setCpeValue(getValueObjectFromString(aValueString));
- } else {
- addValueToCpeMultivalue(aValueString);
- }
- }
-
- public Object getValueObjectFromString (String aValueString)
- {
- if (aValueString == null || aValueString.trim().length() == 0) {
- return null;
- }
- Object aValue = null;
- String paramType = getType();
-
- try {
- if (ConfigurationParameter.TYPE_STRING.equals(paramType)) {
- aValue = aValueString;
-
- } else if (ConfigurationParameter.TYPE_INTEGER.equals(paramType)) {
- aValue = Integer.valueOf(aValueString);
-
- } else if (ConfigurationParameter.TYPE_FLOAT.equals(paramType)) {
- aValue = Float.valueOf(aValueString);
-
- } else if (ConfigurationParameter.TYPE_BOOLEAN.equals(paramType)) {
- aValue = Boolean.valueOf(aValueString);
- } else {
- Trace.bug("Wrong param type: " + paramType);
- }
- } catch (NumberFormatException e) {
- Trace.err(e.toString());
- }
- return aValue;
- }
-
- private Object _insertValueToMultivalue (Object[] v, Object aValue, int atIndex)
- {
- Object[] newValues;
- if (v != null) {
- // Copy OLD values
- newValues = new Object[v.length+1];
- for (int i=0; i<atIndex; ++i) {
- newValues[i] = v[i];
- }
- newValues[atIndex] = aValue;
- for (int i=atIndex; i<v.length; ++i) {
- newValues[i+1] = v[i];
- }
- } else {
- newValues = new Object[1];
- newValues[0] = aValue;
- }
-
- return newValues;
- }
-
- public void addValueToMultivalue (String aValueString, int atIndex)
- {
- if (!isMultiValued()) return;
- value =_insertValueToMultivalue ((Object[]) value,
- getValueObjectFromString(aValueString), atIndex);
- }
-
- public void addValueToCpeMultivalue (String aValueString, int atIndex)
- {
- if (!isMultiValued()) return;
- cpeValue =_insertValueToMultivalue ((Object[]) cpeValue,
- getValueObjectFromString(aValueString), atIndex);
- }
-
- /**
- * Add a value to multi-value parameter override (for AE)
- *
- * @param value
- * @return void
- */
- public void addValueToMultivalue (String aValueString)
- {
- if (!isMultiValued()) return;
-
- Object aValue = getValueObjectFromString(aValueString);
- Object[] newValues;
- Object[] v = (Object[]) getValue();
- if (v != null) {
- // Copy OLD values
- newValues = new Object[v.length+1];
- for (int i=0; i<v.length; ++i) {
- newValues[i] = v[i];
- }
- newValues[v.length] = aValue;
- } else {
- newValues = new Object[1];
- newValues[0] = aValue;
- }
- setValue(newValues);
- }
-
- /**
- * Add a value to multi-value parameter override (for CPE)
- *
- * @param value
- * @return void
- */
- public void addValueToCpeMultivalue (String aValueString)
- {
- if (!isMultiValued()) return;
-
- Object aValue = getValueObjectFromString(aValueString);
- Object[] newValues;
- Object[] v = (Object[]) cpeValue;
- if (v != null) {
- // Copy OLD values
- newValues = new Object[v.length+1];
- for (int i=0; i<v.length; ++i) {
- newValues[i] = v[i];
- }
- newValues[v.length] = aValue;
- } else {
- newValues = new Object[1];
- newValues[0] = aValue;
- }
- setCpeValue(newValues);
- }
-
- private Object _removeMultivalue (Object[] v, MultiValues mv)
- {
- if (v.length == 1) {
- // Has only 1 element to be removed
- return null;
- }
-
- int index = mv.getIndex();
- Object[] newValues = new Object[v.length-1];
- for (int i=0; i<index; ++i) {
- newValues[i] = v[i];
- }
- for (int i=index; i<(v.length-1); ++i) {
- newValues[i] = v[i+1];
- }
- return newValues;
- }
-
- public void removeMultivalue (MultiValues mv)
- {
- if (!isMultiValued()) return;
- value = _removeMultivalue ((Object[]) value, mv);
- }
-
- public void removeCpeMultivalue (MultiValues mv)
- {
- if (!isMultiValued()) return;
- cpeValue = _removeMultivalue ((Object[]) cpeValue, mv);
- }
-
- private boolean moveMultivalue (boolean moveUp, Object[] v, int index)
- {
- if (!isMultiValued()) return false;
-
- Object aValue;
- if (v != null && index < v.length) {
- if (moveUp) {
- // Move Up
- if (index > 0) {
- aValue = v[index];
- v[index] = v[index-1];
- v[index-1] = aValue;
- return true; // is moved
- }
- } else {
- // Move Down
- if (index < (v.length-1)) {
- aValue = v[index];
- v[index] = v[index+1];
- v[index+1] = aValue;
- return true; // is moved
- }
- }
- }
- return false; // NOT moved
- } // moveMultivalue
-
- public boolean moveValue (boolean moveUp, int index)
- {
- return moveMultivalue (moveUp, (Object[]) value, index);
- } // moveValue
-
- public boolean moveCpeValue (boolean moveUp, int index)
- {
- return moveMultivalue (moveUp, (Object[]) cpeValue, index);
- } // moveCpeValue
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.ConfigurationParameter#addOverride(java.lang.String)
- */
- public void addOverride(String arg0) {
- configParam.addOverride(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.util.XMLizable#buildFromXMLElement(org.w3c.dom.Element, org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
- */
- public void buildFromXMLElement(Element arg0, XMLParser arg1, ParsingOptions arg2) throws InvalidXMLException {
- configParam.buildFromXMLElement(arg0, arg1, arg2);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.util.XMLizable#buildFromXMLElement(org.w3c.dom.Element, org.apache.uima.util.XMLParser)
- */
- public void buildFromXMLElement(Element arg0, XMLParser arg1) throws InvalidXMLException {
- configParam.buildFromXMLElement(arg0, arg1);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.MetaDataObject#clone()
- */
- public Object clone() {
- return configParam.clone();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.MetaDataObject#equals(java.lang.Object)
- */
- public boolean equals(Object arg0) {
- return configParam.equals(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.MetaDataObject#getAttributeValue(java.lang.String)
- */
- public Object getAttributeValue(String arg0) {
- return configParam.getAttributeValue(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.ConfigurationParameter#getDescription()
- */
- public String getDescription() {
- return configParam.getDescription();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.ConfigurationParameter#getName()
- */
- public String getName() {
- return configParam.getName();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.ConfigurationParameter#getOverrides()
- */
- public String[] getOverrides() {
- return configParam.getOverrides();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.ConfigurationParameter#getType()
- */
- public String getType() {
- return configParam.getType();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.ConfigurationParameter#isMandatory()
- */
- public boolean isMandatory() {
- return configParam.isMandatory();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.MetaDataObject#isModifiable()
- */
- public boolean isModifiable() {
- return configParam.isModifiable();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.ConfigurationParameter#isMultiValued()
- */
- public boolean isMultiValued() {
- return configParam.isMultiValued();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.MetaDataObject#listAttributes()
- */
- public List listAttributes() {
- return configParam.listAttributes();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.ConfigurationParameter#removeOverride(java.lang.String)
- */
- public void removeOverride(String arg0) {
- configParam.removeOverride(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.MetaDataObject#setAttributeValue(java.lang.String, java.lang.Object)
- */
- public void setAttributeValue(String arg0, Object arg1) {
- configParam.setAttributeValue(arg0, arg1);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.ConfigurationParameter#setDescription(java.lang.String)
- */
- public void setDescription(String arg0) {
- configParam.setDescription(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.ConfigurationParameter#setMandatory(boolean)
- */
- public void setMandatory(boolean arg0) {
- configParam.setMandatory(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.ConfigurationParameter#setMultiValued(boolean)
- */
- public void setMultiValued(boolean arg0) {
- configParam.setMultiValued(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.ConfigurationParameter#setName(java.lang.String)
- */
- public void setName(String arg0) {
- configParam.setName(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.ConfigurationParameter#setOverrides(java.lang.String[])
- */
- public void setOverrides(String[] arg0) {
- configParam.setOverrides(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.ConfigurationParameter#setType(java.lang.String)
- */
- public void setType(String arg0) {
- configParam.setType(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.util.XMLizable#toXML(org.xml.sax.ContentHandler, boolean)
- */
-// public void toXML(ContentHandler arg0, boolean arg1) throws SAXException {
-// configParam.toXML(arg0, arg1);
-// }
-
- /* (non-Javadoc)
- * @see org.apache.uima.util.XMLizable#toXML(org.xml.sax.ContentHandler)
- */
- public void toXML(ContentHandler arg0) throws SAXException {
- configParam.toXML(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.util.XMLizable#toXML(java.io.OutputStream)
- */
- public void toXML(OutputStream arg0) throws SAXException, IOException {
- configParam.toXML(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.util.XMLizable#toXML(java.io.Writer)
- */
- public void toXML(Writer arg0) throws SAXException, IOException {
- configParam.toXML(arg0);
- }
-
-}
+/**
+ *
+ * Project UIMA Tooling
+ *
+ *
+ * creation date: Jan 12, 2006, 1:58:21 PM
+ * source: ConfigParameterModel.java
+ */
+package org.apache.uima.cpe.model;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Writer;
+import java.util.List;
+
+import org.apache.uima.resource.metadata.ConfigurationParameter;
+import org.apache.uima.resource.metadata.impl.XmlizationInfo;
+import org.apache.uima.tools.debug.util.Trace;
+import org.apache.uima.util.InvalidXMLException;
+import org.apache.uima.util.XMLParser;
+import org.apache.uima.util.XMLParser.ParsingOptions;
+import org.w3c.dom.Element;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+
+/**
+ * Encapsulate the following 3 UIMA classes into one class:
+ * Config Parameter Declaration
+ * Config Parameter Settings (value)
+ * - for Cas Processor
+ * - for CPE
+ *
+ */
+public class ConfigParameterModel {
+
+ /**
+ * MultiValues[] is used to represent the multi-values of the Configuration Parameter.
+ * MultiValues[i] is the value of the i-th index of multivalues.
+ * Example:
+ * <nameValuePair>
+ * <name>Locations</name>
+ * <value>
+ * <array> multiValues[]
+ * <string>a</string> multiValues[0]= {Locations, "a", 0}
+ * <string>b</string> multiValues[1]= {Locations, "b", 0}
+ * <string>c</string> multiValues[2]= {Locations, "b", 0}
+ * <array>
+ * </value>
+ * </nameValuePair>
+ *
+ */
+ public static class MultiValues {
+ public ConfigParameterModel parameterModel;
+
+ // The "values" cannot be used since this MultiValues can be DYNAMICALLY created !
+ public Object[] values;
+ public int index; // index within values[] (0, 1, ...)
+// private boolean forCpe = false;
+
+
+ public MultiValues(ConfigParameterModel paramModel, boolean forCpe, int index)
+ {
+ super();
+ this.parameterModel = paramModel;
+// this.forCpe = forCpe;
+ this.index = index;
+ }
+ public MultiValues(ConfigParameterModel paramModel, Object[] values, int index)
+ {
+ super();
+ this.parameterModel = paramModel;
+ this.values = values;
+ this.index = index;
+ }
+
+ public String getType() {
+ return parameterModel.getType();
+ }
+ public String getName() {
+ return parameterModel.getName();
+ }
+
+ public Object getDefValue() {
+ return values[index];
+ }
+
+ public void setDefValue(Object value) {
+ values[index] = value;
+ }
+ public Object getCpeValue() {
+ Object[] cpeValues = (Object[]) parameterModel.getCpeValue();
+ if (cpeValues == null) {
+ return null;
+ }
+ return cpeValues[index];
+ }
+
+ public void setCpeValue(Object value) {
+ Object[] cpeValues = (Object[]) parameterModel.getCpeValue();
+ // Trace.trace("setValue: index=" + index + " ; value:" + value.toString());
+ cpeValues[index] = value;
+ }
+
+ /**
+ * @return Returns the index.
+ */
+ public int getIndex() {
+ return index;
+ }
+
+ /**
+ * Get the total number of multi-values
+ *
+ * @return int
+ */
+ public int getMultiValuesSize () {
+ Object[] cpeValues = (Object[]) parameterModel.getCpeValue();
+ if (cpeValues == null) {
+ Trace.err(getName() + ": getMultiValuesSize = 0");
+ return 0;
+ }
+ return cpeValues.length;
+ }
+
+ /**
+ * @return Returns the parameterModel.
+ */
+ public ConfigParameterModel getParameterModel() {
+ return parameterModel;
+ }
+
+ /**
+ * @param parameterModel The parameterModel to set.
+ */
+ public void setParameterModel(ConfigParameterModel parameterModel) {
+ this.parameterModel = parameterModel;
+ }
+ /**
+ * Use to moved value up/down
+ * @param index the index to set
+ */
+ public void setIndex(int index) {
+ this.index = index;
+ }
+ } // MultiValues
+
+ private ConfigurationParameter configParam;
+ private Object value; // for Cas Processor
+ private Object cpeValue = null; // for CPE
+
+ public ConfigParameterModel(ConfigurationParameter configParam) {
+ super();
+ this.configParam = configParam;
+ }
+
+ public void toXML(ContentHandler aContentHandler,
+ boolean aWriteDefaultNamespaceAttribute)
+ throws SAXException
+ {
+ if (getCpeValue() == null) {
+ Trace.trace("No value");
+ return;
+ }
+ AttributesImpl attrs = new AttributesImpl();
+ // <nameValuePair>
+ aContentHandler.startElement(getXmlizationInfo().namespace,
+ "","nameValuePair",attrs);
+
+ // <name> </name>
+ aContentHandler.startElement(getXmlizationInfo().namespace,
+ "","name",attrs);
+ String valStr = getName();
+ aContentHandler.characters(valStr.toCharArray(),0,valStr.length());
+ aContentHandler.endElement(getXmlizationInfo().namespace,
+ "","name");
+
+ // <value>
+ aContentHandler.startElement(getXmlizationInfo().namespace, "","value",attrs);
+
+ String lowerCaseType = getType().toLowerCase();
+ if (isMultiValued()) {
+ aContentHandler.startElement(getXmlizationInfo().namespace, "","array",attrs);
+ Object[] v = (Object[]) getCpeValue();
+ for (int i=0; i<v.length; ++i) {
+ aContentHandler.startElement(getXmlizationInfo().namespace, "", lowerCaseType, attrs);
+ valStr ="" + v[i];
+ aContentHandler.characters(valStr.toCharArray(),0,valStr.length());
+ aContentHandler.endElement(getXmlizationInfo().namespace, "", lowerCaseType);
+ }
+ } else {
+ aContentHandler.startElement(getXmlizationInfo().namespace, "", lowerCaseType, attrs);
+ valStr = "" + getCpeValue();
+ aContentHandler.characters(valStr.toCharArray(),0,valStr.length());
+ aContentHandler.endElement(getXmlizationInfo().namespace, "", lowerCaseType);
+ }
+
+ if (isMultiValued()) {
+ aContentHandler.endElement(getXmlizationInfo().namespace, "","array");
+ }
+
+ // </value>
+ aContentHandler.endElement(getXmlizationInfo().namespace, "","value");
+ // </nameValuePair>
+ aContentHandler.endElement(getXmlizationInfo().namespace,
+ "","nameValuePair");
+ }
+
+ protected XmlizationInfo getXmlizationInfo() {
+ // return XMLIZATION_INFO;
+ return new XmlizationInfo(null, null);
+ //this object has custom XMLization routines
+ }
+
+ /**
+ * @return Returns the value.
+ */
+ public Object getValue() {
+ return value;
+ }
+
+ /**
+ * @param value The value to set.
+ */
+ public void setValue(Object value) {
+ this.value = value;
+ }
+
+ public void cloneValue ()
+ {
+ // cpeValue = value.clone();
+ }
+
+ /**
+ * Get total number of multi-values
+ *
+ * @return int
+ */
+ public int getMultivalueSize ()
+ {
+ if (value == null) return 0;
+ if (!isMultiValued()) return 1;
+ return ((Object[]) value).length;
+ }
+
+ /**
+ * Get total number of CPE values
+ *
+ * @return int
+ */
+ public int getCpeValueSize ()
+ {
+ if (cpeValue == null) return 0;
+ if (!isMultiValued()) return 1;
+ return ((Object[]) cpeValue).length;
+ }
+
+ /**
+ * @return Returns the cpeValue.
+ */
+ public Object getCpeValue() {
+ if (cpeValue != null && getCpeValueSize() > 0) {
+ return cpeValue;
+ }
+ return null;
+ }
+
+ /**
+ * @param cpeValue The cpeValue to set.
+ */
+ public void setCpeValue(Object cpeValue) {
+ this.cpeValue = cpeValue;
+ }
+
+ public void setCpeValue (String aValueString)
+ {
+ if (!isMultiValued()) {
+ // Single value
+ setCpeValue(getValueObjectFromString(aValueString));
+ } else {
+ addValueToCpeMultivalue(aValueString);
+ }
+ }
+
+ public Object getValueObjectFromString (String aValueString)
+ {
+ if (aValueString == null || aValueString.trim().length() == 0) {
+ return null;
+ }
+ Object aValue = null;
+ String paramType = getType();
+
+ try {
+ if (ConfigurationParameter.TYPE_STRING.equals(paramType)) {
+ aValue = aValueString;
+
+ } else if (ConfigurationParameter.TYPE_INTEGER.equals(paramType)) {
+ aValue = Integer.valueOf(aValueString);
+
+ } else if (ConfigurationParameter.TYPE_FLOAT.equals(paramType)) {
+ aValue = Float.valueOf(aValueString);
+
+ } else if (ConfigurationParameter.TYPE_BOOLEAN.equals(paramType)) {
+ aValue = Boolean.valueOf(aValueString);
+ } else {
+ Trace.bug("Wrong param type: " + paramType);
+ }
+ } catch (NumberFormatException e) {
+ Trace.err(e.toString());
+ }
+ return aValue;
+ }
+
+ private Object _insertValueToMultivalue (Object[] v, Object aValue, int atIndex)
+ {
+ Object[] newValues;
+ if (v != null) {
+ // Copy OLD values
+ newValues = new Object[v.length+1];
+ for (int i=0; i<atIndex; ++i) {
+ newValues[i] = v[i];
+ }
+ newValues[atIndex] = aValue;
+ for (int i=atIndex; i<v.length; ++i) {
+ newValues[i+1] = v[i];
+ }
+ } else {
+ newValues = new Object[1];
+ newValues[0] = aValue;
+ }
+
+ return newValues;
+ }
+
+ public void addValueToMultivalue (String aValueString, int atIndex)
+ {
+ if (!isMultiValued()) return;
+ value =_insertValueToMultivalue ((Object[]) value,
+ getValueObjectFromString(aValueString), atIndex);
+ }
+
+ public void addValueToCpeMultivalue (String aValueString, int atIndex)
+ {
+ if (!isMultiValued()) return;
+ cpeValue =_insertValueToMultivalue ((Object[]) cpeValue,
+ getValueObjectFromString(aValueString), atIndex);
+ }
+
+ /**
+ * Add a value to multi-value parameter override (for AE)
+ *
+ * @param value
+ * @return void
+ */
+ public void addValueToMultivalue (String aValueString)
+ {
+ if (!isMultiValued()) return;
+
+ Object aValue = getValueObjectFromString(aValueString);
+ Object[] newValues;
+ Object[] v = (Object[]) getValue();
+ if (v != null) {
+ // Copy OLD values
+ newValues = new Object[v.length+1];
+ for (int i=0; i<v.length; ++i) {
+ newValues[i] = v[i];
+ }
+ newValues[v.length] = aValue;
+ } else {
+ newValues = new Object[1];
+ newValues[0] = aValue;
+ }
+ setValue(newValues);
+ }
+
+ /**
+ * Add a value to multi-value parameter override (for CPE)
+ *
+ * @param value
+ * @return void
+ */
+ public void addValueToCpeMultivalue (String aValueString)
+ {
+ if (!isMultiValued()) return;
+
+ Object aValue = getValueObjectFromString(aValueString);
+ Object[] newValues;
+ Object[] v = (Object[]) cpeValue;
+ if (v != null) {
+ // Copy OLD values
+ newValues = new Object[v.length+1];
+ for (int i=0; i<v.length; ++i) {
+ newValues[i] = v[i];
+ }
+ newValues[v.length] = aValue;
+ } else {
+ newValues = new Object[1];
+ newValues[0] = aValue;
+ }
+ setCpeValue(newValues);
+ }
+
+ private Object _removeMultivalue (Object[] v, MultiValues mv)
+ {
+ if (v.length == 1) {
+ // Has only 1 element to be removed
+ return null;
+ }
+
+ int index = mv.getIndex();
+ Object[] newValues = new Object[v.length-1];
+ for (int i=0; i<index; ++i) {
+ newValues[i] = v[i];
+ }
+ for (int i=index; i<(v.length-1); ++i) {
+ newValues[i] = v[i+1];
+ }
+ return newValues;
+ }
+
+ public void removeMultivalue (MultiValues mv)
+ {
+ if (!isMultiValued()) return;
+ value = _removeMultivalue ((Object[]) value, mv);
+ }
+
+ public void removeCpeMultivalue (MultiValues mv)
+ {
+ if (!isMultiValued()) return;
+ cpeValue = _removeMultivalue ((Object[]) cpeValue, mv);
+ }
+
+ private boolean moveMultivalue (boolean moveUp, Object[] v, int index)
+ {
+ if (!isMultiValued()) return false;
+
+ Object aValue;
+ if (v != null && index < v.length) {
+ if (moveUp) {
+ // Move Up
+ if (index > 0) {
+ aValue = v[index];
+ v[index] = v[index-1];
+ v[index-1] = aValue;
+ return true; // is moved
+ }
+ } else {
+ // Move Down
+ if (index < (v.length-1)) {
+ aValue = v[index];
+ v[index] = v[index+1];
+ v[index+1] = aValue;
+ return true; // is moved
+ }
+ }
+ }
+ return false; // NOT moved
+ } // moveMultivalue
+
+ public boolean moveValue (boolean moveUp, int index)
+ {
+ return moveMultivalue (moveUp, (Object[]) value, index);
+ } // moveValue
+
+ public boolean moveCpeValue (boolean moveUp, int index)
+ {
+ return moveMultivalue (moveUp, (Object[]) cpeValue, index);
+ } // moveCpeValue
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.ConfigurationParameter#addOverride(java.lang.String)
+ */
+ public void addOverride(String arg0) {
+ configParam.addOverride(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.util.XMLizable#buildFromXMLElement(org.w3c.dom.Element, org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
+ */
+ public void buildFromXMLElement(Element arg0, XMLParser arg1, ParsingOptions arg2) throws InvalidXMLException {
+ configParam.buildFromXMLElement(arg0, arg1, arg2);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.util.XMLizable#buildFromXMLElement(org.w3c.dom.Element, org.apache.uima.util.XMLParser)
+ */
+ public void buildFromXMLElement(Element arg0, XMLParser arg1) throws InvalidXMLException {
+ configParam.buildFromXMLElement(arg0, arg1);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.MetaDataObject#clone()
+ */
+ public Object clone() {
+ return configParam.clone();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.MetaDataObject#equals(java.lang.Object)
+ */
+ public boolean equals(Object arg0) {
+ return configParam.equals(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.MetaDataObject#getAttributeValue(java.lang.String)
+ */
+ public Object getAttributeValue(String arg0) {
+ return configParam.getAttributeValue(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.ConfigurationParameter#getDescription()
+ */
+ public String getDescription() {
+ return configParam.getDescription();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.ConfigurationParameter#getName()
+ */
+ public String getName() {
+ return configParam.getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.ConfigurationParameter#getOverrides()
+ */
+ public String[] getOverrides() {
+ return configParam.getOverrides();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.ConfigurationParameter#getType()
+ */
+ public String getType() {
+ return configParam.getType();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.ConfigurationParameter#isMandatory()
+ */
+ public boolean isMandatory() {
+ return configParam.isMandatory();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.MetaDataObject#isModifiable()
+ */
+ public boolean isModifiable() {
+ return configParam.isModifiable();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.ConfigurationParameter#isMultiValued()
+ */
+ public boolean isMultiValued() {
+ return configParam.isMultiValued();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.MetaDataObject#listAttributes()
+ */
+ public List listAttributes() {
+ return configParam.listAttributes();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.ConfigurationParameter#removeOverride(java.lang.String)
+ */
+ public void removeOverride(String arg0) {
+ configParam.removeOverride(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.MetaDataObject#setAttributeValue(java.lang.String, java.lang.Object)
+ */
+ public void setAttributeValue(String arg0, Object arg1) {
+ configParam.setAttributeValue(arg0, arg1);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.ConfigurationParameter#setDescription(java.lang.String)
+ */
+ public void setDescription(String arg0) {
+ configParam.setDescription(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.ConfigurationParameter#setMandatory(boolean)
+ */
+ public void setMandatory(boolean arg0) {
+ configParam.setMandatory(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.ConfigurationParameter#setMultiValued(boolean)
+ */
+ public void setMultiValued(boolean arg0) {
+ configParam.setMultiValued(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.ConfigurationParameter#setName(java.lang.String)
+ */
+ public void setName(String arg0) {
+ configParam.setName(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.ConfigurationParameter#setOverrides(java.lang.String[])
+ */
+ public void setOverrides(String[] arg0) {
+ configParam.setOverrides(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.resource.metadata.ConfigurationParameter#setType(java.lang.String)
+ */
+ public void setType(String arg0) {
+ configParam.setType(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.util.XMLizable#toXML(org.xml.sax.ContentHandler, boolean)
+ */
+// public void toXML(ContentHandler arg0, boolean arg1) throws SAXException {
+// configParam.toXML(arg0, arg1);
+// }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.util.XMLizable#toXML(org.xml.sax.ContentHandler)
+ */
+ public void toXML(ContentHandler arg0) throws SAXException {
+ configParam.toXML(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.util.XMLizable#toXML(java.io.OutputStream)
+ */
+ public void toXML(OutputStream arg0) throws SAXException, IOException {
+ configParam.toXML(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.util.XMLizable#toXML(java.io.Writer)
+ */
+ public void toXML(Writer arg0) throws SAXException, IOException {
+ configParam.toXML(arg0);
+ }
+
+}
Propchange: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/ConfigParameterModel.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/ConfigParametersModel.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/ConfigParametersModel.java?rev=610062&r1=610061&r2=610062&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/ConfigParametersModel.java (original)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/ConfigParametersModel.java Tue Jan 8 08:38:45 2008
@@ -1,222 +1,222 @@
-/**
- *
- * Project UIMA Tooling
- *
- *
- * creation date: Jan 12, 2006, 1:57:56 PM
- * source: ConfigParametersModel.java
- */
-package org.apache.uima.cpe.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.uima.collection.metadata.CasProcessorConfigurationParameterSettings;
-import org.apache.uima.resource.metadata.ConfigurationParameter;
-import org.apache.uima.resource.metadata.ConfigurationParameterDeclarations;
-import org.apache.uima.resource.metadata.ConfigurationParameterSettings;
-import org.apache.uima.resource.metadata.NameValuePair;
-import org.apache.uima.tools.debug.util.Trace;
-
-
-/**
- *
- *
- */
-public class ConfigParametersModel {
-
- // List of ConfigParameterModel
- private List paramModelList = new ArrayList();
-
- // List of ConfigParameterModel Overrides specified in CPE Xml
- private List cpeParamModelList = null; // new ArrayList();
-
- private ConfigurationParameterDeclarations paramDeclarations;
- private ConfigurationParameterSettings paramSettings;
-
- public ConfigParametersModel(ConfigurationParameterDeclarations decls,
- ConfigurationParameterSettings settings)
- {
- this(decls, settings, null);
- }
-
- /**
- * Create config. param model by setting CPE's overrides to the
- * sepecified values or default values from the descriptor
- *
- * @param decls Param definitions from Xml descriptor
- * @param settings Param values from Xml descriptor
- * @param cpeSettings Settings for CPE's overrides. If null, the default values
- * from Xml descriptor (from "settings") will be used
- */
- public ConfigParametersModel(ConfigurationParameterDeclarations decls,
- ConfigurationParameterSettings settings,
- CasProcessorConfigurationParameterSettings cpeSettings)
- {
- super();
- paramDeclarations = decls;
- paramSettings = settings;
- if (paramDeclarations == null) return;
- // printNameValuePairs(paramSettings.getParameterSettings());
-
- // Create Param Model List
- ConfigurationParameter[] params = paramDeclarations.getConfigurationParameters();
- for (int i=0; i<params.length; ++i) {
- ConfigParameterModel paramModel = new ConfigParameterModel(params[i]);
- // Set "default" param values as defined in XML descriptor
- paramModel.setValue(paramSettings.getParameterValue(paramModel.getName()));
-
- // Set param values for CPE
- if (cpeSettings != null) {
- // Trace.trace("Set cpeValue for " + paramModel.getName());
- Object cpeValue = cpeSettings.getParameterValue(paramModel.getName());
- if (cpeValue == null) {
- // Clone Value
- // Trace.trace(" Clone cpeValue");
- cpeValue = paramSettings.getParameterValue(paramModel.getName());
- } else {
-
- }
- paramModel.setCpeValue(cpeValue);
- if (cpeParamModelList == null) {
- cpeParamModelList = new ArrayList();
- }
- cpeParamModelList.add(paramModel);
- } else {
- // Use default value from descriptor
- paramModel.setCpeValue(paramSettings.getParameterValue(paramModel.getName()));
- }
- paramModelList.add(paramModel);
- }
- }
-
- // see AbstractUimaCasProcessor.createConfigParamOverrides
- protected void setCpeConfigParamSettings (ConfigurationParameterSettings cpeSettings)
- {
- if (cpeParamModelList == null) {
- cpeParamModelList = new ArrayList();
- }
- for (int i=0; i<paramModelList.size(); ++i) {
- ConfigParameterModel paramModel = (ConfigParameterModel) paramModelList.get(i);
-
- // Set param values for CPE
- // Trace.trace("Set cpeValue for " + paramModel.getName());
- Object cpeValue = cpeSettings.getParameterValue(paramModel.getName());
- if (cpeValue == null) {
- // Use Default Value
- cpeValue = paramSettings.getParameterValue(paramModel.getName());
- }
- paramModel.setCpeValue(cpeValue);
- cpeParamModelList.add(paramModel);
- }
- }
-
- public ConfigParameterModel getConfigParameterModel (String paramName)
- {
- for (int i=0; i<paramModelList.size(); ++i) {
- if (paramName.equals(((ConfigParameterModel) paramModelList.get(i)).getName())) {
- return (ConfigParameterModel) paramModelList.get(i);
- }
- }
- Trace.trace("Cannot find ConfigParameterModel:" + paramName);
- return null;
- }
-
- /**
- * @return Returns the paramDeclarations.
- */
- public ConfigurationParameterDeclarations getParamDeclarations() {
- return paramDeclarations;
- }
-
- /**
- * @param paramDeclarations The paramDeclarations to set.
- */
- public void setParamDeclarations(
- ConfigurationParameterDeclarations paramDeclarations) {
- this.paramDeclarations = paramDeclarations;
- }
-
- /**
- * @return Returns the paramSettings.
- */
- public ConfigurationParameterSettings getParamSettings() {
- return paramSettings;
- }
-
- /**
- * @param paramSettings The paramSettings to set.
- */
- public void setParamSettings(ConfigurationParameterSettings paramSettings) {
- this.paramSettings = paramSettings;
- }
-
- /**
- * @return Returns the paramModelList.
- */
- public List getParamModelList() {
- return paramModelList;
- }
-
- /**
- * @param paramModelList The paramModelList to set.
- */
- public void setParamModelList(List paramModelList) {
- this.paramModelList = paramModelList;
- }
-
- /**
- * @return Returns the cpeParamModelList.
- */
- public List getCpeParamModelList() {
- return cpeParamModelList;
- }
-
- /**
- * @param cpeParamModelList The cpeParamModelList to set.
- */
- public void setCpeParamModelList(List cpeParamModelList) {
- this.cpeParamModelList = cpeParamModelList;
- }
-
- static public void printNameValuePairs (NameValuePair[] nvs)
- {
- for (int i=0; i<nvs.length; ++i) {
- String name = nvs[i].getName();
- Trace.trace("Param name:" + nvs[i].getName());
- Object aValue = nvs[i].getValue();
- if (aValue == null) {
- System.out.println(" no value");
- }
- if (aValue instanceof String) {
-
- } else if (aValue instanceof Integer) {
- System.out.println(" Integer" + ((Integer) aValue).intValue());
- } else if (aValue instanceof Float) {
-
- } else if (aValue instanceof Boolean) {
-
- } else if (aValue instanceof Object[]) {
- Object[] obj = (Object[])aValue;
- System.out.println(" Object[]:" + obj.length);
- for (int k = 0; k < obj.length; k++) {
- if (obj[k] instanceof String) {
- System.out.println(" [" + k + "]:" + obj[k].toString());
- }
- else if (obj[k] instanceof Integer) {
- System.out.println(" [" + k + "]:" + ((Integer)obj[k]).intValue());
- }
- else if (obj[k] instanceof Float) {
- System.out.println(" [" + k + "]:" + ((Float)obj[k]).floatValue());
- } else if (obj[k] instanceof Boolean) {
- System.out.println(" [" + k + "]:" + ((Boolean)obj[k]).booleanValue());
- }
- }
- } else {
-
- }
- }
-
- }
-
-}
+/**
+ *
+ * Project UIMA Tooling
+ *
+ *
+ * creation date: Jan 12, 2006, 1:57:56 PM
+ * source: ConfigParametersModel.java
+ */
+package org.apache.uima.cpe.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.uima.collection.metadata.CasProcessorConfigurationParameterSettings;
+import org.apache.uima.resource.metadata.ConfigurationParameter;
+import org.apache.uima.resource.metadata.ConfigurationParameterDeclarations;
+import org.apache.uima.resource.metadata.ConfigurationParameterSettings;
+import org.apache.uima.resource.metadata.NameValuePair;
+import org.apache.uima.tools.debug.util.Trace;
+
+
+/**
+ *
+ *
+ */
+public class ConfigParametersModel {
+
+ // List of ConfigParameterModel
+ private List paramModelList = new ArrayList();
+
+ // List of ConfigParameterModel Overrides specified in CPE Xml
+ private List cpeParamModelList = null; // new ArrayList();
+
+ private ConfigurationParameterDeclarations paramDeclarations;
+ private ConfigurationParameterSettings paramSettings;
+
+ public ConfigParametersModel(ConfigurationParameterDeclarations decls,
+ ConfigurationParameterSettings settings)
+ {
+ this(decls, settings, null);
+ }
+
+ /**
+ * Create config. param model by setting CPE's overrides to the
+ * sepecified values or default values from the descriptor
+ *
+ * @param decls Param definitions from Xml descriptor
+ * @param settings Param values from Xml descriptor
+ * @param cpeSettings Settings for CPE's overrides. If null, the default values
+ * from Xml descriptor (from "settings") will be used
+ */
+ public ConfigParametersModel(ConfigurationParameterDeclarations decls,
+ ConfigurationParameterSettings settings,
+ CasProcessorConfigurationParameterSettings cpeSettings)
+ {
+ super();
+ paramDeclarations = decls;
+ paramSettings = settings;
+ if (paramDeclarations == null) return;
+ // printNameValuePairs(paramSettings.getParameterSettings());
+
+ // Create Param Model List
+ ConfigurationParameter[] params = paramDeclarations.getConfigurationParameters();
+ for (int i=0; i<params.length; ++i) {
+ ConfigParameterModel paramModel = new ConfigParameterModel(params[i]);
+ // Set "default" param values as defined in XML descriptor
+ paramModel.setValue(paramSettings.getParameterValue(paramModel.getName()));
+
+ // Set param values for CPE
+ if (cpeSettings != null) {
+ // Trace.trace("Set cpeValue for " + paramModel.getName());
+ Object cpeValue = cpeSettings.getParameterValue(paramModel.getName());
+ if (cpeValue == null) {
+ // Clone Value
+ // Trace.trace(" Clone cpeValue");
+ cpeValue = paramSettings.getParameterValue(paramModel.getName());
+ } else {
+
+ }
+ paramModel.setCpeValue(cpeValue);
+ if (cpeParamModelList == null) {
+ cpeParamModelList = new ArrayList();
+ }
+ cpeParamModelList.add(paramModel);
+ } else {
+ // Use default value from descriptor
+ paramModel.setCpeValue(paramSettings.getParameterValue(paramModel.getName()));
+ }
+ paramModelList.add(paramModel);
+ }
+ }
+
+ // see AbstractUimaCasProcessor.createConfigParamOverrides
+ protected void setCpeConfigParamSettings (ConfigurationParameterSettings cpeSettings)
+ {
+ if (cpeParamModelList == null) {
+ cpeParamModelList = new ArrayList();
+ }
+ for (int i=0; i<paramModelList.size(); ++i) {
+ ConfigParameterModel paramModel = (ConfigParameterModel) paramModelList.get(i);
+
+ // Set param values for CPE
+ // Trace.trace("Set cpeValue for " + paramModel.getName());
+ Object cpeValue = cpeSettings.getParameterValue(paramModel.getName());
+ if (cpeValue == null) {
+ // Use Default Value
+ cpeValue = paramSettings.getParameterValue(paramModel.getName());
+ }
+ paramModel.setCpeValue(cpeValue);
+ cpeParamModelList.add(paramModel);
+ }
+ }
+
+ public ConfigParameterModel getConfigParameterModel (String paramName)
+ {
+ for (int i=0; i<paramModelList.size(); ++i) {
+ if (paramName.equals(((ConfigParameterModel) paramModelList.get(i)).getName())) {
+ return (ConfigParameterModel) paramModelList.get(i);
+ }
+ }
+ Trace.trace("Cannot find ConfigParameterModel:" + paramName);
+ return null;
+ }
+
+ /**
+ * @return Returns the paramDeclarations.
+ */
+ public ConfigurationParameterDeclarations getParamDeclarations() {
+ return paramDeclarations;
+ }
+
+ /**
+ * @param paramDeclarations The paramDeclarations to set.
+ */
+ public void setParamDeclarations(
+ ConfigurationParameterDeclarations paramDeclarations) {
+ this.paramDeclarations = paramDeclarations;
+ }
+
+ /**
+ * @return Returns the paramSettings.
+ */
+ public ConfigurationParameterSettings getParamSettings() {
+ return paramSettings;
+ }
+
+ /**
+ * @param paramSettings The paramSettings to set.
+ */
+ public void setParamSettings(ConfigurationParameterSettings paramSettings) {
+ this.paramSettings = paramSettings;
+ }
+
+ /**
+ * @return Returns the paramModelList.
+ */
+ public List getParamModelList() {
+ return paramModelList;
+ }
+
+ /**
+ * @param paramModelList The paramModelList to set.
+ */
+ public void setParamModelList(List paramModelList) {
+ this.paramModelList = paramModelList;
+ }
+
+ /**
+ * @return Returns the cpeParamModelList.
+ */
+ public List getCpeParamModelList() {
+ return cpeParamModelList;
+ }
+
+ /**
+ * @param cpeParamModelList The cpeParamModelList to set.
+ */
+ public void setCpeParamModelList(List cpeParamModelList) {
+ this.cpeParamModelList = cpeParamModelList;
+ }
+
+ static public void printNameValuePairs (NameValuePair[] nvs)
+ {
+ for (int i=0; i<nvs.length; ++i) {
+ String name = nvs[i].getName();
+ Trace.trace("Param name:" + nvs[i].getName());
+ Object aValue = nvs[i].getValue();
+ if (aValue == null) {
+ System.out.println(" no value");
+ }
+ if (aValue instanceof String) {
+
+ } else if (aValue instanceof Integer) {
+ System.out.println(" Integer" + ((Integer) aValue).intValue());
+ } else if (aValue instanceof Float) {
+
+ } else if (aValue instanceof Boolean) {
+
+ } else if (aValue instanceof Object[]) {
+ Object[] obj = (Object[])aValue;
+ System.out.println(" Object[]:" + obj.length);
+ for (int k = 0; k < obj.length; k++) {
+ if (obj[k] instanceof String) {
+ System.out.println(" [" + k + "]:" + obj[k].toString());
+ }
+ else if (obj[k] instanceof Integer) {
+ System.out.println(" [" + k + "]:" + ((Integer)obj[k]).intValue());
+ }
+ else if (obj[k] instanceof Float) {
+ System.out.println(" [" + k + "]:" + ((Float)obj[k]).floatValue());
+ } else if (obj[k] instanceof Boolean) {
+ System.out.println(" [" + k + "]:" + ((Boolean)obj[k]).booleanValue());
+ }
+ }
+ } else {
+
+ }
+ }
+
+ }
+
+}
Propchange: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/ConfigParametersModel.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/CpeCasProcessorModel.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/CpeCasProcessorModel.java?rev=610062&r1=610061&r2=610062&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/CpeCasProcessorModel.java (original)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/CpeCasProcessorModel.java Tue Jan 8 08:38:45 2008
@@ -1,200 +1,200 @@
-/**
- *
- * Project UIMA Tooling
- *
- *
- * creation date: Jan 11, 2006, 4:47:13 PM
- * source: CpeCasProcessorModel.java
- */
-package org.apache.uima.cpe.model;
-
-import org.apache.uima.analysis_engine.AnalysisEngineDescription;
-import org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData;
-import org.apache.uima.collection.CasConsumerDescription;
-import org.apache.uima.collection.metadata.CasProcessorConfigurationParameterSettings;
-import org.apache.uima.collection.metadata.CasProcessorDeploymentParams;
-import org.apache.uima.collection.metadata.CasProcessorErrorHandling;
-import org.apache.uima.collection.metadata.CpeCasProcessor;
-import org.apache.uima.collection.metadata.CpeCheckpoint;
-import org.apache.uima.resource.ResourceSpecifier;
-import org.apache.uima.resource.metadata.ConfigurationParameterDeclarations;
-import org.apache.uima.resource.metadata.ConfigurationParameterSettings;
-import org.apache.uima.tools.debug.util.Trace;
-
-
-/**
- *
- *
- */
-public class CpeCasProcessorModel
-{
- // Link back to CPE Descriptor Model
-// private CpeDescriptorModel mCpeDescriptorModel;
-
- private CpeCasProcessor cpeCasProcessor;
-// private ResourceSpecifier specifier;
- private ConfigParametersModel configParamsModel;
- private ConfigurationParameterDeclarations configParamDecls = null;
- private ConfigurationParameterSettings configParamSettings = null;
-
- /*************************************************************************/
-
- public CpeCasProcessorModel(CpeDescriptorModel parentModel,
- CpeCasProcessor cpeCasProcessor, ResourceSpecifier specifier) {
- super();
-// this.mCpeDescriptorModel = parentModel;
- this.cpeCasProcessor = cpeCasProcessor;
-// this.specifier = specifier;
- if (specifier instanceof AnalysisEngineDescription) {
- AnalysisEngineMetaData a = ((AnalysisEngineDescription) specifier).getAnalysisEngineMetaData();
- configParamDecls = a.getConfigurationParameterDeclarations();
- configParamSettings = a.getConfigurationParameterSettings();
-
- } else if (specifier instanceof CasConsumerDescription) {
- configParamDecls = ((CasConsumerDescription) specifier).getCasConsumerMetaData()
- .getConfigurationParameterDeclarations();
- configParamSettings = ((CasConsumerDescription) specifier).getCasConsumerMetaData()
- .getConfigurationParameterSettings();
- }
- Trace.trace("Create CpeCasProcessorModel for "+ cpeCasProcessor.getName());
- configParamsModel = new ConfigParametersModel(configParamDecls, configParamSettings,
- cpeCasProcessor.getConfigurationParameterSettings());
- }
-
- /*************************************************************************/
-
-// public UimaCasProcessor getUimaCasProcessor ()
-// {
-// return mCpeDescriptorModel.getUimaCasProcessor(this.getName());
-// }
-
- /**
- * @return Returns the configParamsModel.
- */
- public ConfigParametersModel getConfigParamsModel() {
- return configParamsModel;
- }
-
- /**
- * @param configParamsModel The configParamsModel to set.
- */
- public void setConfigParamsModel(ConfigParametersModel configParamsModel) {
- this.configParamsModel = configParamsModel;
- }
-
- public ConfigurationParameterDeclarations getConfigurationParameterDeclarations () {
- return configParamDecls;
- }
-
- public ConfigurationParameterSettings getConfigurationParameterSettings () {
- return configParamSettings;
- }
-
- /*************************************************************************/
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeCasProcessor#getConfigurationParameterSettings()
- */
- public CasProcessorConfigurationParameterSettings getCasProcessorConfigurationParameterSettings() {
- return cpeCasProcessor.getConfigurationParameterSettings();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeCasProcessor#getDescriptor()
- */
- public String getDescriptor() {
- return cpeCasProcessor.getDescriptor();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeCasProcessor#getName()
- */
- public String getName() {
- return cpeCasProcessor.getName();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeCasProcessor#getActionOnMaxError()
- */
- public String getActionOnMaxError() {
- return cpeCasProcessor.getActionOnMaxError();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeCasProcessor#getActionOnMaxRestart()
- */
- public String getActionOnMaxRestart() {
- return cpeCasProcessor.getActionOnMaxRestart();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeCasProcessor#getBatchSize()
- */
- public int getBatchSize() {
- return cpeCasProcessor.getBatchSize();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeCasProcessor#getCasProcessorFilter()
- */
- public String getCasProcessorFilter() {
- return cpeCasProcessor.getCasProcessorFilter();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeCasProcessor#getCheckpoint()
- */
- public CpeCheckpoint getCheckpoint() {
- return cpeCasProcessor.getCheckpoint();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeCasProcessor#getDeployment()
- */
- public String getDeployment() {
- return cpeCasProcessor.getDeployment();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeCasProcessor#getDeploymentParams()
- */
- public CasProcessorDeploymentParams getDeploymentParams() {
- return cpeCasProcessor.getDeploymentParams();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeCasProcessor#getErrorHandling()
- */
- public CasProcessorErrorHandling getErrorHandling() {
- return cpeCasProcessor.getErrorHandling();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeCasProcessor#getMaxErrorCount()
- */
- public int getMaxErrorCount() {
- return cpeCasProcessor.getMaxErrorCount();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeCasProcessor#getMaxErrorSampleSize()
- */
- public int getMaxErrorSampleSize() {
- return cpeCasProcessor.getMaxErrorSampleSize();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeCasProcessor#getMaxRestartCount()
- */
- public int getMaxRestartCount() {
- return cpeCasProcessor.getMaxRestartCount();
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeCasProcessor#getTimeout()
- */
- public int getTimeout() {
- return cpeCasProcessor.getTimeout();
- }
-
-}
+/**
+ *
+ * Project UIMA Tooling
+ *
+ *
+ * creation date: Jan 11, 2006, 4:47:13 PM
+ * source: CpeCasProcessorModel.java
+ */
+package org.apache.uima.cpe.model;
+
+import org.apache.uima.analysis_engine.AnalysisEngineDescription;
+import org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData;
+import org.apache.uima.collection.CasConsumerDescription;
+import org.apache.uima.collection.metadata.CasProcessorConfigurationParameterSettings;
+import org.apache.uima.collection.metadata.CasProcessorDeploymentParams;
+import org.apache.uima.collection.metadata.CasProcessorErrorHandling;
+import org.apache.uima.collection.metadata.CpeCasProcessor;
+import org.apache.uima.collection.metadata.CpeCheckpoint;
+import org.apache.uima.resource.ResourceSpecifier;
+import org.apache.uima.resource.metadata.ConfigurationParameterDeclarations;
+import org.apache.uima.resource.metadata.ConfigurationParameterSettings;
+import org.apache.uima.tools.debug.util.Trace;
+
+
+/**
+ *
+ *
+ */
+public class CpeCasProcessorModel
+{
+ // Link back to CPE Descriptor Model
+// private CpeDescriptorModel mCpeDescriptorModel;
+
+ private CpeCasProcessor cpeCasProcessor;
+// private ResourceSpecifier specifier;
+ private ConfigParametersModel configParamsModel;
+ private ConfigurationParameterDeclarations configParamDecls = null;
+ private ConfigurationParameterSettings configParamSettings = null;
+
+ /*************************************************************************/
+
+ public CpeCasProcessorModel(CpeDescriptorModel parentModel,
+ CpeCasProcessor cpeCasProcessor, ResourceSpecifier specifier) {
+ super();
+// this.mCpeDescriptorModel = parentModel;
+ this.cpeCasProcessor = cpeCasProcessor;
+// this.specifier = specifier;
+ if (specifier instanceof AnalysisEngineDescription) {
+ AnalysisEngineMetaData a = ((AnalysisEngineDescription) specifier).getAnalysisEngineMetaData();
+ configParamDecls = a.getConfigurationParameterDeclarations();
+ configParamSettings = a.getConfigurationParameterSettings();
+
+ } else if (specifier instanceof CasConsumerDescription) {
+ configParamDecls = ((CasConsumerDescription) specifier).getCasConsumerMetaData()
+ .getConfigurationParameterDeclarations();
+ configParamSettings = ((CasConsumerDescription) specifier).getCasConsumerMetaData()
+ .getConfigurationParameterSettings();
+ }
+ Trace.trace("Create CpeCasProcessorModel for "+ cpeCasProcessor.getName());
+ configParamsModel = new ConfigParametersModel(configParamDecls, configParamSettings,
+ cpeCasProcessor.getConfigurationParameterSettings());
+ }
+
+ /*************************************************************************/
+
+// public UimaCasProcessor getUimaCasProcessor ()
+// {
+// return mCpeDescriptorModel.getUimaCasProcessor(this.getName());
+// }
+
+ /**
+ * @return Returns the configParamsModel.
+ */
+ public ConfigParametersModel getConfigParamsModel() {
+ return configParamsModel;
+ }
+
+ /**
+ * @param configParamsModel The configParamsModel to set.
+ */
+ public void setConfigParamsModel(ConfigParametersModel configParamsModel) {
+ this.configParamsModel = configParamsModel;
+ }
+
+ public ConfigurationParameterDeclarations getConfigurationParameterDeclarations () {
+ return configParamDecls;
+ }
+
+ public ConfigurationParameterSettings getConfigurationParameterSettings () {
+ return configParamSettings;
+ }
+
+ /*************************************************************************/
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessor#getConfigurationParameterSettings()
+ */
+ public CasProcessorConfigurationParameterSettings getCasProcessorConfigurationParameterSettings() {
+ return cpeCasProcessor.getConfigurationParameterSettings();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessor#getDescriptor()
+ */
+ public String getDescriptor() {
+ return cpeCasProcessor.getDescriptor();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessor#getName()
+ */
+ public String getName() {
+ return cpeCasProcessor.getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessor#getActionOnMaxError()
+ */
+ public String getActionOnMaxError() {
+ return cpeCasProcessor.getActionOnMaxError();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessor#getActionOnMaxRestart()
+ */
+ public String getActionOnMaxRestart() {
+ return cpeCasProcessor.getActionOnMaxRestart();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessor#getBatchSize()
+ */
+ public int getBatchSize() {
+ return cpeCasProcessor.getBatchSize();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessor#getCasProcessorFilter()
+ */
+ public String getCasProcessorFilter() {
+ return cpeCasProcessor.getCasProcessorFilter();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessor#getCheckpoint()
+ */
+ public CpeCheckpoint getCheckpoint() {
+ return cpeCasProcessor.getCheckpoint();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessor#getDeployment()
+ */
+ public String getDeployment() {
+ return cpeCasProcessor.getDeployment();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessor#getDeploymentParams()
+ */
+ public CasProcessorDeploymentParams getDeploymentParams() {
+ return cpeCasProcessor.getDeploymentParams();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessor#getErrorHandling()
+ */
+ public CasProcessorErrorHandling getErrorHandling() {
+ return cpeCasProcessor.getErrorHandling();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessor#getMaxErrorCount()
+ */
+ public int getMaxErrorCount() {
+ return cpeCasProcessor.getMaxErrorCount();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessor#getMaxErrorSampleSize()
+ */
+ public int getMaxErrorSampleSize() {
+ return cpeCasProcessor.getMaxErrorSampleSize();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessor#getMaxRestartCount()
+ */
+ public int getMaxRestartCount() {
+ return cpeCasProcessor.getMaxRestartCount();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessor#getTimeout()
+ */
+ public int getTimeout() {
+ return cpeCasProcessor.getTimeout();
+ }
+
+}
Propchange: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/CpeCasProcessorModel.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/CpeCasProcessorsSettings.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/CpeCasProcessorsSettings.java?rev=610062&r1=610061&r2=610062&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/CpeCasProcessorsSettings.java (original)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/CpeCasProcessorsSettings.java Tue Jan 8 08:38:45 2008
@@ -1,67 +1,67 @@
-/**
- *
- * Project UIMA Tooling
- *
- *
- * creation date: Mar 26, 2006, 4:07:18 PM
- * source: CpeCasProcessorsSettings.java
- */
-package org.apache.uima.cpe.model;
-
-/**
- *
- *
- */
-public class CpeCasProcessorsSettings {
-
- private int casPoolSize = 1;
- private int processingUnitThreadCount = 1;
- private boolean dropCasOnException = false; // def value of CPE
-
- public CpeCasProcessorsSettings() {
- super();
- }
-
- /**
- * @return Returns the casPoolSize.
- */
- public int getCasPoolSize() {
- return casPoolSize;
- }
-
- /**
- * @param casPoolSize The casPoolSize to set.
- */
- public void setCasPoolSize(int casPoolSize) {
- this.casPoolSize = casPoolSize;
- }
-
- /**
- * @return Returns the dropCasOnException.
- */
- public boolean isDropCasOnException() {
- return dropCasOnException;
- }
-
- /**
- * @param dropCasOnException The dropCasOnException to set.
- */
- public void setDropCasOnException(boolean dropCasOnException) {
- this.dropCasOnException = dropCasOnException;
- }
-
- /**
- * @return Returns the processingUnitThreadCount.
- */
- public int getProcessingUnitThreadCount() {
- return processingUnitThreadCount;
- }
-
- /**
- * @param processingUnitThreadCount The processingUnitThreadCount to set.
- */
- public void setProcessingUnitThreadCount(int processingUnitThreadCount) {
- this.processingUnitThreadCount = processingUnitThreadCount;
- }
-
-}
+/**
+ *
+ * Project UIMA Tooling
+ *
+ *
+ * creation date: Mar 26, 2006, 4:07:18 PM
+ * source: CpeCasProcessorsSettings.java
+ */
+package org.apache.uima.cpe.model;
+
+/**
+ *
+ *
+ */
+public class CpeCasProcessorsSettings {
+
+ private int casPoolSize = 1;
+ private int processingUnitThreadCount = 1;
+ private boolean dropCasOnException = false; // def value of CPE
+
+ public CpeCasProcessorsSettings() {
+ super();
+ }
+
+ /**
+ * @return Returns the casPoolSize.
+ */
+ public int getCasPoolSize() {
+ return casPoolSize;
+ }
+
+ /**
+ * @param casPoolSize The casPoolSize to set.
+ */
+ public void setCasPoolSize(int casPoolSize) {
+ this.casPoolSize = casPoolSize;
+ }
+
+ /**
+ * @return Returns the dropCasOnException.
+ */
+ public boolean isDropCasOnException() {
+ return dropCasOnException;
+ }
+
+ /**
+ * @param dropCasOnException The dropCasOnException to set.
+ */
+ public void setDropCasOnException(boolean dropCasOnException) {
+ this.dropCasOnException = dropCasOnException;
+ }
+
+ /**
+ * @return Returns the processingUnitThreadCount.
+ */
+ public int getProcessingUnitThreadCount() {
+ return processingUnitThreadCount;
+ }
+
+ /**
+ * @param processingUnitThreadCount The processingUnitThreadCount to set.
+ */
+ public void setProcessingUnitThreadCount(int processingUnitThreadCount) {
+ this.processingUnitThreadCount = processingUnitThreadCount;
+ }
+
+}
Propchange: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/cpe/model/CpeCasProcessorsSettings.java
------------------------------------------------------------------------------
svn:eol-style = native