Package org.apache.uima.pear.util
Class UIMAUtil
- java.lang.Object
-
- org.apache.uima.pear.util.UIMAUtil
-
public class UIMAUtil extends Object
TheUIMAUtilclass provides convenient methods for handling UIMA specific objects.
-
-
Field Summary
Fields Modifier and Type Field Description static StringANALYSIS_ENGINE_CTGAnalysis Enginestatic StringCAS_CONSUMER_CTGCAS Consumerstatic StringCAS_INITIALIZER_CTGCAS Initializerstatic StringCOLLECTION_READER_CTGCollection Readerstatic StringCPE_CONFIGURATION_CTGCPE Configurationstatic StringREUSABLE_RESOURCE_CTGReusable Resourcestatic StringTYPE_SYSTEM_CTGType System
-
Constructor Summary
Constructors Constructor Description UIMAUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExceptiongetLastErrorForXmlDesc(File xmlDescFile)Returns the last loggedExceptionobject associated with a given XML descriptor file.static ExceptiongetLastErrorForXmlDesc(URL xmlDescUrl)Returns the last loggedExceptionobject associated with a given XML descriptor URL.static StringidentifyUimaComponentCategory(File xmlDescFile)Identifies a given UIMA component/resource category based on its XML descriptor.static StringidentifyUimaComponentCategory(URL xmlDescUrl)Identifies a given UIMA component/resource category based on its XML descriptor.
-
-
-
Field Detail
-
ANALYSIS_ENGINE_CTG
public static final String ANALYSIS_ENGINE_CTG
Analysis Engine- See Also:
- Constant Field Values
-
CAS_CONSUMER_CTG
public static final String CAS_CONSUMER_CTG
CAS Consumer- See Also:
- Constant Field Values
-
CAS_INITIALIZER_CTG
public static final String CAS_INITIALIZER_CTG
CAS Initializer- See Also:
- Constant Field Values
-
COLLECTION_READER_CTG
public static final String COLLECTION_READER_CTG
Collection Reader- See Also:
- Constant Field Values
-
CPE_CONFIGURATION_CTG
public static final String CPE_CONFIGURATION_CTG
CPE Configuration- See Also:
- Constant Field Values
-
TYPE_SYSTEM_CTG
public static final String TYPE_SYSTEM_CTG
Type System- See Also:
- Constant Field Values
-
REUSABLE_RESOURCE_CTG
public static final String REUSABLE_RESOURCE_CTG
Reusable Resource- See Also:
- Constant Field Values
-
-
Method Detail
-
getLastErrorForXmlDesc
public static Exception getLastErrorForXmlDesc(File xmlDescFile)
Returns the last loggedExceptionobject associated with a given XML descriptor file.- Parameters:
xmlDescFile- The given XML descriptor file.- Returns:
- The last logged
Exceptionobject associated with the given XML descriptor file.
-
getLastErrorForXmlDesc
public static Exception getLastErrorForXmlDesc(URL xmlDescUrl)
Returns the last loggedExceptionobject associated with a given XML descriptor URL.- Parameters:
xmlDescUrl- The given XML descriptor URL.- Returns:
- The last logged
Exceptionobject associated with the given XML descriptor URL.
-
identifyUimaComponentCategory
public static String identifyUimaComponentCategory(File xmlDescFile) throws 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:
IOException- If any I/O exception occurred.
-
identifyUimaComponentCategory
public static String identifyUimaComponentCategory(URL xmlDescUrl) throws 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:
IOException- If any I/O exception occurred.
-
-