1 19 20 package org.netbeans.modules.schema2beansdev; 21 22 import java.util.*; 23 import java.io.*; 24 25 public abstract class GeneralParser { 26 protected File filename; 28 protected InputStream schemaIn = null; 31 32 protected Reader reader = null; 34 35 protected String inputURI = null; 38 39 protected void startupReader() throws java.io.IOException { 40 if (schemaIn == null) 41 reader = new FileReader(filename); 42 else 43 reader = new InputStreamReader(schemaIn); 44 } 45 46 protected void shutdownReader() throws java.io.IOException { 47 reader.close(); 48 } 49 50 public void setInputURI(String uri) { 51 inputURI = uri; 52 } 53 54 protected String getReaderURI() { 55 if (inputURI != null) 56 return inputURI; 57 if (filename != null) 58 return filename.toURI().toString(); 59 return schemaIn.toString(); 60 } 61 } 62 | Popular Tags |