1 22 23 package org.xquark.mapper.storage; 24 25 import org.w3c.dom.Document ; 26 import org.xml.sax.*; 27 import org.xml.sax.ext.LexicalHandler ; 28 import org.xquark.xml.xdbc.*; 29 30 33 public class XDBCFilerAdapter extends XDBCMapperAdapter 34 implements XMLDocumentFiler 35 { 36 private static final String RCSRevision = "$Revision: 1.1 $"; 37 private static final String RCSName = "$Name: $"; 38 private CollectionFiler filer; 39 40 public XDBCFilerAdapter(ContentHandler contentHandler, LexicalHandler lexicalHandler, 41 ErrorHandler errorHandler, CollectionFiler filer) 42 { 43 super(contentHandler, lexicalHandler, errorHandler, filer); 44 this.filer = filer; 45 } 46 47 51 public XMLDocument insertDocument(InputSource input, String id) 52 throws XMLDBCException, SAXException 53 { 54 setDocumentId(id); 55 return insertDocument(input); 56 } 57 58 public XMLDocument insertDocument(XMLReader parser, InputSource input, String id) 59 throws XMLDBCException, SAXException 60 { 61 setDocumentId(id); 62 return insertDocument(parser, input); 63 } 64 65 public XMLDocument insertDocument(String doc, String id) 66 throws XMLDBCException, org.xml.sax.SAXException 67 { 68 setDocumentId(id); 69 return insertDocument(doc); 70 } 71 72 public XMLDocument insertDocument(Document doc, String id) 73 throws XMLDBCException 74 { 75 setDocumentId(id); 76 return insertDocument(doc); 77 } 78 79 80 public XMLDocument insertDocument(InputSource input) 81 throws XMLDBCException, SAXException 82 { 83 insertXMLDocument(input); 84 return filer.getCollection().getDocument(filer.getDocumentId()); 85 } 86 87 public XMLDocument insertDocument(XMLReader parser, InputSource input) 88 throws XMLDBCException, SAXException 89 { 90 insertXMLDocument(parser, input); 91 return filer.getCollection().getDocument(filer.getDocumentId()); 92 } 93 94 public XMLDocument insertDocument(String doc) 95 throws XMLDBCException, SAXException 96 { 97 insertXMLDocument(doc); 98 return filer.getCollection().getDocument(filer.getDocumentId()); 99 } 100 101 public XMLDocument insertDocument(Document document) throws XMLDBCException 102 { 103 insertXMLDocument(document); 104 return filer.getCollection().getDocument(filer.getDocumentId()); 105 } 106 107 public void setDocumentId(String id) throws XMLDBCException 108 { 109 filer.setDocumentId(id); 110 } 111 112 public XMLCollection getCollection() 113 { 114 return filer.getCollection(); 115 } 116 117 public String getDocumentId() 118 { 119 return filer.getDocumentId(); 120 } 121 122 public String [] getFeatureList() 123 { 124 return filer.getXMLFeatureList(); 125 } 126 127 public String [] getPropertyList() 128 { 129 return filer.getXMLPropertyList(); 130 } 131 132 public boolean getFeature(String featureId) throws XMLDBCNotRecognizedException 133 { 134 return filer.getXMLFeature(featureId); 135 } 136 137 public void setFeature(String featureId, boolean state) throws XMLDBCNotRecognizedException, XMLDBCNotSupportedException 138 { 139 filer.setXMLFeature(featureId, state); 140 } 141 142 public Object getProperty(String propertyId) throws XMLDBCNotRecognizedException 143 { 144 return filer.getXMLProperty(propertyId); 145 } 146 147 public void setProperty(String propertyId, Object value) throws XMLDBCNotRecognizedException, XMLDBCNotSupportedException 148 { 149 filer.setXMLProperty(propertyId, value); 150 } 151 } 152 | Popular Tags |