net.ontopia.topicmaps.query.parser
Class GlobalParseContext

java.lang.Object
  extended by net.ontopia.topicmaps.query.parser.GlobalParseContext
All Implemented Interfaces:
ParseContextIF

public class GlobalParseContext
extends java.lang.Object
implements ParseContextIF

INTERNAL: Represents the global immutable context of all tolog queries.


Field Summary
 
Fields inherited from interface net.ontopia.topicmaps.query.parser.ParseContextIF
ITEM_IDENTIFIER, MODULE, SUBJECT_IDENTIFIER, SUBJECT_LOCATOR
 
Constructor Summary
GlobalParseContext(PredicateFactoryIF factory, TopicMapIF topicmap)
           
GlobalParseContext(PredicateFactoryIF factory, TopicMapIF topicmap, LocatorIF base)
           
 
Method Summary
 LocatorIF absolutify(java.lang.String uriref)
           
 void addPredicate(PredicateIF predicate)
          INTERNAL: Adds a new predicate to the context.
 void addPrefixBinding(java.lang.String prefix, java.lang.String uri, int qualification)
          INTERNAL: Adds a prefix binding to the context.
 void dump()
          INTERNAL: Used for debugging.
 ModuleIF getModule(java.lang.String uri)
           
 TMObjectIF getObject(QName qname)
           
 TMObjectIF getObjectByIdentifier(java.lang.String id)
           
 TMObjectIF getObjectByItemId(java.lang.String uri)
           
 TMObjectIF getObjectByObjectId(java.lang.String id)
           
 PredicateIF getPredicate(ParsedRule rule)
           
 PredicateIF getPredicate(QName qname, boolean assoc)
          INTERNAL: Returns the named predicate, or null if it does not exist.
 PredicateIF getPredicate(TopicIF topic, boolean assoc)
           
 TopicIF getTopic(QName qname)
          INTERNAL: Interprets the given prefix and localname as a topic, returning null if none is found.
 TopicIF getTopicBySubjectIdentifier(java.lang.String uri)
           
 TopicIF getTopicBySubjectLocator(java.lang.String uri)
           
 TopicMapIF getTopicMap()
          INTERNAL: Returns the topic map being parsed against.
 boolean isBuiltInPredicate(java.lang.String name)
          INTERNAL: Used to find out if the given predicate name is the name of a built-in predicate.
 boolean isLoading(java.lang.String uri)
          INTERNAL: Returns true if the uri is being loaded or has already been loaded.
 LocatorIF resolveQName(QName qname)
          INTERNAL: Returns the full locator for the given QName, or reports an error if the prefix is unbound, or if the prefix is bound to something other than a subject identifier namespace (since this is used for the CTM part of tolog INSERT only).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobalParseContext

public GlobalParseContext(PredicateFactoryIF factory,
                          TopicMapIF topicmap)

GlobalParseContext

public GlobalParseContext(PredicateFactoryIF factory,
                          TopicMapIF topicmap,
                          LocatorIF base)
Method Detail

getTopicMap

public TopicMapIF getTopicMap()
Description copied from interface: ParseContextIF
INTERNAL: Returns the topic map being parsed against.

Specified by:
getTopicMap in interface ParseContextIF

resolveQName

public LocatorIF resolveQName(QName qname)
Description copied from interface: ParseContextIF
INTERNAL: Returns the full locator for the given QName, or reports an error if the prefix is unbound, or if the prefix is bound to something other than a subject identifier namespace (since this is used for the CTM part of tolog INSERT only). FIXME: what exception to throw?

Specified by:
resolveQName in interface ParseContextIF

addPrefixBinding

public void addPrefixBinding(java.lang.String prefix,
                             java.lang.String uri,
                             int qualification)
Description copied from interface: ParseContextIF
INTERNAL: Adds a prefix binding to the context.

Specified by:
addPrefixBinding in interface ParseContextIF
Parameters:
prefix - The prefix whose binding is being defined.
uri - The (possibly relative) URI reference to which the prefix is bound.
qualification - The interpretation of the URI. (Defined using local constants.)

addPredicate

public void addPredicate(PredicateIF predicate)
Description copied from interface: ParseContextIF
INTERNAL: Adds a new predicate to the context.

Specified by:
addPredicate in interface ParseContextIF

absolutify

public LocatorIF absolutify(java.lang.String uriref)
                     throws AntlrWrapException
Specified by:
absolutify in interface ParseContextIF
Throws:
AntlrWrapException

getObjectByIdentifier

public TMObjectIF getObjectByIdentifier(java.lang.String id)

getObjectByObjectId

public TMObjectIF getObjectByObjectId(java.lang.String id)
                               throws AntlrWrapException
Specified by:
getObjectByObjectId in interface ParseContextIF
Throws:
AntlrWrapException

getTopicBySubjectIdentifier

public TopicIF getTopicBySubjectIdentifier(java.lang.String uri)
                                    throws AntlrWrapException
Specified by:
getTopicBySubjectIdentifier in interface ParseContextIF
Throws:
AntlrWrapException

getTopicBySubjectLocator

public TopicIF getTopicBySubjectLocator(java.lang.String uri)
                                 throws AntlrWrapException
Specified by:
getTopicBySubjectLocator in interface ParseContextIF
Throws:
AntlrWrapException

getObjectByItemId

public TMObjectIF getObjectByItemId(java.lang.String uri)
                             throws AntlrWrapException
Specified by:
getObjectByItemId in interface ParseContextIF
Throws:
AntlrWrapException

getObject

public TMObjectIF getObject(QName qname)
                     throws AntlrWrapException
Specified by:
getObject in interface ParseContextIF
Throws:
AntlrWrapException

getTopic

public TopicIF getTopic(QName qname)
                 throws AntlrWrapException
Description copied from interface: ParseContextIF
INTERNAL: Interprets the given prefix and localname as a topic, returning null if none is found.

Specified by:
getTopic in interface ParseContextIF
Throws:
AntlrWrapException

getPredicate

public PredicateIF getPredicate(QName qname,
                                boolean assoc)
                         throws AntlrWrapException
Description copied from interface: ParseContextIF
INTERNAL: Returns the named predicate, or null if it does not exist.

Specified by:
getPredicate in interface ParseContextIF
Throws:
AntlrWrapException

getPredicate

public PredicateIF getPredicate(TopicIF topic,
                                boolean assoc)
Specified by:
getPredicate in interface ParseContextIF

getPredicate

public PredicateIF getPredicate(ParsedRule rule)
Specified by:
getPredicate in interface ParseContextIF

getModule

public ModuleIF getModule(java.lang.String uri)
Specified by:
getModule in interface ParseContextIF

isLoading

public boolean isLoading(java.lang.String uri)
Description copied from interface: ParseContextIF
INTERNAL: Returns true if the uri is being loaded or has already been loaded. This method is used to make sure that there are no infinite recursion when importing modules.

Specified by:
isLoading in interface ParseContextIF

isBuiltInPredicate

public boolean isBuiltInPredicate(java.lang.String name)
Description copied from interface: ParseContextIF
INTERNAL: Used to find out if the given predicate name is the name of a built-in predicate. Needed for error checking, see bug #1082.

Specified by:
isBuiltInPredicate in interface ParseContextIF

dump

public void dump()
Description copied from interface: ParseContextIF
INTERNAL: Used for debugging.

Specified by:
dump in interface ParseContextIF


Copyright © 2000-2012 Ontopia.