org.kaazing.robot.lang.ast.builder.AstConnectNodeBuilder Maven / Gradle / Ivy
The newest version!
/*
* Copyright (c) 2014 "Kaazing Corporation," (www.kaazing.com)
*
* This file is part of Robot.
*
* Robot is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
package org.kaazing.robot.lang.ast.builder;
import java.net.URI;
import org.kaazing.robot.lang.ast.AstConnectNode;
import org.kaazing.robot.lang.ast.AstScriptNode;
public final class AstConnectNodeBuilder extends AbstractAstConnectNodeBuilder {
private int line;
public AstConnectNodeBuilder() {
this(new AstConnectNode());
}
@Override
public AstConnectNodeBuilder setLocationInfo(int line, int column) {
node.setLocationInfo(line, column);
internalSetLineInfo(line);
return this;
}
@Override
public AstConnectNodeBuilder setNextLineInfo(int linesToSkip, int column) {
internalSetNextLineInfo(linesToSkip, column);
return this;
}
public AstConnectNodeBuilder setLocation(URI location) {
node.setLocation(location);
return this;
}
@Override
public AstOpenedNodeBuilder.StreamNested addOpenedEvent() {
return new AstOpenedNodeBuilder.StreamNested(this);
}
@Override
public AstBoundNodeBuilder.StreamNested addBoundEvent() {
return new AstBoundNodeBuilder.StreamNested(this);
}
@Override
public AstConnectedNodeBuilder.StreamNested addConnectedEvent() {
return new AstConnectedNodeBuilder.StreamNested(this);
}
@Override
public AstReadNodeBuilder.StreamNested addReadEvent() {
return new AstReadNodeBuilder.StreamNested(this);
}
@Override
public AstDisconnectedNodeBuilder.StreamNested addDisconnectedEvent() {
return new AstDisconnectedNodeBuilder.StreamNested(this);
}
@Override
public AstUnboundNodeBuilder.StreamNested addUnboundEvent() {
return new AstUnboundNodeBuilder.StreamNested(this);
}
@Override
public AstClosedNodeBuilder.StreamNested addClosedEvent() {
return new AstClosedNodeBuilder.StreamNested(this);
}
@Override
public AstWriteNodeBuilder.StreamNested addWriteCommand() {
return new AstWriteNodeBuilder.StreamNested(this);
}
@Override
public AstDisconnectNodeBuilder.StreamNested addDisconnectCommand() {
return new AstDisconnectNodeBuilder.StreamNested(this);
}
@Override
public AstUnbindNodeBuilder.StreamNested addUnbindCommand() {
return new AstUnbindNodeBuilder.StreamNested(this);
}
@Override
public AstCloseNodeBuilder.StreamNested addCloseCommand() {
return new AstCloseNodeBuilder.StreamNested(this);
}
@Override
public AstReadAwaitNodeBuilder.StreamNested addReadAwaitBarrier() {
return new AstReadAwaitNodeBuilder.StreamNested(this);
}
@Override
public AstReadNotifyNodeBuilder.StreamNested addReadNotifyBarrier() {
return new AstReadNotifyNodeBuilder.StreamNested(this);
}
@Override
public AstWriteAwaitNodeBuilder.StreamNested addWriteAwaitBarrier() {
return new AstWriteAwaitNodeBuilder.StreamNested(this);
}
@Override
public AstWriteNotifyNodeBuilder.StreamNested addWriteNotifyBarrier() {
return new AstWriteNotifyNodeBuilder.StreamNested(this);
}
@Override
public AstReadOptionNodeBuilder.StreamNested addReadOption() {
return new AstReadOptionNodeBuilder.StreamNested(this);
}
@Override
public AstWriteOptionNodeBuilder.StreamNested addWriteOption() {
return new AstWriteOptionNodeBuilder.StreamNested(this);
}
@Override
public AstReadConfigNodeBuilder.StreamNested addReadConfigEvent() {
return new AstReadConfigNodeBuilder.StreamNested(this);
}
@Override
public AstWriteConfigNodeBuilder.StreamNested addWriteConfigCommand() {
return new AstWriteConfigNodeBuilder.StreamNested(this);
}
@Override
public AstFlushNodeBuilder.StreamNested addFlushCommand() {
return new AstFlushNodeBuilder.StreamNested(this);
}
@Override
public AstReadClosedNodeBuilder.StreamNested addReadCloseCommand() {
return new AstReadClosedNodeBuilder.StreamNested(this);
}
@Override
public AstWriteCloseNodeBuilder.StreamNested addWriteCloseCommand() {
return new AstWriteCloseNodeBuilder.StreamNested(this);
}
@Override
public AstConnectNode done() {
return result;
}
@Override
protected int line() {
return line;
}
@Override
protected int line(int line) {
this.line = line;
return line;
}
private AstConnectNodeBuilder(AstConnectNode node) {
super(node, node);
}
public static final class ScriptNested> extends
AbstractAstConnectNodeBuilder {
public ScriptNested(R builder) {
super(new AstConnectNode(), builder);
}
@Override
public ScriptNested setLocationInfo(int line, int column) {
node.setLocationInfo(line, column);
internalSetLineInfo(line);
return this;
}
@Override
public ScriptNested setNextLineInfo(int linesToSkip, int column) {
internalSetNextLineInfo(linesToSkip, column);
return this;
}
public ScriptNested setLocation(URI location) {
node.setLocation(location);
return this;
}
@Override
public AstOpenedNodeBuilder.StreamNested> addOpenedEvent() {
return new AstOpenedNodeBuilder.StreamNested>(this);
}
@Override
public AstBoundNodeBuilder.StreamNested> addBoundEvent() {
return new AstBoundNodeBuilder.StreamNested>(this);
}
@Override
public AstConnectedNodeBuilder.StreamNested> addConnectedEvent() {
return new AstConnectedNodeBuilder.StreamNested>(this);
}
@Override
public AstReadNodeBuilder.StreamNested> addReadEvent() {
return new AstReadNodeBuilder.StreamNested>(this);
}
@Override
public AstDisconnectedNodeBuilder.StreamNested> addDisconnectedEvent() {
return new AstDisconnectedNodeBuilder.StreamNested>(this);
}
@Override
public AstUnboundNodeBuilder.StreamNested> addUnboundEvent() {
return new AstUnboundNodeBuilder.StreamNested>(this);
}
@Override
public AstClosedNodeBuilder.StreamNested> addClosedEvent() {
return new AstClosedNodeBuilder.StreamNested>(this);
}
@Override
public AstWriteNodeBuilder.StreamNested> addWriteCommand() {
return new AstWriteNodeBuilder.StreamNested>(this);
}
@Override
public AstDisconnectNodeBuilder.StreamNested> addDisconnectCommand() {
return new AstDisconnectNodeBuilder.StreamNested>(this);
}
@Override
public AstUnbindNodeBuilder.StreamNested> addUnbindCommand() {
return new AstUnbindNodeBuilder.StreamNested>(this);
}
@Override
public AstCloseNodeBuilder.StreamNested> addCloseCommand() {
return new AstCloseNodeBuilder.StreamNested>(this);
}
@Override
public AstReadAwaitNodeBuilder.StreamNested> addReadAwaitBarrier() {
return new AstReadAwaitNodeBuilder.StreamNested>(this);
}
@Override
public AstReadNotifyNodeBuilder.StreamNested> addReadNotifyBarrier() {
return new AstReadNotifyNodeBuilder.StreamNested>(this);
}
@Override
public AstWriteAwaitNodeBuilder.StreamNested> addWriteAwaitBarrier() {
return new AstWriteAwaitNodeBuilder.StreamNested>(this);
}
@Override
public AstWriteNotifyNodeBuilder.StreamNested> addWriteNotifyBarrier() {
return new AstWriteNotifyNodeBuilder.StreamNested>(this);
}
@Override
public AstReadConfigNodeBuilder.StreamNested> addReadConfigEvent() {
return new AstReadConfigNodeBuilder.StreamNested>(this);
}
@Override
public AstWriteConfigNodeBuilder.StreamNested> addWriteConfigCommand() {
return new AstWriteConfigNodeBuilder.StreamNested>(this);
}
@Override
public AstFlushNodeBuilder.StreamNested> addFlushCommand() {
return new AstFlushNodeBuilder.StreamNested>(this);
}
@Override
public AstReadClosedNodeBuilder.StreamNested> addReadCloseCommand() {
return new AstReadClosedNodeBuilder.StreamNested>(this);
}
@Override
public AstWriteCloseNodeBuilder.StreamNested> addWriteCloseCommand() {
return new AstWriteCloseNodeBuilder.StreamNested>(this);
}
@Override
public AstReadOptionNodeBuilder.StreamNested> addReadOption() {
return new AstReadOptionNodeBuilder.StreamNested>(this);
}
@Override
public AstWriteOptionNodeBuilder.StreamNested> addWriteOption() {
return new AstWriteOptionNodeBuilder.StreamNested>(this);
}
@Override
public R done() {
AstScriptNode scriptNode = result.node;
scriptNode.getStreams().add(node);
return result;
}
@Override
protected int line() {
return result.line();
}
@Override
protected int line(int line) {
return result.line(line);
}
}
}