org.jafer.conf
Class Config
java.lang.Object
|
+--org.jafer.conf.Config
- public class Config
- extends java.lang.Object
Parses XML files used for configuration of client and server and provides static look up methods eg. getRecordSerializer (configured via recordDescriptor.xml), getBib1Message (bib1Messages.xml).
Also, has static utility methods eg. isSyntaxEqual, String convertSyntax(int[]), String getValue(Node), Node selectSingleNode(Node node, String xPath), URL getResource(String path).
- Version:
- 1.0
- Author:
- Antony Corfield; Matthew Dovey; Colin Tatham
|
Method Summary |
private static void |
buildBib1AttributeConfig(java.lang.String bib1AttributesFile)
|
private static void |
buildBib1DiagnosticConfig(java.lang.String bib1DiagnosticsFile)
|
private static void |
buildRecordConfig(java.lang.String recordDescriptorFile)
|
private static void |
buildSearchProfileConfig(java.lang.String searchProfilesFile)
|
private static void |
buildTransformNodes(org.w3c.dom.Node oidNode,
org.w3c.dom.Node transformNode,
java.util.Vector path,
java.util.Hashtable schemaDepth,
java.util.Hashtable schemaNodes,
java.lang.String fromSchema,
boolean fromSerializer)
|
static java.lang.String |
convertSyntax(int[] syntaxArray)
|
static int[] |
convertSyntax(java.lang.String syntaxString)
|
static java.lang.String |
getAttributeSetName()
|
static java.lang.String |
getAttributeSetSyntax()
|
static java.lang.String |
getAttributeType(int attributeTypeValue)
|
static int |
getAttributeType(java.lang.String attributeTypeName)
|
static int |
getAttributeValue(java.lang.String attributeSetName,
java.lang.String attributeTypeName,
java.lang.String attributeName)
|
static java.lang.String |
getBib1Diagnostic(int condition)
|
static org.w3c.dom.Document |
getCharacterSetsMap()
|
static java.lang.String |
getRecordNameFromSyntax(java.lang.String syntax)
|
static java.lang.String |
getRecordSerializer(java.lang.String syntax)
|
static java.lang.String |
getRecordSerializerTargetSchema(java.lang.String syntax)
|
static java.lang.String |
getRecordSyntax(java.lang.String schema)
|
static java.lang.String |
getRecordSyntaxFromName(java.lang.String name)
|
static org.w3c.dom.Document |
getRecordTransformDocument()
|
static java.net.URL |
getResource(java.lang.String path)
|
static java.lang.String |
getSearchProfileNameFromSyntax(java.lang.String searchProfileSyntax)
|
static java.lang.String |
getSearchProfileSyntaxFromName(java.lang.String searchProfileName)
|
static org.w3c.dom.Document |
getServerConfigDocument()
|
static java.net.URL |
getServerDecode()
|
static java.net.URL |
getServerEncode()
|
private static int |
getTransforms(boolean fromSerializer,
org.w3c.dom.Node transformNode,
java.util.Vector transforms)
|
static java.util.Vector |
getTransforms(boolean fromSerializer,
java.lang.String syntax,
java.lang.String schema)
|
static java.lang.String |
getValue(org.w3c.dom.Node node)
|
static boolean |
isSyntaxEqual(int[] syntaxA,
int[] syntaxB)
|
static boolean |
isSyntaxEqual(java.lang.String syntaxA,
java.lang.String syntaxB)
|
private org.w3c.dom.Document |
parseDocument(java.lang.String documentPath)
|
static org.w3c.dom.NodeList |
selectNodeList(org.w3c.dom.Node node,
java.lang.String xPath)
|
static org.w3c.dom.Node |
selectSingleNode(org.w3c.dom.Node node,
java.lang.String xPath)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RECORD_DESCRIPTOR_FILE
public static final java.lang.String RECORD_DESCRIPTOR_FILE
- See Also:
- Constant Field Values
BIB1_ATTRIBUTES_FILE
public static final java.lang.String BIB1_ATTRIBUTES_FILE
- See Also:
- Constant Field Values
BIB1_DIAGNOSTICS_FILE
public static final java.lang.String BIB1_DIAGNOSTICS_FILE
- See Also:
- Constant Field Values
SEARCH_PROFILES_FILE
public static final java.lang.String SEARCH_PROFILES_FILE
- See Also:
- Constant Field Values
CHARACTER_SETS_FILE
public static final java.lang.String CHARACTER_SETS_FILE
- See Also:
- Constant Field Values
SERVER_CONFIG_FILE
public static final java.lang.String SERVER_CONFIG_FILE
- See Also:
- Constant Field Values
SERVER_DECODE_FILE
public static final java.lang.String SERVER_DECODE_FILE
- See Also:
- Constant Field Values
SERVER_ENCODE_FILE
public static final java.lang.String SERVER_ENCODE_FILE
- See Also:
- Constant Field Values
recordTransformDocument
private static org.w3c.dom.Document recordTransformDocument
recordName
private static java.util.Hashtable recordName
recordSyntax
private static java.util.Hashtable recordSyntax
recordSerializer
private static java.util.Hashtable recordSerializer
recordSerializerTargetSchema
private static java.util.Hashtable recordSerializerTargetSchema
recordTransformations
private static java.util.Hashtable recordTransformations
attributeSets
private static java.util.Hashtable attributeSets
attributeTypeName
private static java.util.Hashtable attributeTypeName
attributeTypeValue
private static java.util.Hashtable attributeTypeValue
searchProfileSyntax
private static java.util.Hashtable searchProfileSyntax
searchProfileName
private static java.util.Hashtable searchProfileName
bib1Diagnostic
private static java.util.Hashtable bib1Diagnostic
attributeSetName
private static java.lang.String attributeSetName
attributeSetSyntax
private static java.lang.String attributeSetSyntax
xPathAPI
private static org.apache.xpath.CachedXPathAPI xPathAPI
config
private static Config config
Config
public Config()
getResource
public static java.net.URL getResource(java.lang.String path)
buildRecordConfig
private static void buildRecordConfig(java.lang.String recordDescriptorFile)
throws JaferException
JaferException
buildTransformNodes
private static void buildTransformNodes(org.w3c.dom.Node oidNode,
org.w3c.dom.Node transformNode,
java.util.Vector path,
java.util.Hashtable schemaDepth,
java.util.Hashtable schemaNodes,
java.lang.String fromSchema,
boolean fromSerializer)
throws JaferException
JaferException
getRecordTransformDocument
public static org.w3c.dom.Document getRecordTransformDocument()
getRecordSerializer
public static java.lang.String getRecordSerializer(java.lang.String syntax)
throws JaferException
JaferException
getRecordSerializerTargetSchema
public static java.lang.String getRecordSerializerTargetSchema(java.lang.String syntax)
throws JaferException
JaferException
getRecordNameFromSyntax
public static java.lang.String getRecordNameFromSyntax(java.lang.String syntax)
throws JaferException
JaferException
getRecordSyntaxFromName
public static java.lang.String getRecordSyntaxFromName(java.lang.String name)
throws JaferException
JaferException
isSyntaxEqual
public static boolean isSyntaxEqual(java.lang.String syntaxA,
java.lang.String syntaxB)
isSyntaxEqual
public static boolean isSyntaxEqual(int[] syntaxA,
int[] syntaxB)
convertSyntax
public static int[] convertSyntax(java.lang.String syntaxString)
convertSyntax
public static java.lang.String convertSyntax(int[] syntaxArray)
getRecordSyntax
public static java.lang.String getRecordSyntax(java.lang.String schema)
throws JaferException
JaferException
getTransforms
public static java.util.Vector getTransforms(boolean fromSerializer,
java.lang.String syntax,
java.lang.String schema)
throws JaferException
JaferException
getTransforms
private static int getTransforms(boolean fromSerializer,
org.w3c.dom.Node transformNode,
java.util.Vector transforms)
throws JaferException
JaferException
buildBib1AttributeConfig
private static void buildBib1AttributeConfig(java.lang.String bib1AttributesFile)
throws JaferException
JaferException
getAttributeSetName
public static java.lang.String getAttributeSetName()
getAttributeSetSyntax
public static java.lang.String getAttributeSetSyntax()
getAttributeValue
public static int getAttributeValue(java.lang.String attributeSetName,
java.lang.String attributeTypeName,
java.lang.String attributeName)
getAttributeType
public static int getAttributeType(java.lang.String attributeTypeName)
throws JaferException
JaferException
getAttributeType
public static java.lang.String getAttributeType(int attributeTypeValue)
throws JaferException
JaferException
buildBib1DiagnosticConfig
private static void buildBib1DiagnosticConfig(java.lang.String bib1DiagnosticsFile)
throws JaferException
JaferException
buildSearchProfileConfig
private static void buildSearchProfileConfig(java.lang.String searchProfilesFile)
throws JaferException
JaferException
getBib1Diagnostic
public static java.lang.String getBib1Diagnostic(int condition)
getSearchProfileSyntaxFromName
public static java.lang.String getSearchProfileSyntaxFromName(java.lang.String searchProfileName)
getSearchProfileNameFromSyntax
public static java.lang.String getSearchProfileNameFromSyntax(java.lang.String searchProfileSyntax)
getCharacterSetsMap
public static org.w3c.dom.Document getCharacterSetsMap()
throws JaferException
JaferException
getServerConfigDocument
public static org.w3c.dom.Document getServerConfigDocument()
throws JaferException
JaferException
getServerDecode
public static java.net.URL getServerDecode()
throws JaferException
JaferException
getServerEncode
public static java.net.URL getServerEncode()
throws JaferException
JaferException
selectNodeList
public static org.w3c.dom.NodeList selectNodeList(org.w3c.dom.Node node,
java.lang.String xPath)
throws JaferException
JaferException
selectSingleNode
public static org.w3c.dom.Node selectSingleNode(org.w3c.dom.Node node,
java.lang.String xPath)
throws JaferException
JaferException
getValue
public static java.lang.String getValue(org.w3c.dom.Node node)
parseDocument
private org.w3c.dom.Document parseDocument(java.lang.String documentPath)
throws JaferException
JaferException