Changeset 2151
- Timestamp:
- 08/24/12 13:01:23 (12 years ago)
- Location:
- SRUClient/trunk/src/main/java/eu/clarin/sru/client
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUClient.java
r2141 r2151 67 67 LoggerFactory.getLogger(SRUClient.class); 68 68 private final SRUVersion defaultVersion; 69 private boolean strictMode; 70 private final Map<String, SRURecordDataParser> parsers; 69 71 private final HttpClient httpClient; 70 private final Map<String, SRURecordDataParser> parsers =71 new HashMap<String, SRURecordDataParser>();72 72 private final XmlStreamReaderProxy proxy = new XmlStreamReaderProxy(); 73 private boolean strictMode;74 73 75 74 … … 110 109 * <code>false</code> it will act more forgiving and ignore 111 110 * certain violations 112 *113 111 */ 114 112 public SRUClient(SRUVersion defaultVersion, boolean strictMode) { 113 this(defaultVersion, strictMode, 114 new HashMap<String, SRURecordDataParser>()); 115 } 116 117 118 /** 119 * Constructor. 120 * 121 * <p> 122 * For internal use only. 123 * </p> 124 * 125 * @param defaultVersion 126 * the default version to use for SRU requests; may be overridden 127 * by individual requests 128 * @param strictMode 129 * if <code>true</code> the client will strictly adhere to the 130 * SRU standard and raise fatal errors on violations, if 131 * <code>false</code> it will act more forgiving and ignore 132 * certain violations 133 * @param parsers 134 * a <code>Map</code> to store record schema to record data 135 * parser mappings 136 */ 137 SRUClient(SRUVersion defaultVersion, boolean strictMode, 138 Map<String, SRURecordDataParser> parsers) { 115 139 if (defaultVersion == null) { 116 140 throw new NullPointerException("version == null"); 117 141 } 142 if (parsers == null) { 143 throw new NullPointerException("parsers == null"); 144 } 118 145 this.defaultVersion = defaultVersion; 119 this.strictMode = strictMode; 146 this.strictMode = strictMode; 147 this.parsers = parsers; 120 148 this.httpClient = new DefaultHttpClient(); 121 149 this.httpClient.getParams().setParameter(CoreProtocolPNames.USER_AGENT, … … 145 173 this.strictMode = strictMode; 146 174 } 175 147 176 148 177 /**
Note: See TracChangeset
for help on using the changeset viewer.