IContext

public interface IContext

Interface for a context in which analysis or transformations occurs. Implementors must override hashCode() and equals(Object) using location() and language(), and also implement IContextInternal.

Methods

equals

boolean equals(Object other)

hashCode

int hashCode()

injector

Injector injector()
Returns:Injector to retrieve implementations.

language

ILanguageImpl language()
Returns:Language of this context.

location

FileObject location()
Returns:Location of this context.

persist

void persist()

Persist context data from memory to permanent storing. Acquires a read lock. Can be called while holding the write lock.

Throws:
  • IOException – When persisting fails unexpectedly.

project

IProject project()
Returns:The project that contains the transformed resource.

read

IClosableLock read()

Request read access to this context.

Returns:Closable lock which must be held during reading. Close the lock when done.

reset

void reset()

Resets the state of this context. Acquires a write lock. Cannot be called while holding the read lock.

Throws:
  • IOException – When resetting fails unexpectedly

write

IClosableLock write()

Request write access to this context.

Returns:Closable lock which must be held during writing. Close the lock when done.