1 23 24 package org.enhydra.xml.xmlc.commands.xmlc; 25 26 import java.io.File ; 27 import java.io.IOException ; 28 29 import org.enhydra.xml.io.ErrorReporter; 30 import org.enhydra.xml.xmlc.XMLCException; 31 import org.enhydra.xml.xmlc.metadata.MetaData; 32 33 37 public class XMLCOptions extends XMLCOptionsParser { 38 41 public void setSourceDocument(File sourceDocument) { 42 getMetaData().getInputDocument().setUrl(sourceDocument.getPath()); 43 } 44 45 48 public String getClassName() { 49 return getMetaData().getDocumentClass().getName(); 50 } 51 52 55 public void setClassName(String className) { 56 getMetaData().getDocumentClass().setName(className); 57 } 58 59 62 public boolean getForRecomp() { 63 return getMetaData().getDocumentClass().getRecompilation(); 64 } 65 66 69 public String getPackageName() { 70 return getMetaData().getDocumentClass().getPackageName(); 71 } 72 73 78 public void complete() throws XMLCException { 79 } 82 83 86 public MetaData getMetaData() { 87 return null; } 89 90 93 public void parse(String [] parameters, 94 String [] optionsFiles, 95 ErrorReporter errorReporter) throws XMLCException, IOException { 96 String [] args = new String [parameters.length + optionsFiles.length]; 98 System.arraycopy(parameters, 0, args, 0, parameters.length); 99 System.arraycopy(optionsFiles, 0, args, parameters.length, 100 optionsFiles.length); 101 super.parse(args, errorReporter); 102 } 103 105 public void setKeep(boolean keep) { 106 getMetaData().getCompileOptions().setKeepGeneratedSource(keep); 107 } 108 109 public boolean getKeep() { 110 return getMetaData().getCompileOptions().getKeepGeneratedSource(); 111 } 112 113 public void setDump(boolean dump) { 114 getMetaData().getCompileOptions().setPrintDOM(dump); 115 } 116 117 public boolean getDump() { 118 return getMetaData().getCompileOptions().getPrintDOM(); 119 } 120 121 public void setVerbose(boolean verbose) { 122 getMetaData().getCompileOptions().setVerbose(verbose); 123 } 124 125 public boolean getVerbose() { 126 return getMetaData().getCompileOptions().getVerbose(); 127 } 128 129 public void setParseInfo(boolean parseInfo) { 130 getMetaData().getCompileOptions().setPrintParseInfo(parseInfo); 131 } 132 133 public boolean getParseInfo() { 134 return getMetaData().getCompileOptions().getPrintParseInfo(); 135 } 136 137 public void setPrintAccessMethods(boolean printAccessMethods) { 138 getMetaData().getCompileOptions().setPrintAccessorInfo(printAccessMethods); 139 } 140 141 public boolean getPrintAccessMethods() { 142 return getMetaData().getCompileOptions().getPrintAccessorInfo(); 143 } 144 145 public void setNoCompile(boolean value) { 146 getMetaData().getCompileOptions().setCompileSource(value); 147 } 148 149 public boolean getNoCompile() { 150 return getMetaData().getCompileOptions().getCompileSource(); 151 } 152 153 public File getDocumentOutput() { 154 return new File (getMetaData().getCompileOptions().getDocumentOutput()); 155 } 156 157 158 public boolean getPrintVersion() { 159 return getMetaData().getCompileOptions().getPrintVersion(); 160 } 161 164 public boolean getPrintInfo() { 165 return getMetaData().getCompileOptions().getPrintParseInfo(); 166 } 167 168 } 169 | Popular Tags |