Class JulieXMLConstants
- java.lang.Object
-
- de.julielab.xml.JulieXMLConstants
-
public abstract class JulieXMLConstants extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringBINARYConstant for the name of a definition attribute in the configuration file for the CoStoSys DataBaseConnector.static StringCONCAT_STRINGConstant for the name of a field attribute.static StringCONSTANT_VALUEConstant for the name of a field attribute>static StringEXTRACT_FROM_FILENAMEConstant for the name of a field attribute.static StringFOR_EACHConstant for the name of a definition attribute in the configuration file for the CoStoSys DataBaseConnector.static StringGZIPstatic StringNAMEConstant for the name of a field.static StringNOT_NULLConstant for the name of a field attribute.static StringPRIMARY_KEYConstant for the name of a field attribute.static StringREGEXConstant for the name of a field attribute.static StringREPLACE_WITHConstant for the name of a field attribute.static StringRESOLVE_ENTITIESConstant for the name of a field attribute.static StringRETRIEVEConstant for the name of a field attribute.static StringRETURN_ARRAYConstant for the name of a field attribute.static StringRETURN_XML_FRAGMENTConstant for the name of a field attribute.static StringTIMESTAMPConstant for the name of a field attribute.static StringTYPEConstant for the name of a field attribute.static StringVTD_INDEXstatic StringXPATHConstant for the name of a field attribute.
-
Constructor Summary
Constructors Constructor Description JulieXMLConstants()
-
-
-
Field Detail
-
FOR_EACH
public static final String FOR_EACH
Constant for the name of a definition attribute in the configuration file for the CoStoSys DataBaseConnector. The value of theFOR_EACHattribute is the XPath expression which determines the XML elements for each of which particular fields with values within these elements should be constructed.Example:
Assume we have a file with the following structure:
<MedlineCitationSet> <MedlineCitation> <PMID>123456</PMID> ...more content... </MedlineCitation> ... <MedlineCitation> ...some content... </MedlineCitation> ... </MedlineCitationSet>We want to traverse each of the <MedlineCitation> elements and extract information from their inner elements, e.g. their PMID. For this purpose we set the
FOR_EACHattribute (or the corresponding method parameters in the Java code) to the XPath "/MedlineCitationSet/MedlineCitation".- See Also:
- Constant Field Values
-
BINARY
public static final String BINARY
Constant for the name of a definition attribute in the configuration file for the CoStoSys DataBaseConnector. Indicates whether the data in the respective table is stored in JeDIS binary format.- See Also:
- Constant Field Values
-
PRIMARY_KEY
public static final String PRIMARY_KEY
Constant for the name of a field attribute.If set to true, the database table column corresponding to the field definition with the
PRIMARY_KEYattribute will be part of the primary key.- See Also:
- Constant Field Values
-
NOT_NULL
public static final String NOT_NULL
Constant for the name of a field attribute.
If set to true, the database table column corresponding to the field definition with the
NOT_NULLattribute will prohibit null values.- See Also:
- Constant Field Values
-
RETRIEVE
public static final String RETRIEVE
Constant for the name of a field attribute.If set to true, the value of the database table column corresponding to the field definition with the
RETRIEVEattribute will be retrieved by the CoStoSys DataBaseConnector's query methods.- See Also:
- Constant Field Values
-
XPATH
public static final String XPATH
Constant for the name of a field attribute. TheXPATHattribute is holding the XPath expression that determines which XML element holds the desired information for the field.- See Also:
- Constant Field Values
-
NAME
public static final String NAME
Constant for the name of a field. Will correspond to the name of the database-field which holds the information retrieved by the fieldMap.- See Also:
- Constant Field Values
-
RETURN_XML_FRAGMENT
public static final String RETURN_XML_FRAGMENT
Constant for the name of a field attribute.The
RETURN_XML_FRAGMENTattribute determines whether the complete XML code pointed to by theXPATHattribute should be returned (RETURN_XML_FRAGMENTset totrue).Example:
A field with the following attribute-value-pairs
<field name="xml" xpath="/MedlineCitationSet/MedlineCitation" returnXMLFragment="true">
returns the complete XML fragment for a MedlineCitation node, including opening and closing tags.- See Also:
- Constant Field Values
-
RETURN_ARRAY
public static final String RETURN_ARRAY
Constant for the name of a field attribute.If a field's XPath expression has several hits (e.g. an XPath pointing to an author in a Medline document will most probably find multiple matches),
RETURN_ARRAYdetermines whether the extracted values should be returned as a String array. If set to false, multiple values will be concatenated using the String given byCONCAT_STRINGor, if missing, the default (',').- See Also:
- Constant Field Values
-
GZIP
public static final String GZIP
- See Also:
- Constant Field Values
-
CONCAT_STRING
public static final String CONCAT_STRING
Constant for the name of a field attribute.Determines the String to be used when concatenating multiple hits of an XPath. Multiple hits can also be returned as an array. See the
RETURN_ARRAYconstant for more information.- See Also:
- Constant Field Values
-
EXTRACT_FROM_FILENAME
public static final String EXTRACT_FROM_FILENAME
Constant for the name of a field attribute.If set to true, the file name - if the XML document is read from file - is used to extract values. This is done on a 'match with regular expression and replace with' fashion. Therefore, using this attribute requires to deliver values for the attributes
REGEXandREPLACE_WITHas well.- See Also:
- Constant Field Values
-
RESOLVE_ENTITIES
public static final String RESOLVE_ENTITIES
Constant for the name of a field attribute.If set to true, extracted XML text passages will be XML entity resolved. That is, special characters will be substituted by their human readable counterpart. Example:
The text
The population of butterflies \& bees represents < 30% of all insects
contains the XML entities '&' and '<' in an escaped fashion so not to collide with the XML parsing process. SwitchingRESOLVE_ENTITIESto true will result in the stringThe population of butterflies & bees represents < 30% of all insects
- See Also:
- Constant Field Values
-
TIMESTAMP
public static final String TIMESTAMP
Constant for the name of a field attribute. Fields which have set theTIMESTAMPattribute to "true" will be given the time stamp of the last update for the corresponding record. This is required for delta-updates.- See Also:
- Constant Field Values
-
REGEX
public static final String REGEX
Constant for the name of a field attribute.Used together with
EXTRACT_FROM_FILENAMEandREPLACE_WITHattributes. Determines the regular expression whose matches on the XML document file name are substituted by the value given byREPLACE_WITH.- See Also:
- Constant Field Values
-
REPLACE_WITH
public static final String REPLACE_WITH
Constant for the name of a field attribute.Used together with
EXTRACT_FROM_FILENAMEandREGEXattributes. Determines the substitute expression to replace characters of the XML document filename which match the regular expression given by theREGEXattribute.- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
Constant for the name of a field attribute.Used to set the type of a parsed value, e.g. String
- See Also:
- Constant Field Values
-
CONSTANT_VALUE
public static final String CONSTANT_VALUE
Constant for the name of a field attribute>The value of this attribute will always be the value of the field that specifies the attribute.
- See Also:
- Constant Field Values
-
VTD_INDEX
public static final String VTD_INDEX
Used by the
JulieXMLTools.constructRowIterator(VTDNav, String, List, String)andJulieXMLTools.constructRowIterator(VTDNavHuge, String, List, String)methods. Adds to each row the VTD token index of the beginning of the respective row, i.e. the XML element.When using this functionality to navigate the XML with the VTDNav object given to the row constructor, take care to always set back the original VTDNav state for the current row. This can be achieved by calling
VTDNav.push()before andVTDNav.pop()after manipulations of the VTDNav object.- See Also:
- Constant Field Values
-
-