Class PMUimaAgent
java.lang.Object
org.apache.uima.tools.pear.merger.PMUimaAgent
The
PMUimaAgent
class implements UIMA-based utility methods utilized by the
PMController
class. The class allows generating analysis engine descriptor
for output aggregate AE based on the specified input descriptors.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static AnalysisEngineDescription
createAggregateDescription
(String aggCompName, File aggRootDir, InstallationDescriptor[] dlgInstDescs) Creates UIMA aggregate analysis engine description object, based on given aggregate component name (ID), aggregate root directory and array of delegate installation descriptors.private static Capability[]
mergeCapabilities
(ArrayList allCapabilities, ResourceSpecifierFactory rsFactory) Merges sourceCapability
objects specified in a givenArrayList
, creating oneCapability
object that contains all non-duplicated inputs and outputs of the sourceCapability
objects.private static ResourceSpecifier
retrieveDelegateSpecifier
(File aggRootDir, InstallationDescriptor dlgInstDesc) CreatesResourceSpecifier
object for a delegate component descriptor, specified by a givenInstallationDescriptor
object.(package private) static void
saveAggregateDescription
(AnalysisEngineDescription aggDescription, File aggDescFile) Saves a given UIMA aggregate component desciption in a specified XML descriptor file.(package private) static String
toXmlString
(XMLizable content) Converts a givenXMLizable
object to String.
-
Constructor Details
-
PMUimaAgent
public PMUimaAgent()
-
-
Method Details
-
createAggregateDescription
static AnalysisEngineDescription createAggregateDescription(String aggCompName, File aggRootDir, InstallationDescriptor[] dlgInstDescs) Creates UIMA aggregate analysis engine description object, based on given aggregate component name (ID), aggregate root directory and array of delegate installation descriptors. Returns the UIMA aggregate analysis engine description object.- Parameters:
aggCompName
- The given aggregate component name (ID).aggRootDir
- The given aggregate root directory.dlgInstDescs
- The given array of delegate installation descriptors.- Returns:
- The UIMA aggregate analysis engine description object.
-
mergeCapabilities
private static Capability[] mergeCapabilities(ArrayList allCapabilities, ResourceSpecifierFactory rsFactory) Merges sourceCapability
objects specified in a givenArrayList
, creating oneCapability
object that contains all non-duplicated inputs and outputs of the sourceCapability
objects. Returns an array ofCapability
objects, containing the merged object.- Parameters:
allCapabilities
- The givenArrayList
of the sourceCapability
objects.rsFactory
- TheResourceSpecifierFactory
object used to create newCapability
object.- Returns:
- Array of
Capability
objects, containing the merged object.
-
retrieveDelegateSpecifier
private static ResourceSpecifier retrieveDelegateSpecifier(File aggRootDir, InstallationDescriptor dlgInstDesc) throws IOException, InvalidXMLException CreatesResourceSpecifier
object for a delegate component descriptor, specified by a givenInstallationDescriptor
object. Returns the delegate componentResourceSpecifier
object.- Parameters:
aggRootDir
- The given aggregate root directory.dlgInstDesc
- The given delegateInstallationDescriptor
object.- Returns:
- The given delegate component
ResourceSpecifier
object. - Throws:
IOException
- If an I/O exception occurred while creating XML input source.InvalidXMLException
- IfResourceSpecifier
object cannot be created from the specified descriptor.
-
saveAggregateDescription
static void saveAggregateDescription(AnalysisEngineDescription aggDescription, File aggDescFile) throws IOException Saves a given UIMA aggregate component desciption in a specified XML descriptor file.- Parameters:
aggDescription
- The given UIMA aggregate component desciption.aggDescFile
- The given XML descriptor file.- Throws:
IOException
- If an I/O exception occurrs.
-
toXmlString
Converts a givenXMLizable
object to String. This method is useful for debugging.- Parameters:
content
- The givenXMLizable
object- Returns:
- A String that represents the given
XMLizable
object.
-