Package org.jboss.as.cli.parsing

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


        setDefaultHandler(new LineBreakHandler(false, false){
            protected void doHandle(ParsingContext ctx) throws CommandFormatException {
                ctx.enterState(headerState);
            }
        });
        setReturnHandler(new CharacterHandler(){
            @Override
            public void handle(ParsingContext ctx) throws CommandFormatException {
                if(ctx.getCharacter() == '}') {
                    GlobalCharacterHandlers.LEAVE_STATE_HANDLER.handle(ctx);
                }
View Full Code Here


        this(',', ')');
    }

    PropertyValueState(char propSeparator, char... listEnd) {
        super(ID);
        this.setEnterHandler(new CharacterHandler() {
            @Override
            public void handle(ParsingContext ctx) throws CommandFormatException {
                getHandler(ctx.getCharacter()).handle(ctx);
            }});
        putHandler(propSeparator, GlobalCharacterHandlers.LEAVE_STATE_HANDLER);
View Full Code Here

    public static final NodeState INSTANCE = new NodeState();

    public NodeState() {
        super(ID);

        setEnterHandler(new CharacterHandler(){

            @Override
            public void handle(ParsingContext ctx)
                    throws CommandFormatException {
                if(ctx.getCharacter() == '/') {
                    ctx.leaveState();
                } else {
                    getHandler(ctx.getCharacter()).handle(ctx);
                }
            }});

        setIgnoreWhitespaces(true);
        setDefaultHandler(WordCharacterHandler.IGNORE_LB_ESCAPE_ON);

        putHandler('=', new CharacterHandler(){
            @Override
            public void handle(ParsingContext ctx)
                    throws CommandFormatException {
                ctx.leaveState();
            }});

        putHandler('/', new CharacterHandler(){
            @Override
            public void handle(ParsingContext ctx)
                    throws CommandFormatException {
                ctx.leaveState();
            }});
View Full Code Here

        putHandler('}', GlobalCharacterHandlers.LEAVE_STATE_HANDLER);
        enterState('"', QuotesState.QUOTES_INCLUDED);
        enterState('[', new DefaultStateWithEndCharacter("BRACKETS", ']', true, true, enterStateHandlers));
        enterState('(', new DefaultStateWithEndCharacter("PARENTHESIS", ')', true, true, enterStateHandlers));
        enterState('{', new DefaultStateWithEndCharacter("BRACES", '}', true, true, enterStateHandlers));
        setEnterHandler(new CharacterHandler(){
            @Override
            public void handle(ParsingContext ctx) throws CommandFormatException {
                if(ctx.getCharacter() != '=') {
                    ctx.getCallbackHandler().character(ctx);
                }
View Full Code Here

    public static final String ID = "LIST";

    public ListState(final ArgumentValueState value) {
        super(ID);
        setEnterHandler(new CharacterHandler(){
            @Override
            public void handle(ParsingContext ctx) throws CommandFormatException {
                if(ctx.getCharacter() != '[') {
                    ctx.enterState(value);
                }
            }});
        setDefaultHandler(new LineBreakHandler(false, false){
            @Override
            protected void doHandle(ParsingContext ctx) throws CommandFormatException {
                ctx.enterState(value);
            }
        });
        setIgnoreWhitespaces(true);
        enterState(',', ListItemSeparatorState.INSTANCE);
        leaveState(']');
        setReturnHandler(new CharacterHandler(){
            @Override
            public void handle(ParsingContext ctx) throws CommandFormatException {
                if(ctx.isEndOfContent()) {
                    return;
                }
View Full Code Here

        putHandler(';', GlobalCharacterHandlers.LEAVE_STATE_HANDLER);
        putHandler('}', GlobalCharacterHandlers.LEAVE_STATE_HANDLER);
        final NameValueSeparatorState nameValueSep = new NameValueSeparatorState(headerValue);
        enterState('=', nameValueSep);
        setDefaultHandler(new EnterStateCharacterHandler(headerValue));
        setReturnHandler(new CharacterHandler(){
            @Override
            public void handle(ParsingContext ctx) throws CommandFormatException {
                if(ctx.isEndOfContent()) {
                    return;
                }
View Full Code Here

    PropertyListState(final char listStart, char propSeparator, final PropertyState propState, final char... listEnd) {
        super(ID);
        for(int i = 0; i < listEnd.length; ++i) {
            putHandler(listEnd[i], GlobalCharacterHandlers.LEAVE_STATE_HANDLER);
        }
        setEnterHandler(new CharacterHandler(){
            @Override
            public void handle(ParsingContext ctx) throws CommandFormatException {
                if(ctx.getCharacter() != listStart) {
                    ctx.enterState(propState);
                }
            }});
        setDefaultHandler(new LineBreakHandler(false, false){
            @Override
            protected void doHandle(ParsingContext ctx) throws CommandFormatException {
                ctx.enterState(propState);
            }
        });
        putHandler(propSeparator, GlobalCharacterHandlers.NOOP_CHARACTER_HANDLER);
        setReturnHandler(new CharacterHandler(){
            @Override
            public void handle(ParsingContext ctx) throws CommandFormatException {
                if(ctx.isEndOfContent()) {
                    return;
                }
View Full Code Here

        this(',', ')');
    }

    PropertyValueState(char propSeparator, char... listEnd) {
        super(ID);
        this.setEnterHandler(new CharacterHandler() {
            @Override
            public void handle(ParsingContext ctx) throws CommandFormatException {
                getHandler(ctx.getCharacter()).handle(ctx);
            }});
        putHandler(propSeparator, GlobalCharacterHandlers.LEAVE_STATE_HANDLER);
View Full Code Here

        this(propSeparator, new PropertyValueState(propSeparator, listEnd), listEnd);
    }

    PropertyState(char propSeparator, PropertyValueState valueState, char...listEnd) {
        super(ID);
        setEnterHandler(new CharacterHandler(){
            @Override
            public void handle(ParsingContext ctx) throws CommandFormatException {
                if(ctx.getCharacter() == '\\') {
                    ctx.enterState(EscapeCharacterState.INSTANCE);
                } else {
                    ctx.getCallbackHandler().character(ctx);
                }
            }});
        for(int i = 0; i < listEnd.length; ++i) {
            putHandler(listEnd[i], GlobalCharacterHandlers.LEAVE_STATE_HANDLER);
        }
        enterState('=', new NameValueSeparatorState(valueState));
        enterState('\\', EscapeCharacterState.INSTANCE);
        setDefaultHandler(GlobalCharacterHandlers.CONTENT_CHARACTER_HANDLER);
        setReturnHandler(new CharacterHandler() {
            @Override
            public void handle(ParsingContext ctx) throws CommandFormatException {
                if(ctx.isEndOfContent()) {
                    ctx.leaveState();
                    return;
View Full Code Here

    public static final String ID = "OP_NAME";
    public static final OperationNameState INSTANCE = new OperationNameState();

    public OperationNameState() {
        super(ID);
        setEnterHandler(new CharacterHandler(){
            @Override
            public void handle(ParsingContext ctx) throws CommandFormatException {
                if(ctx.getCharacter() == '\\') {
                    ctx.enterState(EscapeCharacterState.INSTANCE);
                } else {
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.