Compare Revisions

The credentials to download the source code are:
 Username: svnusers
 Password: svnusers

Ignore whitespace Rev 2796 → Rev 2797

/branches/AMB/AdapterFramework/javasrc/extfunc/org/etsi/ttcn/extfunc/core/ExternalFunction.java
3,22 → 3,166
 
 
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.HashMap;
import java.util.Map;
 
import org.elvior.ttcn.tritci.TciProvider;
import org.etsi.common.ByteHelper;
import org.etsi.common.plugins.IXfPlugin;
import org.etsi.ttcn.codec.core.TciCDWrapperFactory;
import org.etsi.ttcn.tci.BooleanValue;
import org.etsi.ttcn.tci.CharstringValue;
import org.etsi.ttcn.tci.FloatValue;
import org.etsi.ttcn.tci.IntegerValue;
import org.etsi.ttcn.tci.OctetstringValue;
import org.etsi.ttcn.tci.Value;
import org.etsi.ttcn.tool.elvior.codec.TciCDWrapper;
import org.etsi.ttcn.tri.TriFunctionId;
import org.etsi.ttcn.tri.TriParameter;
import org.etsi.ttcn.tri.TriParameterList;
import org.etsi.ttcn.tri.TriParameterPassingMode;
 
public abstract class ExternalFunction implements IXfPlugin, InvocationHandler {
 
public ExternalFunction() {
TciCDWrapperFactory.getInstance().setImpl(new TciCDWrapper());
// Find available methods
Method[] methods = this.getClass().getDeclaredMethods();
for(int i=0; i < methods.length; i++) {
this.methods.put(methods[i].getName(), methods[i]);
}
}
 
private Map<String, Method> methods = new HashMap<String, Method>();
@Override
public void initPlugin() {
XfFactory.getInstance().registerXf(this.getPluginName(), this.getClass());
}
 
public abstract void unpack(TriFunctionId functionId, TriParameterList parameterList, TriParameter returnValue);
private Value simpleDecode(Class<?> c, byte[] encoded) {
switch(c.getSimpleName()) {
case "IntegerValue":
IntegerValue iv = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
iv.setInteger(ByteHelper.byteArrayToInt(encoded));
return iv;
case "FloatValue":
FloatValue fv = (FloatValue)TciProvider.getInstance().getTciCDRequired().getFloat().newInstance();
fv.setFloat(ByteHelper.byteArrayToInt(encoded)); // FIXME Should be byteArrayToFloat???
case "OctetstringValue":
OctetstringValue ov = (OctetstringValue)TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
ov.setLength(encoded.length);
for(int i=0; i < encoded.length; i++) {
ov.setOctet(i, encoded[i]);
}
case "CharstringValue":
CharstringValue cv = TciCDWrapperFactory.getTciCDInstance().getCharstringValue();
cv.setString(new String(encoded));
case "BooleanValue":
assert(false); // TODO
return null;
case "RecordOfValue": //fx_isValidPolygonalRegion
case "RecordValue": //fx_isLocationInsideCircularRegion
}
 
return null;
}
 
private byte[] simpleEncode(Class<?> c, Value v) {
if(IntegerValue.class.isInstance(v)) {
IntegerValue res = (IntegerValue)v;
return ByteHelper.intToByteArray(res.getInteger(), Integer.SIZE / Byte.SIZE);
}
 
if(FloatValue.class.isInstance(v)) {
FloatValue res = (FloatValue)v;
return ByteHelper.floatToByteArray(res.getFloat());
}
if(OctetstringValue.class.isInstance(v)) {
OctetstringValue res = (OctetstringValue)v;
byte[] encoded = new byte[res.getLength()];
for(int i=0; i < encoded.length; i++) {
encoded[i] = (byte) res.getOctet(i);
}
return encoded;
}
if(CharstringValue.class.isInstance(v)) {
assert(false); // TODO
return null;
}
if(BooleanValue.class.isInstance(v)) {
BooleanValue res = (BooleanValue)v;
return new byte[] { (byte)((res.getBoolean() == true) ? 0x01 : 0x00) };
}
return null;
}
public void exec(TriFunctionId functionId, TriParameterList parameterList, TriParameter returnValue) {
String functionName = functionId.getFunctionName();
String[] parts = functionName.split("\\.");
functionName = parts[parts.length - 1];
Method xf = methods.get("exec_" + functionName);
if(xf != null) {
Object[] args = new Object[2];
args[0] = parameterList;
args[1] = returnValue;
try {
xf.invoke(this, args);
parameterList = (TriParameterList)args[0];
returnValue = (TriParameter)args[1];
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
}
return;
}
xf = methods.get(functionName);
if(xf == null) {
System.err.println("ERROR: Unknown external function");
return;
}
Class<?>[] params = xf.getParameterTypes();
if(params.length != parameterList.size()) {
System.err.println("ERROR: Incorrect number of parameters");
return;
}
Object[] args = new Object[params.length];
for(int i=0; i < params.length; i++) {
args[i] = simpleDecode(params[i], parameterList.get(i).getEncodedParameter());
}
// Invoke the external function
try {
Object result = xf.invoke(this, args);
 
// return value
byte[] res = simpleEncode(result.getClass(), (Value)result);
returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
returnValue.setNumberOfBits(res.length * 8); // TODO: improve
returnValue.setEncodedParameter(res);
// (in)out parameters
// TODO
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
}
}
public Object getProxy(Class<?> iface) {
/branches/AMB/AdapterFramework/javasrc/extfunc/org/etsi/ttcn/extfunc/its/ExecItsExternalFunctionsProvider.java
0,0 → 1,298
package org.etsi.ttcn.extfunc.its;
 
import org.etsi.common.ByteHelper;
import org.etsi.ttcn.codec.core.ITciCDWrapper;
import org.etsi.ttcn.codec.core.TciCDWrapperFactory;
import org.etsi.ttcn.tci.BooleanValue;
import org.etsi.ttcn.tci.EnumeratedValue;
import org.etsi.ttcn.tci.OctetstringValue;
import org.etsi.ttcn.tci.RecordOfValue;
import org.etsi.ttcn.tci.RecordValue;
import org.etsi.ttcn.tri.TriParameter;
import org.etsi.ttcn.tri.TriParameterList;
import org.etsi.ttcn.tri.TriParameterPassingMode;
 
// This class implements complex-to-decode xfs
public class ExecItsExternalFunctionsProvider extends ItsExternalFunctionsProvider {
 
public void exec_fx_isValidPolygonalRegion(TriParameterList parameterList, TriParameter returnValue) {
// Decode region parameter
ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
RecordOfValue region = wrapper.getRecordOfValue("LibItsSecurity_TypesAndValues.PolygonalRegion");
byte[] value = parameterList.get(0).getEncodedParameter();
byte length = value[0];
int offset = 1;
while (offset < length) { // TODO Create a method to fill PolygonRegions
// WGS84 Latitude
int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
// WGS84 Longitude
int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
RecordValue twoDLocation = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
twoDLocation.setField("latitude", wrapper.setInteger(latitude));
twoDLocation.setField("longitude", wrapper.setInteger(longitude));
}
// Execute the function
BooleanValue result = fx_isValidPolygonalRegion(region);
// Return code
returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
returnValue.setNumberOfBits(Byte.SIZE);
returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
} // End of method exec_isValidPolygonalRegion
public void exec_fx_isPolygonalRegionInside(TriParameterList parameterList, TriParameter returnValue) {
// Decode parent parameter
// Execute the function
ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
RecordOfValue parent = wrapper.getRecordOfValue("LibItsSecurity_TypesAndValues.PolygonalRegion");
byte[] value = parameterList.get(0).getEncodedParameter();
byte length = value[0];
int offset = 1;
while (offset < length) { // TODO Create a method to fill PolygonRegions
// WGS84 Latitude
int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
// WGS84 Longitude
int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
RecordValue twoDLocation = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
twoDLocation.setField("latitude", wrapper.setInteger(latitude));
twoDLocation.setField("longitude", wrapper.setInteger(longitude));
parent.appendField(twoDLocation);
} // End of 'while' statement
// Decode region parameter
RecordOfValue region = wrapper.getRecordOfValue("LibItsSecurity_TypesAndValues.PolygonalRegion");
value = ByteHelper.extract(parameterList.get(0).getEncodedParameter(), offset, parameterList.get(0).getEncodedParameter().length - offset);
length = value[0];
offset = 1;
while (offset < length) { // TODO Create a method to fill PolygonRegions
// WGS84 Latitude
int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
// WGS84 Longitude
int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
RecordValue twoDLocation = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
twoDLocation.setField("latitude", wrapper.setInteger(latitude));
twoDLocation.setField("longitude", wrapper.setInteger(longitude));
region.appendField(twoDLocation);
} // End of 'while' statement
// Execute the function
BooleanValue result = fx_isPolygonalRegionInside(parent, region);
// Return code
returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
returnValue.setNumberOfBits(Byte.SIZE);
returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
} // End of method exec_isPolygonalRegionInside
public void exec_fx_isLocationInsideCircularRegion(TriParameterList parameterList, TriParameter returnValue) {
// Decode rectangularRegions parameter
ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
byte[] value = parameterList.get(0).getEncodedParameter();
int offset = 0;
// Center
RecordValue center = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
// WGS84 Latitude
int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
// WGS84 Longitude
int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
center.setField("latitude", wrapper.setInteger(latitude));
center.setField("longitude", wrapper.setInteger(longitude));
// Radius
int radius = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Short.SIZE / Byte.SIZE));
RecordValue circularRegion = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.CircularRegion");
circularRegion.setField("center", center);
circularRegion.setField("radius", wrapper.setInteger(radius));
// Decode location parameter
value = parameterList.get(1).getEncodedParameter();
offset = 0;
// WGS84 Latitude
latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
// WGS84 Longitude
longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
RecordValue location = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.ThreeDLocation");
location.setField("latitude", wrapper.setInteger(latitude));
location.setField("longitude", wrapper.setInteger(longitude));
OctetstringValue elevation = wrapper.getOctetstring();
elevation.setLength(2);
elevation.setOctet(0, 0x00); elevation.setOctet(1, 0x00);
location.setField("elevation", elevation);
// Execute the function
BooleanValue result = fx_isLocationInsideCircularRegion(circularRegion, location);
// Return code
returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
returnValue.setNumberOfBits(Byte.SIZE);
returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
} // End of method exec_isLocationInsideCircularRegion
public void exec_fx_isLocationInsideRectangularRegion(TriParameterList parameterList, TriParameter returnValue) {
// Decode rectangularRegions parameter
ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
RecordOfValue rectangularRegions = wrapper.getRecordOfValue("LibItsSecurity_TypesAndValues.RectangularRegions");
byte[] value = parameterList.get(0).getEncodedParameter();
byte length = value[0];
int offset = 1;
while (offset < length) { // TODO Create a method to fill RectangularRegions
// northwest
RecordValue northwest = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
// WGS84 Latitude
int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
// WGS84 Longitude
int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
northwest.setField("latitude", wrapper.setInteger(latitude));
northwest.setField("longitude", wrapper.setInteger(longitude));
// southeast
RecordValue southeast = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
// WGS84 Latitude
latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
// WGS84 Longitude
longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
southeast.setField("latitude", wrapper.setInteger(latitude));
southeast.setField("longitude", wrapper.setInteger(longitude));
RecordValue rectangularRegion = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.RectangularRegion");
rectangularRegion.setField("northwest", northwest);
rectangularRegion.setField("southeast", southeast);
rectangularRegions.appendField(rectangularRegion);
} // End of 'while' statement
// Decode location parameter
// ByteHelper.dump("exec_isLocationInsidePolygonalRegion: ", parameterList.get(1).getEncodedParameter());
value = parameterList.get(1).getEncodedParameter();
offset = 0;
// WGS84 Latitude
int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
// WGS84 Longitude
int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
RecordValue location = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.ThreeDLocation");
location.setField("latitude", wrapper.setInteger(latitude));
location.setField("longitude", wrapper.setInteger(longitude));
OctetstringValue elevation = wrapper.getOctetstring();
elevation.setLength(2);
elevation.setOctet(0, 0x00); elevation.setOctet(1, 0x00);
location.setField("elevation", elevation);
// Execute the function
BooleanValue result = fx_isLocationInsideRectangularRegion(rectangularRegions, location);
// Return code
returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
returnValue.setNumberOfBits(Byte.SIZE);
returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
} // End of method exec_isLocationInsideRectangularRegion
public void exec_fx_isLocationInsidePolygonalRegion(TriParameterList parameterList, TriParameter returnValue) {
// Execute the function
ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
RecordOfValue polygonalArea = wrapper.getRecordOfValue("LibItsSecurity_TypesAndValues.PolygonalRegion");
byte[] value = parameterList.get(0).getEncodedParameter();
byte length = value[0];
int offset = 1;
while (offset < length) { // TODO Create a method to fill PolygonRegions
// WGS84 Latitude
int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
// WGS84 Longitude
int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
RecordValue twoDLocation = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
twoDLocation.setField("latitude", wrapper.setInteger(latitude));
twoDLocation.setField("longitude", wrapper.setInteger(longitude));
polygonalArea.appendField(twoDLocation);
} // End of 'while' statement
// ByteHelper.dump("exec_isLocationInsidePolygonalRegion: ", parameterList.get(1).getEncodedParameter());
value = parameterList.get(1).getEncodedParameter();
offset = 0;
// WGS84 Latitude
int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
// WGS84 Longitude
int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
RecordValue location = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.ThreeDLocation");
location.setField("latitude", wrapper.setInteger(latitude));
location.setField("longitude", wrapper.setInteger(longitude));
OctetstringValue elevation = wrapper.getOctetstring();
elevation.setLength(2);
elevation.setOctet(0, 0x00); elevation.setOctet(1, 0x00);
location.setField("elevation", elevation);
BooleanValue result = fx_isLocationInsidePolygonalRegion(polygonalArea, location);
// Return code
returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
returnValue.setNumberOfBits(Byte.SIZE);
returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
} // End of method exec_isLocationInsidePolygonalRegion
public void exec_fx_isLocationInsideIdentifiedRegion(TriParameterList parameterList, TriParameter returnValue) {
// Decode rectangularRegions parameter
ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
byte[] value = parameterList.get(0).getEncodedParameter();
int offset = 0;
// RegionDictionary
EnumeratedValue region_dictionary = wrapper.getEnumValue("LibItsSecurity_TypesAndValues.RegionDictionary");
region_dictionary.setInt(value[offset++]);
// region_identifier
int region_identifier = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Short.SIZE / Byte.SIZE));
offset += Short.SIZE / Byte.SIZE;
// local_region
int local_region;
if ((value[offset] & 0x80) == 0x00) { // One byte length
local_region = value[offset];
} else {
// TODO Process it as IntX, not as 4 bytes integer
value[offset] &= 0x7f;
local_region = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Short.SIZE / Byte.SIZE));
}
RecordValue identifiedRegion = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.IdentifiedRegion");
identifiedRegion.setField("region_dictionary", region_dictionary);
identifiedRegion.setField("region_identifier", wrapper.setInteger(region_identifier));
identifiedRegion.setField("local_region", wrapper.setInteger(local_region));
// Decode location parameter
value = parameterList.get(1).getEncodedParameter();
offset = 0;
// WGS84 Latitude
int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
// WGS84 Longitude
int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
offset += Integer.SIZE / Byte.SIZE;
RecordValue location = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.ThreeDLocation");
location.setField("latitude", wrapper.setInteger(latitude));
location.setField("longitude", wrapper.setInteger(longitude));
OctetstringValue elevation = wrapper.getOctetstring();
elevation.setLength(2);
elevation.setOctet(0, 0x00); elevation.setOctet(1, 0x00);
location.setField("elevation", elevation);
// Execute the function
BooleanValue result = fx_isLocationInsideIdentifiedRegion(identifiedRegion, location);
// Return code
returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
returnValue.setNumberOfBits(Byte.SIZE);
returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
} // End of method exec_isLocationInsideIdentifiedRegion
}
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+URL Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/extfunc/org/etsi/ttcn/extfunc/its/ItsExternalFunctionsProvider.java
===================================================================
--- AdapterFramework/javasrc/extfunc/org/etsi/ttcn/extfunc/its/ItsExternalFunctionsProvider.java (revision 2796)
+++ AdapterFramework/javasrc/extfunc/org/etsi/ttcn/extfunc/its/ItsExternalFunctionsProvider.java (revision 2797)
@@ -34,9 +34,6 @@
import org.etsi.ttcn.tci.OctetstringValue;
import org.etsi.ttcn.tci.RecordOfValue;
import org.etsi.ttcn.tci.RecordValue;
-import org.etsi.ttcn.tri.TriFunctionId;
-import org.etsi.ttcn.tri.TriParameter;
-import org.etsi.ttcn.tri.TriParameterList;
import de.fraunhofer.sit.c2x.CryptoLib;
import de.fraunhofer.sit.c2x.EcdsaP256KeyPair;
@@ -80,7 +77,8 @@
* Default ctor
*/
public ItsExternalFunctionsProvider() {
-
+ super();
+
_tcicdWrapper = TciCDWrapperFactory.getTciCDInstance();
try {
@@ -94,32 +92,6 @@
}
}
- @Override
- public void unpack(TriFunctionId functionId, TriParameterList parameterList, TriParameter returnValue) {
-
- functionId.getFunctionName();
-
- Class<?>[] params = new Class<?>[parameterList.size()];
- for(int i=0; i < parameterList.size(); i++) {
- try {
- params[i] = Class.forName(parameterList.get(i).getParameterName());
- } catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
- try {
- this.getClass().getMethod(functionId.getFunctionName(), params);
- } catch (NoSuchMethodException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (SecurityException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
/**
* This external function gets the current time
*