The code below is a pseudo code for the Formatter, which incorporates some of the tips and recommendations from the Formatter plugin page.
Use the pseudo code below as a starting point for a Formatter plugin.
package com.oracle.determinations.interview.engine.userplugins;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import com.oracle.determinations.engine.Attribute;
import com.oracle.determinations.web.platform.plugins.PlatformSessionPlugin;
import com.oracle.determinations.web.platform.plugins.PlatformSessionRegisterArgs;
import com.oracle.determinations.web.platform.plugins.formatting.DefaultFormatter;
import com.oracle.determinations.web.platform.plugins.formatting.WebDeterminationsFormatterPlugin;
public class LatitudeLongitudeFormatter implements WebDeterminationsFormatterPlugin {
private DefaultFormatter defaultFormatter;
//REQUIRED - for Plugin architecture
public PseudoFormatter()
{
}
public PseudoFormatter(DefaultFormatter defaultFormatter)
{
this.defaultFormatter = defaultFormatter;
}
public PlatformSessionPlugin getInstance(PlatformSessionRegisterArgs args) {
new PseudoFormatter();
}
//return a String equivalent of the provided 'value' of type 'type'
public String getFormattedValue(byte type, Object value) {
// TODO Auto-generated method stub
return null;
}
//return a String equivalent of the provided 'value' using 'type' and attribute
public String getFormattedValue(byte type, Object value, Attribute attr) {
// TODO Auto-generated method stub
return null;
}
//return the raw Object format of the provided 'value', using 'type' and attribute to parse
public Object parse(byte type, String value, Attribute attr) {
// TODO Auto-generated method stub
return null;
}
//return the raw Object format of the provided 'value', using 'type' to parse
public Object parse(byte type, String value) {
// TODO Auto-generated method stub
return null;
}
public boolean canFormatTemporal() {
// TODO Auto-generated method stub
return false;
}
public boolean canFormatType(byte type) {
// TODO Auto-generated method stub
return false;
}
public void initialize(Map properties) {
// TODO Auto-generated method stub
}
}