MCPcopy Create free account
hub / github.com/GateNLP/gate-core / DocumentImpl

Method DocumentImpl

src/main/java/gate/corpora/DocumentImpl.java:215–233  ·  view source on GitHub ↗

Default construction. Content left empty.

()

Source from the content-addressed store, hash-verified

213
214 /** Default construction. Content left empty. */
215 public DocumentImpl() {
216 content = new DocumentContentImpl();
217 stringContent = "";
218
219 /** We will attempt to serialize namespace if
220 * three parameters are set in the global or local config file:
221 * ADD_NAMESPACE_FEATURES: boolean flag
222 * ELEMENT_NAMESPACE_URI: feature name used to hold namespace URI
223 * ELEMENT_NAMESPACE_PREFIX: feature name used to hold namespace prefix
224 */
225 OptionsMap configData = Gate.getUserConfig();
226
227 boolean addNSFeature = Boolean.parseBoolean((String)configData.get(GateConstants.ADD_NAMESPACE_FEATURES));
228 namespaceURIFeature = (String) configData.get(GateConstants.ELEMENT_NAMESPACE_URI);
229 namespacePrefixFeature = (String) configData.get(GateConstants.ELEMENT_NAMESPACE_PREFIX);
230
231 serializeNamespaceInfo = (addNSFeature && namespacePrefixFeature != null && !namespacePrefixFeature.isEmpty() && namespaceURIFeature != null && !namespaceURIFeature.isEmpty());
232
233 } // default construction
234
235 /** Cover unpredictable Features creation */
236 @Override

Callers

nothing calls this directly

Calls 3

getUserConfigMethod · 0.95
getMethod · 0.65
isEmptyMethod · 0.45

Tested by

no test coverage detected