Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| GNU Prolog for Java
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## gnu.prolog.database
Class PrologTextLoaderState

    java.lang.Object
      gnu.prolog.database.PrologTextLoaderState

All Implemented Interfaces:
  PrologTextLoaderListener, HasEnvironment

    public class PrologTextLoaderState

extends Object
implements PrologTextLoaderListener, HasEnvironment

Field Summary
`protected CharConversionTable` | `convTable`
`protected Predicate` | `currentPredicate`
`protected List<PrologTextLoaderError>` | `errorList`
`protected static CompoundTermTag` | `fileTag`
`protected List<PrologTextLoaderListener>` | `listeners`
`protected Set<String>` | `loadedFiles`
`protected Module` | `module`
`protected Map<Predicate,Map<String,Set<PrologTextLoader>>>` | `predicate2options2loaders`
`protected static CompoundTermTag` | `resourceTag`
`protected static CompoundTermTag` | `urlTag`

Constructor Summary
`PrologTextLoaderState(Environment env)`

Method Summary
`void` | `addClause(PrologTextLoader loader, Term term)`
`void` | `addInitialization(PrologTextLoader loader, Term term)`
`boolean` | `addPrologTextLoaderListener(PrologTextLoaderListener listener)`
`void` | `afterIncludeFile(PrologTextLoader loader)` Called right after an include file has been processed and before the loader returns to the previous file.
`void` | `afterProcessFile(PrologTextLoader loader)` Called right after the file has been processed
`void` | `beforeIncludeFile(PrologTextLoader loader, Term argument)` Called before an include file is being processed.
`void` | `beforeProcessFile(PrologTextLoader loader)` Called right before the file is being processed
`void` | `declareDiscontiguous(PrologTextLoader loader, CompoundTermTag tag)`
`boolean` | `declareDynamic(PrologTextLoader loader, CompoundTermTag tag)`
`void` | `declareMultifile(PrologTextLoader loader, CompoundTermTag tag)`
`void` | `defineExternal(PrologTextLoader loader, CompoundTerm pi, String javaClassName, Predicate.TYPE type)`
`protected void` | `defineOption(PrologTextLoader loader, Predicate p, String option)`
`protected void` | `defineOptionAndDeclare(PrologTextLoader loader, Predicate p, String option)`
`void` | `ensureLoaded(Term term)`
`protected Predicate` | `findOrCreatePredicate(CompoundTermTag tag)`
`CharConversionTable` | `getConversionTable()`
`Environment` | `getEnvironment()`
`List<PrologTextLoaderError>` | `getErrors()`
`protected String` | `getInputName(Term term)`
`protected InputStream` | `getInputStream(Term term)`
`Module` | `getModule()`
`protected boolean` | `isDeclaredInOtherLoaders(PrologTextLoader loader, Predicate p)`
`void` | `logError(PrologTextLoaderError partialError, String message)` To be used for errors during initialisation
`void` | `logError(PrologTextLoader loader, ParseException ex)`
`void` | `logError(PrologTextLoader loader, String message)`
`boolean` | `removePrologTextLoaderListener(PrologTextLoaderListener listener)`
`protected File` | `resolveInputFile(String filename)` Resolve the input filename.
`protected boolean` | `testOption(PrologTextLoader loader, Predicate p, String option)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### module

    protected Module module

### predicate2options2loaders

    protected Map<Predicate,Map<String,Set<PrologTextLoader>>> predicate2options2loaders

### currentPredicate

    protected Predicate currentPredicate

### errorList

    protected List<PrologTextLoaderError> errorList

### loadedFiles

    protected Set<String> loadedFiles

### convTable

    protected CharConversionTable convTable

### listeners

    protected List<PrologTextLoaderListener> listeners

### resourceTag

    protected static final CompoundTermTag resourceTag

### urlTag

    protected static final CompoundTermTag urlTag

### fileTag

    protected static final CompoundTermTag fileTag

Constructor Detail

### PrologTextLoaderState

    public PrologTextLoaderState(Environment env)

Method Detail

### getEnvironment

    public Environment getEnvironment()

  Specified by:
    `getEnvironment` in interface `HasEnvironment`

### getErrors

    public List<PrologTextLoaderError> getErrors()

### getModule

    public Module getModule()

### getConversionTable

    public CharConversionTable getConversionTable()

  Returns:
    the convTable

### testOption

    protected boolean testOption(PrologTextLoader loader,
                                 Predicate p,
                                 String option)

### defineOption

    protected void defineOption(PrologTextLoader loader,
                                Predicate p,
                                String option)

### defineOptionAndDeclare

    protected void defineOptionAndDeclare(PrologTextLoader loader,
                                          Predicate p,
                                          String option)

### isDeclaredInOtherLoaders

    protected boolean isDeclaredInOtherLoaders(PrologTextLoader loader,
                                               Predicate p)

### declareDynamic

    public boolean declareDynamic(PrologTextLoader loader,
                                  CompoundTermTag tag)

### declareMultifile

    public void declareMultifile(PrologTextLoader loader,
                                 CompoundTermTag tag)

### declareDiscontiguous

    public void declareDiscontiguous(PrologTextLoader loader,
                                     CompoundTermTag tag)

### addClause

    public void addClause(PrologTextLoader loader,
                          Term term)

### defineExternal

    public void defineExternal(PrologTextLoader loader,
                               CompoundTerm pi,
                               String javaClassName,
                               Predicate.TYPE type)

### findOrCreatePredicate

    protected Predicate findOrCreatePredicate(CompoundTermTag tag)

### logError

    public void logError(PrologTextLoader loader,
                         ParseException ex)

### logError

    public void logError(PrologTextLoader loader,
                         String message)

### logError

    public void logError(PrologTextLoaderError partialError,
                         String message)

  To be used for errors during initialisation

  Parameters:
    `partialError` - the partially filled in error (missing message)
    `message` - the message to add
  See Also:
    `logError(PrologTextLoader,String)`, `Environment.runInitialization(Interpreter)`

### addInitialization

    public void addInitialization(PrologTextLoader loader,
                                  Term term)

### ensureLoaded

    public void ensureLoaded(Term term)

### resolveInputFile

    protected File resolveInputFile(String filename)

  Resolve the input filename. Will add a .pl or .pro when needed.

  Parameters:
    `filename` -
  Returns:
    the file object resolved from the filename

### getInputName

    protected String getInputName(Term term)

### getInputStream

    protected InputStream getInputStream(Term term)
                                  throws IOException

  Throws:
    `IOException`

### addPrologTextLoaderListener

    public boolean addPrologTextLoaderListener(PrologTextLoaderListener listener)

### removePrologTextLoaderListener

    public boolean removePrologTextLoaderListener(PrologTextLoaderListener listener)

### afterIncludeFile

    public void afterIncludeFile(PrologTextLoader loader)

  Description copied from interface: `PrologTextLoaderListener`
  Called right after an include file has been processed and before the loader returns to the previous file.

  Specified by:
    `afterIncludeFile` in interface `PrologTextLoaderListener`

### afterProcessFile

    public void afterProcessFile(PrologTextLoader loader)

  Description copied from interface: `PrologTextLoaderListener`
  Called right after the file has been processed

  Specified by:
    `afterProcessFile` in interface `PrologTextLoaderListener`

### beforeIncludeFile

    public void beforeIncludeFile(PrologTextLoader loader,
                                  Term argument)

  Description copied from interface: `PrologTextLoaderListener`
  Called before an include file is being processed. The loader's currentFile fields have not been updated yet.

  Specified by:
    `beforeIncludeFile` in interface `PrologTextLoaderListener`
    `argument` - The argument passed to the include directive

### beforeProcessFile

    public void beforeProcessFile(PrologTextLoader loader)

  Description copied from interface: `PrologTextLoaderListener`
  Called right before the file is being processed

  Specified by:
    `beforeProcessFile` in interface `PrologTextLoaderListener`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| GNU Prolog for Java
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD