Package net.ontopia.topicmaps.db2tm
Class RelationMapping
java.lang.Object
org.xml.sax.helpers.DefaultHandler
net.ontopia.xml.SAXTracker
net.ontopia.topicmaps.db2tm.RelationMapping
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
INTERNAL: DB2TM relation mapping definition. Container for a set of
relations, entities and fields. The mapping can be instatiated by
calling the static read() methods, which will read its defintion
from an XML file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Fileprotected Stringprotected ExpressionVirtualColumnprotected Entityprotected Fieldprotected Relationprotected Changelogprotected ValueIFprotected final Map<String,DataSourceIF> protected Stringprotected XMLReaderFields inherited from class net.ontopia.xml.SAXTracker
content, keepContentsOf, locator, openElements -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAttribute(AttributesImpl atts, String name, String type, String value) protected voidaddAttribute(AttributesImpl atts, String name, String type, String[] values) voidaddDataSource(String id, DataSourceIF datasource) voidaddRelation(Relation relation) voidclose()voidcompile()voidendElement(String nsuri, String lname, String qname) getDataSource(String id) getName()getRelation(String name) protected static InputSourceprotected StringgetValue(Attributes attrs, String name) protected StringgetValue(Attributes attrs, String name, String _default) protected String[]getValues(Attributes attrs, String name) protected String[]getValues(Attributes attrs, String plural, String singular) protected voidoutputEntities(Relation rel, ContentHandler dh) protected voidoutputField(Field field, ContentHandler dh) protected voidoutputFields(Entity entity, ContentHandler dh) static RelationMappingstatic RelationMappingread(InputStream istream, File basedir) static RelationMappingreadFromClasspath(String resource) voidsetBaseDirectory(File baseDirectory) voidstartElement(String nsuri, String lname, String qname, Attributes attrs) toString()voidvoidprotected voidwrite(ContentHandler dh) Methods inherited from class net.ontopia.xml.SAXTracker
characters, isParent, keepContentsOf, setDocumentLocatorMethods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
reader
-
name
-
commitMode
-
baseDirectory
-
datasources
-
relations
-
iprefixes
-
currel
-
curent
-
curfield
-
curvcol
-
cursync
-
curecol
-
-
Method Details
-
compile
public void compile() -
close
public void close() -
getRelaxNGSchema
- Throws:
IOException
-
getBaseDirectory
-
setBaseDirectory
-
getName
-
getCommitMode
-
getDataSources
-
getDataSource
-
addDataSource
-
getRelations
-
getRelation
-
addRelation
-
getPrefix
-
getQueryDeclarations
-
read
- Throws:
IOException
-
readFromClasspath
- Throws:
IOException
-
read
- Throws:
IOException
-
startElement
public void startElement(String nsuri, String lname, String qname, Attributes attrs) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classSAXTracker- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classSAXTracker- Throws:
SAXException
-
getValue
-
getValue
-
getValues
-
getValues
-
addAttribute
-
addAttribute
-
write
- Throws:
SAXException
-
write
- Throws:
SAXException
-
write
- Throws:
SAXException
-
outputEntities
- Throws:
SAXException
-
outputFields
- Throws:
SAXException
-
outputField
- Throws:
SAXException
-
toString
-