Added missing JavaDoc for the classes in org.jboss.netty.util

This commit is contained in:
Trustin Lee 2008-09-01 09:41:33 +00:00
parent e11e0f7ed5
commit e5f88b536b
3 changed files with 37 additions and 1 deletions

View File

@ -33,16 +33,21 @@ import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
/**
* A set of utility methods related with a {@link Map}.
*
* @author The Netty Project (netty-dev@lists.jboss.org)
* @author Trustin Lee (tlee@redhat.com)
*
* @version $Rev$, $Date$
*
*/
public class MapUtil {
private static final InternalLogger logger =
InternalLoggerFactory.getInstance(MapUtil.class);
/**
* Returns {@code true} if and only if the specified {@code map} is an
* ordered map, like {@link LinkedHashMap} is.
*/
@SuppressWarnings("unchecked")
public static boolean isOrderedMap(Map<?, ?> map) {
Class<?> mapType = map.getClass();

View File

@ -26,7 +26,14 @@ import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
import org.jboss.netty.channel.DefaultChannelPipeline;
import org.jboss.netty.channel.SimpleChannelHandler;
/**
* Simplifies an exception stack trace by removing unnecessary
* {@link StackTraceElement}s. Please note that the stack trace simplification
* is disabled if {@linkplain DebugUtil debug mode} is turned on.
*
* @author The Netty Project (netty-dev@lists.jboss.org)
* @author Trustin Lee (tlee@redhat.com)
*
@ -42,6 +49,11 @@ public class StackTraceSimplifier {
"(util\\.(ThreadRenamingRunnable)" +
"|channel\\.(SimpleChannelHandler|DefaultChannelPipeline.*))$");
/**
* Removes unnecessary {@link StackTraceElement}s from the specified
* exception. {@link ThreadRenamingRunnable}, {@link SimpleChannelHandler},
* and {@link DefaultChannelPipeline} will be dropped from the trace.
*/
public static void simplify(Throwable e) {
if (!SIMPLIFY_STACK_TRACE) {
return;

View File

@ -23,6 +23,8 @@
package org.jboss.netty.util;
/**
* Accesses the system property swallowing a {@link SecurityException}.
*
* @author The Netty Project (netty-dev@lists.jboss.org)
* @author Trustin Lee (tlee@redhat.com)
*
@ -31,6 +33,14 @@ package org.jboss.netty.util;
*/
public class SystemPropertyUtil {
/**
* Returns the value of the Java system property with the specified
* {@code key}.
*
* @return the property value.
* {@code null} if there's no such property or if an access to the
* specified property is not allowed.
*/
public static String get(String key) {
try {
return System.getProperty(key);
@ -39,6 +49,15 @@ public class SystemPropertyUtil {
}
}
/**
* Returns the value of the Java system property with the specified
* {@code key}, while falling back to the specified default value if
* the property access fails.
*
* @return the property value.
* {@code def} if there's no such property or if an access to the
* specified property is not allowed.
*/
public static String get(String key, String def) {
String value = get(key);
if (value == null) {