1 19 20 package org.netbeans.modules.schema2beans; 21 22 import java.io.*; 23 24 import org.xml.sax.EntityResolver ; 25 import org.xml.sax.InputSource ; 26 27 33 public class NullEntityResolver implements EntityResolver { 34 protected String dummyDTD = ""; 36 protected byte[] buf = dummyDTD.getBytes(); 37 protected static NullEntityResolver theResolver = null; 38 39 private NullEntityResolver() { 40 } 41 42 public static NullEntityResolver newInstance() { 43 if (theResolver == null) 44 theResolver = new NullEntityResolver(); 45 return theResolver; 46 } 47 48 public InputSource resolveEntity(String publicId, String systemId) 49 { 50 ByteArrayInputStream bin = new ByteArrayInputStream(buf); 52 return new InputSource (bin); 53 } 54 } 55 | Popular Tags |