1 23 24 package org.enhydra.xml.xmlc.driver; 25 26 import java.io.File ; 27 28 import org.enhydra.xml.driver.TestProperties; 29 import org.enhydra.xml.xmlc.commands.xmlc.XMLC; 30 31 36 public class XmlcTestParams { 37 38 public static final String RELOADING = "reload"; 39 public static final String STD_LOADING = "stdload"; 40 41 42 private final boolean fIsXml; 43 44 45 private final boolean fIsDeferredParsing; 46 47 48 private final String fParser; 49 50 51 private final String fDom; 52 53 54 private final boolean fUsingJikes; 55 56 57 private final boolean fReloading; 58 private final String fReloadingStr; 59 60 61 private final String fParamsStr; 62 63 64 private final String fBasicParamsStr; 65 66 69 public XmlcTestParams(boolean isXml, 70 String parser, 71 String dom, 72 boolean reloading) { 73 this(isXml, parser, dom, reloading, false); 74 } 75 76 79 public XmlcTestParams(boolean isXml, 80 String parser, 81 String dom, 82 boolean reloading, 83 boolean isDeferringParsing) { 84 fIsXml = isXml; 85 fIsDeferredParsing = isDeferringParsing; 86 87 fParser = parser; 88 fDom = dom; 89 fReloading = reloading; 90 fReloadingStr = (fReloading ? RELOADING : STD_LOADING); 91 92 String defaultJavac = System.getProperty(XMLC.JAVAC_PROPERTY); 95 boolean usingJikes = false; 96 if (defaultJavac != null) { 97 File javac = new File (defaultJavac); 98 if (javac.getName().indexOf("jikes") >= 0) { 99 usingJikes = true; 100 } 101 } 102 fUsingJikes = usingJikes; 103 fBasicParamsStr = fParser + "." + fDom; 104 fParamsStr = fBasicParamsStr + "." + fReloadingStr; 105 } 106 107 111 public static XmlcTestParams getParams(boolean isXml) { 112 String defParser = (isXml ? ExecXmlc.XERCES_PARSER 113 : ExecXmlc.TIDY_PARSER); 114 115 return new XmlcTestParams(isXml, 116 TestProperties.getParser(defParser), 117 TestProperties.getDom(ExecXmlc.XERCES_DOM), 118 TestProperties.getReloading(), 119 TestProperties.getDeferredParsing()); 120 } 121 122 123 124 public boolean getIsXml() { 125 return fIsXml; 126 } 127 128 129 public boolean getIsDeferredParsing() { 130 return fIsDeferredParsing; 131 } 132 133 134 public String getParser() { 135 return fParser; 136 } 137 138 139 public String getDom() { 140 return fDom; 141 } 142 143 144 public boolean getReloading() { 145 return fReloading; 146 } 147 148 149 public boolean getUsingJikes() { 150 return fUsingJikes; 151 } 152 153 154 public String getParamsStr() { 155 return fParamsStr; 156 } 157 158 162 public String getBasicParamsStr() { 163 return fBasicParamsStr; 164 } 165 } 166 | Popular Tags |