Package org.apache.uima.pear.util
Class UIMAUtil
- java.lang.Object
-
- org.apache.uima.pear.util.UIMAUtil
-
public class UIMAUtil extends java.lang.Object
TheUIMAUtil
class provides convenient methods for handling UIMA specific objects.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Hashtable<java.lang.String,java.lang.Exception>
__errTableByUri
static java.lang.String
ANALYSIS_ENGINE_CTG
Analysis Enginestatic java.lang.String
CAS_CONSUMER_CTG
CAS Consumerstatic java.lang.String
CAS_INITIALIZER_CTG
CAS Initializerstatic java.lang.String
COLLECTION_READER_CTG
Collection Readerstatic java.lang.String
CPE_CONFIGURATION_CTG
CPE Configurationstatic java.lang.String
REUSABLE_RESOURCE_CTG
Reusable Resourcestatic java.lang.String
TYPE_SYSTEM_CTG
Type System
-
Constructor Summary
Constructors Constructor Description UIMAUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Exception
getLastErrorForXmlDesc(java.io.File xmlDescFile)
Returns the last loggedException
object associated with a given XML descriptor file.static java.lang.Exception
getLastErrorForXmlDesc(java.net.URL xmlDescUrl)
Returns the last loggedException
object associated with a given XML descriptor URL.static java.lang.String
identifyUimaComponentCategory(java.io.File xmlDescFile)
Identifies a given UIMA component/resource category based on its XML descriptor.private static java.lang.String
identifyUimaComponentCategory(java.io.File xmlDescFile, java.net.URL xmlDescUrl)
Internal method that identifies a given UIMA component/resource category based on its XML descriptor, passed as File or URL.static java.lang.String
identifyUimaComponentCategory(java.net.URL xmlDescUrl)
Identifies a given UIMA component/resource category based on its XML descriptor.
-
-
-
Field Detail
-
ANALYSIS_ENGINE_CTG
public static final java.lang.String ANALYSIS_ENGINE_CTG
Analysis Engine- See Also:
- Constant Field Values
-
CAS_CONSUMER_CTG
public static final java.lang.String CAS_CONSUMER_CTG
CAS Consumer- See Also:
- Constant Field Values
-
CAS_INITIALIZER_CTG
public static final java.lang.String CAS_INITIALIZER_CTG
CAS Initializer- See Also:
- Constant Field Values
-
COLLECTION_READER_CTG
public static final java.lang.String COLLECTION_READER_CTG
Collection Reader- See Also:
- Constant Field Values
-
CPE_CONFIGURATION_CTG
public static final java.lang.String CPE_CONFIGURATION_CTG
CPE Configuration- See Also:
- Constant Field Values
-
TYPE_SYSTEM_CTG
public static final java.lang.String TYPE_SYSTEM_CTG
Type System- See Also:
- Constant Field Values
-
REUSABLE_RESOURCE_CTG
public static final java.lang.String REUSABLE_RESOURCE_CTG
Reusable Resource- See Also:
- Constant Field Values
-
__errTableByUri
private static java.util.Hashtable<java.lang.String,java.lang.Exception> __errTableByUri
-
-
Method Detail
-
getLastErrorForXmlDesc
public static java.lang.Exception getLastErrorForXmlDesc(java.io.File xmlDescFile)
Returns the last loggedException
object associated with a given XML descriptor file.- Parameters:
xmlDescFile
- The given XML descriptor file.- Returns:
- The last logged
Exception
object associated with the given XML descriptor file.
-
getLastErrorForXmlDesc
public static java.lang.Exception getLastErrorForXmlDesc(java.net.URL xmlDescUrl)
Returns the last loggedException
object associated with a given XML descriptor URL.- Parameters:
xmlDescUrl
- The given XML descriptor URL.- Returns:
- The last logged
Exception
object associated with the given XML descriptor URL.
-
identifyUimaComponentCategory
public static java.lang.String identifyUimaComponentCategory(java.io.File xmlDescFile) throws java.io.IOException
Identifies a given UIMA component/resource category based on its XML descriptor. If succeeded, returns appropriate UIMA component category ID, otherwise returnsnull
. If the UIMA component category cannot be identified based on the given XML descriptor file, the associated UIMA exception is logged and can be retrieved later by using thegetLastErrorForXmlDesc()
method.- Parameters:
xmlDescFile
- The given component XML descriptor file.- Returns:
- UIMA component category ID or
null
, if the category cannot be identified based on the given XML descriptor file. - Throws:
java.io.IOException
- If any I/O exception occurred.
-
identifyUimaComponentCategory
public static java.lang.String identifyUimaComponentCategory(java.net.URL xmlDescUrl) throws java.io.IOException
Identifies a given UIMA component/resource category based on its XML descriptor. If succeeded, returns appropriate UIMA component category ID, otherwise returnsnull
. If the UIMA component category cannot be identified based on the given XML descriptor file, the associated UIMA exception is logged and can be retrieved later by using thegetLastErrorForXmlDesc()
method.- Parameters:
xmlDescUrl
- The given component XML descriptor URL.- Returns:
- UIMA component category ID or
null
, if the category cannot be identified based on the given XML descriptor file. - Throws:
java.io.IOException
- If any I/O exception occurred.
-
identifyUimaComponentCategory
private static java.lang.String identifyUimaComponentCategory(java.io.File xmlDescFile, java.net.URL xmlDescUrl) throws java.io.IOException
Internal method that identifies a given UIMA component/resource category based on its XML descriptor, passed as File or URL. If succeeded, returns appropriate UIMA component category ID, otherwise returnsnull
. If the UIMA component category cannot be identified based on the given XML descriptor file, the associated UIMA exception is logged and can be retrieved later by using thegetLastErrorForXmlDesc()
method.- Parameters:
xmlDescFile
- The given component XML descriptor file.xmlDescUrl
- The given component XML descriptor URL.- Returns:
- UIMA component category ID or
null
, if the category cannot be identified based on the given XML descriptor file. - Throws:
java.io.IOException
- If any I/O exception occurred.
-
-