Package org.jboss.as.cli.parsing

Examples of org.jboss.as.cli.parsing.CharacterHandler


        public static final EqualsState INSTANCE = new EqualsState();

        public EqualsState() {
            super(ID);
            setIgnoreWhitespaces(true);
            setDefaultHandler(new CharacterHandler() {
                @Override
                public void handle(ParsingContext ctx) throws CommandFormatException {
                    ctx.enterState(TextState.INSTANCE);
                }});
            putHandler('>', GlobalCharacterHandlers.NOOP_CHARACTER_HANDLER);
View Full Code Here


            @Override
            protected void doHandle(ParsingContext ctx) throws CommandFormatException {
                ctx.enterState(argList);
            }
        });
        this.setReturnHandler(new CharacterHandler() {
            @Override
            public void handle(ParsingContext ctx) throws CommandFormatException {
                if(ctx.isEndOfContent()) {
                    return;
                }
                final CharacterHandler handler = getHandler(ctx.getCharacter());
                if(handler != null) {
                    handler.handle(ctx);
                }
            }});
        enterState(OutputTargetState.OUTPUT_REDIRECT_CHAR, outputRedirect);
    }
View Full Code Here

    public static final ArgumentValueState INSTANCE = new ArgumentValueState();
    public static final String ID = "PROP_VALUE";

    ArgumentValueState() {
        super(ID);
        this.setEnterHandler(new CharacterHandler() {
            @Override
            public void handle(ParsingContext ctx) throws CommandFormatException {
                if(ctx.getCharacter() != '=') {
                    getHandler(ctx.getCharacter()).handle(ctx);
                }
            }});
        enterState('[', new DefaultStateWithEndCharacter("BRACKETS", ']', false, true, enterStateHandlers));
        enterState('(', new DefaultStateWithEndCharacter("PARENTHESIS", ')', false, true, enterStateHandlers));
        enterState('{', new DefaultStateWithEndCharacter("BRACES", '}', false, true, enterStateHandlers));
        setLeaveOnWhitespace(true);
        if(!Util.isWindows()) {
            // on windows we don't escape, this would mess up file system paths for example.
            setDefaultHandler(WordCharacterHandler.IGNORE_LB_ESCAPE_ON);
            enterState('"', QuotesState.QUOTES_INCLUDED);
        } else {
            setDefaultHandler(WordCharacterHandler.IGNORE_LB_ESCAPE_OFF);
            enterState('"', new QuotesState(true, false));
        }
        setReturnHandler(new CharacterHandler() {
            @Override
            public void handle(ParsingContext ctx) throws CommandFormatException {
                if(ctx.isEndOfContent()) {
                    ctx.leaveState();
                }
View Full Code Here

        super(ID);
        //setDefaultHandler(new EnterStateCharacterHandler(nodeState));
        setDefaultHandler(new LineBreakHandler(false, false){
            @Override
            public void doHandle(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);
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.cli.parsing.CharacterHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.