org.netbeans.modules.refactoring.api 1.26.0 1

org.netbeans.modules.refactoring.api
Class Context

java.lang.Object
  extended by org.openide.util.Lookup
      extended by org.netbeans.modules.refactoring.api.Context

public final class Context
extends Lookup

Context contains "environment" in which the refactoring was invoked. For example, Java refactoring might put instance of ClasspathInfo here

The context acts as a Map<Class,Object> keyed off the concrete implementation class of the "values".

See Also:
AbstractRefactoring

Nested Class Summary
 
Nested classes/interfaces inherited from class org.openide.util.Lookup
Lookup.Item<T>, Lookup.Provider, Lookup.Result<T>, Lookup.Template<T>
 
Field Summary
 
Fields inherited from class org.openide.util.Lookup
EMPTY
 
Method Summary
 void add(Object value)
          Adds value instance into this context.
<T> T
lookup(Class<T> clazz)
           
<T> Lookup.Result<T>
lookup(Lookup.Template<T> template)
           
 void remove(Class<?> clazz)
          Removes instance from this context.
 
Methods inherited from class org.openide.util.Lookup
getDefault, lookupAll, lookupItem, lookupResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

add

public void add(@NonNull
                Object value)
Adds value instance into this context. For example, Java impl. puts instance of ClasspathInfo here. If there is an instance already set for this context, old value is replaced by new one.

Parameters:
value - the instance the add

remove

public void remove(@NonNull
                   Class<?> clazz)
Removes instance from this context.

Parameters:
clazz - the class to remove the instance of
Since:
1.24

lookup

public <T> T lookup(Class<T> clazz)
Specified by:
lookup in class Lookup

lookup

public <T> Lookup.Result<T> lookup(Lookup.Template<T> template)
Specified by:
lookup in class Lookup

org.netbeans.modules.refactoring.api 1.26.0 1

Built on May 25 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.