Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.lang.annotation.* (3)java.lang.instrument.* (5)java.lang.ref.* (5)java.lang.reflect.* (23)

java.lang: Javadoc index of package java.lang.


Package Samples:

java.lang.ref: Core classes including wrappers for primitive types, classes, packages and class loaders, representations of the system, processes, threads and the core exception hierarchy.  
java.lang.annotation: Core classes including wrappers for primitive types, classes, packages and class loaders, representations of the system, processes, threads and the core exception hierarchy.  
java.lang.reflect
java.lang.instrument

Classes:

Proxy: This class allows you to dynamically create an instance of any (or even multiple) interfaces by reflection, and decide at runtime how that instance will behave by giving it an appropriate InvocationHandler . Proxy classes serialize specially, so that the proxy object can be reused between VMs, without requiring a persistent copy of the generated class code. Creation To create a proxy for some interface Foo: InvocationHandler handler = new MyInvocationHandler(...); Class proxyClass = Proxy.getProxyClass( Foo.class.getClassLoader(), new Class[] { Foo.class }); Foo f = (Foo) proxyClass .getConstructor(new ...
RuntimePermission: A RuntimePermission contains a permission name, but no actions list. This means you either have the permission or you don't. Permission names have the follow the hierarchial property naming convention. In addition, an asterisk may appear at the end of a name if following a period or by itself. Valid names Invalid names "accessClassInPackage.*","*" "**", "*x", "*.a" The following table provides a list of all the possible RuntimePermission permission names with a description of what that permission allows. Permission Name Permission Allows Risks createClassLoader creation of a class loader a class ...
ClassLoader: The ClassLoader is a way of customizing the way Java gets its classes and loads them into memory. The verifier and other standard Java things still run, but the ClassLoader is allowed great flexibility in determining where to get the classfiles and when to load and resolve them. For that matter, a custom ClassLoader can perform on-the-fly code generation or modification! Every classloader has a parent classloader that is consulted before the 'child' classloader when classes or resources should be loaded. This is done to make sure that classes can be loaded from an hierarchy of multiple classloaders ...
Throwable: Throwable is the superclass of all exceptions that can be raised. There are two special cases: Error and RuntimeException : these two classes (and their subclasses) are considered unchecked exceptions, and are either frequent enough or catastrophic enough that you do not need to declare them in throws clauses. Everything else is a checked exception, and is ususally a subclass of Exception ; these exceptions have to be handled or declared. Instances of this class are usually created with knowledge of the execution context, so that you can get a stack trace of the problem spot in the code. Also, ...
SecurityManager: SecurityManager is a class you can extend to create your own Java security policy. By default, there is no SecurityManager installed in 1.1, which means that all things are permitted to all people. The security manager, if set, is consulted before doing anything with potentially dangerous results, and throws a SecurityException if the action is forbidden. A typical check is as follows, just before the dangerous operation: SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkABC( argument , ...); Note that this is thread-safe, by caching the security manager in a local variable ...
InvocationHandler: This interface defines an invocation handler. Suppose you are using reflection, and found a method that requires that its parameter be an object of a given interface. You want to call this method, but have no idea what classes implement that interface. So, you can create a Proxy instance, a convenient way to dynamically generate a class that meets all the necessary properties of that interface. But in order for the proxy instance to do any good, it needs to know what to do when interface methods are invoked! So, this interface is basically a cool wrapper that provides runtime code generation needed ...
Thread: Thread represents a single thread of execution in the VM. When an application VM starts up, it creates a non-daemon Thread which calls the main() method of a particular class. There may be other Threads running, such as the garbage collection thread. Threads have names to identify them. These names are not necessarily unique. Every Thread has a priority, as well, which tells the VM which Threads should get more running time. New threads inherit the priority and daemon status of the parent thread, by default. There are two methods of creating a Thread: you may subclass Thread and implement the run() ...
Package: Everything you ever wanted to know about a package. This class makes it possible to attach specification and implementation information to a package as explained in the Package Versioning Specification section of the Product Versioning Specification . It also allows packages to be sealed with respect to the originating URL. The most useful method is the isCompatibleWith() method that compares a desired version of a specification with the version of the specification as implemented by a package. A package is considered compatible with another version if the version of the specification is equal ...
Reference: This is the base class of all references. A reference allows refering to an object without preventing the garbage collector to collect it. The only way to get the referred object is via the get() -method. This method will return null if the object was collected. A reference may be registered with a queue. When a referred element gets collected the reference will be put on the queue, so that you will be notified. There are currently three types of references: soft reference, weak reference and phantom reference. Soft references will be cleared if the garbage collector is told to free some memory ...
ThreadLocal: ThreadLocal objects have a different state associated with every Thread that accesses them. Every access to the ThreadLocal object (through the get() and set() methods) only affects the state of the object as seen by the currently executing Thread. The first time a ThreadLocal object is accessed on a particular Thread, the state for that Thread's copy of the local variable is set by executing the method initialValue() . An example how you can use this: class Connection { private static ThreadLocal owner = new ThreadLocal() { public Object initialValue() { return("nobody"); } }; ... } Now all instances ...
Array: Array holds static helper functions that allow you to create and manipulate arrays by reflection. Operations know how to perform widening conversions, but throw java.lang.IllegalArgumentException if you attempt a narrowing conversion. Also, when accessing primitive arrays, this class performs object wrapping and unwrapping as necessary. Note: This class returns and accepts types as Classes, even primitive types; there are Class types defined that represent each different primitive type. They are java.lang.Boolean.TYPE, java.lang.Byte.TYPE, , also available as boolean.class, byte.class , etc. These ...
Cloneable: This interface should be implemented by classes wishing to support of override Object.clone() . The default behaviour of clone() performs a shallow copy, but subclasses often change this to perform a deep copy. Therefore, it is a good idea to document how deep your clone will go. If clone() is called on an object which does not implement this interface, a CloneNotSupportedException will be thrown. This interface is simply a tagging interface; it carries no requirements on methods to implement. However, it is typical for a Cloneable class to implement at least equals , hashCode , and clone , sometimes ...
StringBuilder: StringBuilder represents a changeable String . It provides the operations required to modify the StringBuilder , including insert, replace, delete, append, and reverse. It like StringBuffer , but is not synchronized. It is ideal for use when it is known that the object will only be used from a single thread. StringBuilder s are variable-length in nature, so even if you initialize them to a certain size, they can still grow larger than that. Capacity indicates the number of characters the StringBuilder can have in it before it has to grow (growing the char array is an expensive operation involving ...
Field: The Field class represents a member variable of a class. It also allows dynamic access to a member, via reflection. This works for both static and instance fields. Operations on Field objects know how to do widening conversions, but throw java.lang.IllegalArgumentException if a narrowing conversion would be necessary. You can query for information on this Field regardless of location, but get and set access may be limited by Java language access controls. If you can't do it in the compiler, you can't normally do it here either. Note: This class returns and accepts types as Classes, even primitive ...
Method: The Method class represents a member method of a class. It also allows dynamic invocation, via reflection. This works for both static and instance methods. Invocation on Method objects knows how to do widening conversions, but throws java.lang.IllegalArgumentException if a narrowing conversion would be necessary. You can query for information on this Method regardless of location, but invocation access may be limited by Java language access controls. If you can't do it in the compiler, you can't normally do it here either. Note: This class returns and accepts types as Classes, even primitive types; ...
Constructor: The Constructor class represents a constructor of a class. It also allows dynamic creation of an object, via reflection. Invocation on Constructor objects knows how to do widening conversions, but throws java.lang.IllegalArgumentException if a narrowing conversion would be necessary. You can query for information on this Constructor regardless of location, but construction access may be limited by Java language access controls. If you can't do it in the compiler, you can't normally do it here either. Note: This class returns and accepts types as Classes, even primitive types; there are Class types ...
StringBuffer: StringBuffer represents a changeable String . It provides the operations required to modify the StringBuffer , including insert, replace, delete, append, and reverse. It is thread-safe; meaning that all modifications to a buffer are in synchronized methods. StringBuffer s are variable-length in nature, so even if you initialize them to a certain size, they can still grow larger than that. Capacity indicates the number of characters the StringBuffer can have in it before it has to grow (growing the char array is an expensive operation involving new ). Incidentally, compilers often implement the ...
Comparable: Interface for objects that can be ordering among other objects. The ordering can be total , such that two objects only compare equal if they are also equal by the equals method, or partial such that this is not necessarily true. For example, a case-sensitive dictionary order comparison of Strings is total, but if it is case-insensitive it is partial, because "abc" and "ABC" compare as equal even though "abc".equals("ABC") returns false. However, if you use a partial ordering, it is a good idea to document your class as "inconsistent with equals", because the behavior of your class in a SortedMap ...
String: Strings represent an immutable set of characters. All String literals are instances of this class, and two string literals with the same contents refer to the same String object. This class also includes a number of methods for manipulating the contents of strings (of course, creating a new object if there are any changes, as String is immutable). Case mapping relies on Unicode 3.0.0 standards, where some character sequences have a different number of characters in the uppercase version than the lower case. Strings are special, in that they are the only object with an overloaded operator. When ...
VMThread: VM interface for Thread of executable code. Holds VM dependent state. It is deliberately package local and final and should only be accessed by the Thread class. This is the GNU Classpath reference implementation, it should be adapted for a specific VM. The following methods must be implemented: native void start(long stacksize); native void interrupt(); native boolean isInterrupted(); native void suspend(); native void resume(); native void nativeSetPriority(int priority); native void nativeStop(Throwable t); native static Thread currentThread(); static native void yield(); static native boolean ...
ParameterizedType: Represents a type which is parameterized over one or more other types. For example, List<Integer> is a parameterized type, with List parameterized over the type Integer . Instances of this classes are created as needed, during reflection. On creating a parameterized type, p , the GenericTypeDeclaration corresponding to p is created and resolved. Each type argument of p is then created recursively; details of this process are availble in the documentation of TypeVariable . This creation process only happens once; repetition has no effect. Implementors of this interface must implement an appropriate ...
Class: A Class represents a Java type. There will never be multiple Class objects with identical names and ClassLoaders. Primitive types, array types, and void also have a Class object. Arrays with identical type and number of dimensions share the same class. The array class ClassLoader is the same as the ClassLoader of the element type of the array (which can be null to indicate the bootstrap classloader). The name of an array class is [<signature format>; . For example, String[]'s class is [Ljava.lang.String; . boolean, byte, short, char, int, long, float and double have the "type name" of Z,B,S,C,I,J,F,D ...
Process: An instance of a subclass of Process is created by the Runtime.exec methods. Methods in Process provide a means to send input to a process, obtain the output from a subprocess, destroy a subprocess, obtain the exit value from a subprocess, and wait for a subprocess to complete. This is dependent on the platform, and some processes (like native windowing processes, 16-bit processes in Windows, or shell scripts) may be limited in functionality. Because some platforms have limited buffers between processes, you may need to provide input and read output to prevent the process from blocking, or even ...
WildcardType: Represents a wildcard type expression, where the type variable is unnamed. The simplest example of this is ? , which represents any unbounded type. Another example is ? extends Number , which specifies any type which is a subclass of Number ( Number is the upper bound). ? super String gives the type a less common lower bound, which means that the type must be either a String or one of its superclasses. This can be useful in working with collections. You may want a method to add instances of a class to a collection with a more generic type (e.g. adding String s to a list of Object s), but don't ...
ReflectPermission: This class implements permissions for reflection. This is a named permission, and the only defined name is suppressAccessChecks, which allows suppression of normal Java objects when using reflection. Permission Target Name What Permission Allows Risk of Allowing Permission suppressAccessChecks Ability to access fields, invoke methods, and construct objects via reflection, including non-public members in contexts where such access is not legal at compile-time. This is dangerous. It exposes possibly confidential information, and malicious code could interfere with the internals of the Virtual Machine ...

Home | Contact Us | Privacy Policy | Terms of Service