*/
private Handler readHandler(TemplateParser parser, String eventName, LayoutElement parent) throws IOException {
String target = null;
String defVal = null;
NameValuePair nvp = null;
HandlerDefinition def = null;
String handlerId = parser.readToken();
// Check locally defined Handler
def = parent.getLayoutDefinition().getHandlerDefinition(handlerId);
if (def == null) {
// Check globally defined Handler
def = LayoutDefinitionManager.getGlobalHandlerDefinition(handlerId);
if (def == null) {
throw new SyntaxException("Handler '" + handlerId
+ "' in event '" + eventName + "' is not declared! "
+ "Ensure the '@Handler' annotation has been defined "
+ "on the handler Java method, that it has been "
+ "compiled with the annotation processing tool, and "
+ "that the resulting"
+ " 'META-INF/jsftemplating/Handler.map' is located "
+ "in your classpath (you may need to do a clean "
+ "build).");
}
}
// Create a Handler
Handler handler = new Handler(def);
// Get the default name
Map inputs = def.getInputDefs();
// FIXME: Allow for HandlerDefs to declare their default input
if (inputs.size() == 1) {
defVal = inputs.keySet().toArray()[0].toString();
}
// Get the outputs so we can see what outputs have been declared
Map outputs = def.getOutputDefs();
// Ensure we have an opening parenthesis
parser.skipCommentsAndWhiteSpace(TemplateParser.SIMPLE_WHITE_SPACE);
int ch = parser.nextChar();
if (ch != '(') {