Fix checkstyle violations / Renaming RXTX -> Rxtx

This commit is contained in:
Trustin Lee 2012-01-15 01:08:00 +09:00
parent a3efcaf043
commit b9b2366361
11 changed files with 82 additions and 55 deletions

View File

@ -106,9 +106,6 @@ public class DefaultHttpDataFactory implements HttpDataFactory {
return new MemoryAttribute(name);
}
/* (non-Javadoc)
* @see io.netty.handler.codec.http2.HttpDataFactory#createAttribute(java.lang.String, java.lang.String)
*/
@Override
public Attribute createAttribute(HttpRequest request, String name, String value) {
if (useDisk) {
@ -135,9 +132,6 @@ public class DefaultHttpDataFactory implements HttpDataFactory {
}
}
/* (non-Javadoc)
* @see io.netty.handler.codec.http2.HttpDataFactory#createFileUpload(java.lang.String, java.lang.String, java.lang.String)
*/
@Override
public FileUpload createFileUpload(HttpRequest request, String name, String filename,
String contentType, String contentTransferEncoding, Charset charset,

View File

@ -49,17 +49,11 @@ public class DiskFileUpload extends AbstractDiskHttpData implements FileUpload {
return HttpDataType.FileUpload;
}
/* (non-Javadoc)
* @see io.netty.handler.codec.http2.FileUpload#getFilename()
*/
@Override
public String getFilename() {
return filename;
}
/* (non-Javadoc)
* @see io.netty.handler.codec.http2.FileUpload#setFilename(java.lang.String)
*/
@Override
public void setFilename(String filename) {
if (filename == null) {

View File

@ -114,8 +114,8 @@ public class MemoryFileUpload extends AbstractMemoryHttpData implements FileUplo
@Override
public String toString() {
return HttpPostBodyUtil.CONTENT_DISPOSITION+": "+
HttpPostBodyUtil.FORM_DATA + "; " + HttpPostBodyUtil.NAME+"=\"" + getName() +
return HttpPostBodyUtil.CONTENT_DISPOSITION + ": " +
HttpPostBodyUtil.FORM_DATA + "; " + HttpPostBodyUtil.NAME + "=\"" + getName() +
"\"; " + HttpPostBodyUtil.FILENAME + "=\"" + filename + "\"\r\n" +
HttpHeaders.Names.CONTENT_TYPE + ": " + contentType +
(charset != null? "; " + HttpHeaders.Values.CHARSET + "=" + charset + "\r\n" : "\r\n") +

View File

@ -174,9 +174,6 @@ public class PatternRule implements IpFilterRule, Comparable<Object> {
}
/* (non-Javadoc)
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
@Override
public int compareTo(Object o) {
if (o == null) {

View File

@ -0,0 +1,22 @@
/*
* Copyright 2011 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
/**
* TODO: Replace this package and provide this functionality in the core.
*
* @apiviz.exclude \.channel\.
*/
package io.netty.handler.region;

View File

@ -29,26 +29,26 @@ import io.netty.channel.ChannelSink;
/**
* A channel to a serial device using the RXTX library.
*/
public class RXTXChannel extends AbstractChannel {
public class RRXTXChannel extends AbstractChannel {
RXTXChannel(final Channel parent, final ChannelFactory factory, final ChannelPipeline pipeline,
final ChannelSink sink) {
RRXTXChannel(final Channel parent, final ChannelFactory factory, final ChannelPipeline pipeline,
final ChannelSink sink) {
super(parent, factory, pipeline, sink);
}
@Override
public ChannelConfig getConfig() {
return ((RXTXChannelSink) getPipeline().getSink()).getConfig();
return ((RRXTXChannelSink) getPipeline().getSink()).getConfig();
}
@Override
public boolean isBound() {
return ((RXTXChannelSink) getPipeline().getSink()).isBound();
return ((RRXTXChannelSink) getPipeline().getSink()).isBound();
}
@Override
public boolean isConnected() {
return ((RXTXChannelSink) getPipeline().getSink()).isConnected();
return ((RRXTXChannelSink) getPipeline().getSink()).isConnected();
}
@Override
@ -58,7 +58,7 @@ public class RXTXChannel extends AbstractChannel {
@Override
public SocketAddress getRemoteAddress() {
return ((RXTXChannelSink) getPipeline().getSink()).getRemoteAddress();
return ((RRXTXChannelSink) getPipeline().getSink()).getRemoteAddress();
}
@Override

View File

@ -23,7 +23,7 @@ import io.netty.util.internal.ConversionUtil;
/**
* A configuration class for RXTX device connections.
*/
public class RXTXChannelConfig extends DefaultChannelConfig {
public class RRXTXChannelConfig extends DefaultChannelConfig {
public enum Stopbits {
@ -112,18 +112,18 @@ public class RXTXChannelConfig extends DefaultChannelConfig {
private boolean rts;
private Stopbits stopbits = RXTXChannelConfig.Stopbits.STOPBITS_1;
private Stopbits stopbits = RRXTXChannelConfig.Stopbits.STOPBITS_1;
private Databits databits = RXTXChannelConfig.Databits.DATABITS_8;
private Databits databits = RRXTXChannelConfig.Databits.DATABITS_8;
private Paritybit paritybit = RXTXChannelConfig.Paritybit.NONE;
private Paritybit paritybit = RRXTXChannelConfig.Paritybit.NONE;
public RXTXChannelConfig() {
public RRXTXChannelConfig() {
// work with defaults ...
}
public RXTXChannelConfig(final int baudrate, final boolean dtr, final boolean rts, final Stopbits stopbits,
final Databits databits, final Paritybit paritybit) {
public RRXTXChannelConfig(final int baudrate, final boolean dtr, final boolean rts, final Stopbits stopbits,
final Databits databits, final Paritybit paritybit) {
this.baudrate = baudrate;
this.dtr = dtr;
this.rts = rts;

View File

@ -27,22 +27,22 @@ import io.netty.channel.group.DefaultChannelGroup;
import io.netty.util.internal.ExecutorUtil;
/**
* A {@link ChannelFactory} for creating {@link RXTXChannel} instances.
* A {@link ChannelFactory} for creating {@link RRXTXChannel} instances.
*/
public class RXTXChannelFactory implements ChannelFactory {
public class RRXTXChannelFactory implements ChannelFactory {
private final ChannelGroup channels = new DefaultChannelGroup("RXTXChannelFactory-ChannelGroup");
private final ExecutorService executor;
public RXTXChannelFactory(ExecutorService executor) {
public RRXTXChannelFactory(ExecutorService executor) {
this.executor = executor;
}
@Override
public Channel newChannel(final ChannelPipeline pipeline) {
RXTXChannelSink sink = new RXTXChannelSink(executor);
RXTXChannel channel = new RXTXChannel(null, this, pipeline, sink);
RRXTXChannelSink sink = new RRXTXChannelSink(executor);
RRXTXChannel channel = new RRXTXChannel(null, this, pipeline, sink);
sink.setChannel(channel);
channels.add(channel);
return channel;

View File

@ -48,17 +48,17 @@ import io.netty.channel.UpstreamMessageEvent;
/**
* A {@link ChannelSink} implementation of the RXTX support for Netty.
*/
public class RXTXChannelSink extends AbstractChannelSink {
public class RRXTXChannelSink extends AbstractChannelSink {
private static class WriteRunnable implements Runnable {
private final DefaultChannelFuture future;
private final RXTXChannelSink channelSink;
private final RRXTXChannelSink channelSink;
private final ChannelBuffer message;
public WriteRunnable(final DefaultChannelFuture future, final RXTXChannelSink channelSink,
public WriteRunnable(final DefaultChannelFuture future, final RRXTXChannelSink channelSink,
final ChannelBuffer message) {
this.future = future;
this.channelSink = channelSink;
@ -83,9 +83,9 @@ public class RXTXChannelSink extends AbstractChannelSink {
private final DefaultChannelFuture channelFuture;
private final RXTXChannelSink channelSink;
private final RRXTXChannelSink channelSink;
ConnectRunnable(final DefaultChannelFuture channelFuture, final RXTXChannelSink channelSink) {
ConnectRunnable(final DefaultChannelFuture channelFuture, final RRXTXChannelSink channelSink) {
this.channelFuture = channelFuture;
this.channelSink = channelSink;
}
@ -145,9 +145,9 @@ public class RXTXChannelSink extends AbstractChannelSink {
private final DefaultChannelFuture channelFuture;
private final RXTXChannelSink channelSink;
private final RRXTXChannelSink channelSink;
public DisconnectRunnable(final DefaultChannelFuture channelFuture, final RXTXChannelSink channelSink) {
public DisconnectRunnable(final DefaultChannelFuture channelFuture, final RRXTXChannelSink channelSink) {
this.channelFuture = channelFuture;
this.channelSink = channelSink;
}
@ -203,20 +203,20 @@ public class RXTXChannelSink extends AbstractChannelSink {
private final Executor executor;
final RXTXChannelConfig config;
final RRXTXChannelConfig config;
RXTXChannel channel;
RRXTXChannel channel;
public RXTXChannelSink(final Executor executor) {
public RRXTXChannelSink(final Executor executor) {
this.executor = executor;
config = new RXTXChannelConfig();
config = new RRXTXChannelConfig();
}
public boolean isConnected() {
return inputStream != null && outputStream != null;
}
public RXTXDeviceAddress getRemoteAddress() {
public RRXTXDeviceAddress getRemoteAddress() {
return remoteAddress;
}
@ -228,15 +228,15 @@ public class RXTXChannelSink extends AbstractChannelSink {
return config;
}
public void setChannel(final RXTXChannel channel) {
public void setChannel(final RRXTXChannel channel) {
this.channel = channel;
}
private static class RXTXSerialPortEventListener implements SerialPortEventListener {
private final RXTXChannelSink channelSink;
private final RRXTXChannelSink channelSink;
public RXTXSerialPortEventListener(final RXTXChannelSink channelSink) {
public RXTXSerialPortEventListener(final RRXTXChannelSink channelSink) {
this.channelSink = channelSink;
}
@ -268,7 +268,7 @@ public class RXTXChannelSink extends AbstractChannelSink {
}
}
RXTXDeviceAddress remoteAddress;
RRXTXDeviceAddress remoteAddress;
BufferedOutputStream outputStream;
@ -302,7 +302,7 @@ public class RXTXChannelSink extends AbstractChannelSink {
case CONNECTED:
if (value != null) {
remoteAddress = (RXTXDeviceAddress) value;
remoteAddress = (RRXTXDeviceAddress) value;
executor.execute(new ConnectRunnable((DefaultChannelFuture) future, this));
} else {
executor.execute(new DisconnectRunnable((DefaultChannelFuture) future, this));

View File

@ -21,7 +21,7 @@ import java.net.SocketAddress;
* A {@link SocketAddress} subclass to wrap the serial port address of a RXTX
* device (e.g. COM1, /dev/ttyUSB0).
*/
public class RXTXDeviceAddress extends SocketAddress {
public class RRXTXDeviceAddress extends SocketAddress {
private static final long serialVersionUID = -2907820090993709523L;
@ -31,7 +31,7 @@ public class RXTXDeviceAddress extends SocketAddress {
*
* @param deviceAddress the address of the device (e.g. COM1, /dev/ttyUSB0, ...)
*/
public RXTXDeviceAddress(String deviceAddress) {
public RRXTXDeviceAddress(String deviceAddress) {
this.deviceAddress = deviceAddress;
}

View File

@ -0,0 +1,20 @@
/*
* Copyright 2011 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
/**
* A serial and parallel port communication transport based on <a href="http://rxtx.qbang.org/">RXTX</a>.
*/
package io.netty.channel.rxtx;