public OperationRequestState(final NodeState nodeState, final AddressOperationSeparatorState addrOpSep, final PropertyListState propList,
final HeaderListState headerList, final OutputTargetState outRedirect) {
super(ID);
//setDefaultHandler(new EnterStateCharacterHandler(nodeState));
setDefaultHandler(new CharacterHandler(){
@Override
public void handle(ParsingContext ctx) throws CommandFormatException {
final CharacterHandler handler = enterStateHandlers.getHandler(ctx.getCharacter());
if(handler == null) {
ctx.enterState(nodeState);
} else {
handler.handle(ctx);
}
}});
enterState(':', addrOpSep);
enterState('(', propList);
enterState('{', headerList);
enterState(OutputTargetState.OUTPUT_REDIRECT_CHAR, outRedirect);
setReturnHandler(new CharacterHandler(){
@Override
public void handle(ParsingContext ctx)
throws CommandFormatException {
if(ctx.isEndOfContent()) {
return;
}
CharacterHandler handler = enterStateHandlers.getHandler(ctx.getCharacter());
if(handler != null) {
handler.handle(ctx);
}
}});
setIgnoreWhitespaces(true);
}