You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by al...@apache.org on 2006/11/28 23:25:57 UTC
svn commit: r480252 [12/16] - in /incubator/uima/uimaj/trunk/uimaj-core/src:
main/java/org/apache/uima/ main/java/org/apache/uima/analysis_component/
main/java/org/apache/uima/analysis_engine/
main/java/org/apache/uima/analysis_engine/annotator/ main/j...
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasCreationUtils.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasCreationUtils.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasCreationUtils.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasCreationUtils.java Tue Nov 28 14:25:39 2006
@@ -89,7 +89,7 @@
* if CAS creation fails
*/
public static CAS createCas(AnalysisEngineMetaData aMetaData)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
List list = new ArrayList();
list.add(aMetaData);
return createCas(list);
@@ -108,7 +108,7 @@
* if CAS creation fails
*/
public static CAS createCas(ProcessingResourceMetaData aMetaData)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
List list = new ArrayList();
list.add(aMetaData);
return createCas(list);
@@ -128,7 +128,7 @@
* if CAS creation fails
*/
public static CAS createCas(AnalysisEngineDescription aDescription)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
return createCas(aDescription, UIMAFramework.getDefaultPerformanceTuningProperties());
}
@@ -149,7 +149,7 @@
* if CAS creation fails
*/
public static CAS createCas(AnalysisEngineDescription aDescription,
- Properties aPerformanceTuningSettings) throws ResourceInitializationException {
+ Properties aPerformanceTuningSettings) throws ResourceInitializationException {
List list = new ArrayList();
list.add(aDescription);
return createCas(list, aPerformanceTuningSettings);
@@ -170,9 +170,9 @@
* if CAS creation fails
*/
public static CAS createCas(Collection aComponentDescriptionsOrMetaData)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
return createCas(aComponentDescriptionsOrMetaData, UIMAFramework
- .getDefaultPerformanceTuningProperties());
+ .getDefaultPerformanceTuningProperties());
}
/**
@@ -193,9 +193,9 @@
* if CAS creation fails
*/
public static CAS createCas(Collection aComponentDescriptionsOrMetaData,
- Properties aPerformanceTuningSettings) throws ResourceInitializationException {
+ Properties aPerformanceTuningSettings) throws ResourceInitializationException {
return createCas(aComponentDescriptionsOrMetaData, aPerformanceTuningSettings, UIMAFramework
- .newDefaultResourceManager());
+ .newDefaultResourceManager());
}
/**
@@ -218,8 +218,8 @@
* if CAS creation fails
*/
public static CAS createCas(Collection aComponentDescriptionsOrMetaData,
- Properties aPerformanceTuningSettings, ResourceManager aResourceManager)
- throws ResourceInitializationException {
+ Properties aPerformanceTuningSettings, ResourceManager aResourceManager)
+ throws ResourceInitializationException {
// build a list of metadata objects
List mdList = getMetaDataList(aComponentDescriptionsOrMetaData, aResourceManager);
@@ -244,7 +244,7 @@
FsIndexCollection aggIndexColl = mergeFsIndexes(fsIndexes, aResourceManager);
return createCas(aggTypeDesc, aggTypePriorities, aggIndexColl.getFsIndexes(),
- aPerformanceTuningSettings, aResourceManager);
+ aPerformanceTuningSettings, aResourceManager);
}
/**
@@ -263,7 +263,7 @@
* if CAS creation fails
*/
public static CAS createCas(TypeSystemDescription aTypeSystem, TypePriorities aTypePriorities,
- FsIndexDescription[] aFsIndexes) throws ResourceInitializationException {
+ FsIndexDescription[] aFsIndexes) throws ResourceInitializationException {
return createCas(aTypeSystem, aTypePriorities, aFsIndexes, null, null);
}
@@ -286,8 +286,8 @@
* if CAS creation fails
*/
public static CAS createCas(TypeSystemDescription aTypeSystem, TypePriorities aTypePriorities,
- FsIndexDescription[] aFsIndexes, Properties aPerformanceTuningSettings)
- throws ResourceInitializationException {
+ FsIndexDescription[] aFsIndexes, Properties aPerformanceTuningSettings)
+ throws ResourceInitializationException {
return createCas(aTypeSystem, aTypePriorities, aFsIndexes, aPerformanceTuningSettings, null);
}
@@ -310,10 +310,10 @@
* if CAS creation fails
*/
public static CAS createCas(TypeSystemDescription aTypeSystem, TypePriorities aTypePriorities,
- FsIndexDescription[] aFsIndexes, Properties aPerformanceTuningSettings,
- ResourceManager aResourceManager) throws ResourceInitializationException {
+ FsIndexDescription[] aFsIndexes, Properties aPerformanceTuningSettings,
+ ResourceManager aResourceManager) throws ResourceInitializationException {
return doCreateCas(null, aTypeSystem, aTypePriorities, aFsIndexes, aPerformanceTuningSettings,
- aResourceManager);
+ aResourceManager);
}
/**
@@ -338,9 +338,9 @@
* if CAS creation fails
*/
public static CAS createCas(Collection aComponentDescriptionsOrMetaData, TypeSystem aTypeSystem,
- Properties aPerformanceTuningSettings) throws ResourceInitializationException {
+ Properties aPerformanceTuningSettings) throws ResourceInitializationException {
return createCas(aComponentDescriptionsOrMetaData, aTypeSystem, aPerformanceTuningSettings,
- UIMAFramework.newDefaultResourceManager());
+ UIMAFramework.newDefaultResourceManager());
}
/**
@@ -368,8 +368,8 @@
* if CAS creation fails
*/
public static CAS createCas(Collection aComponentDescriptionsOrMetaData, TypeSystem aTypeSystem,
- Properties aPerformanceTuningSettings, ResourceManager aResourceManager)
- throws ResourceInitializationException {
+ Properties aPerformanceTuningSettings, ResourceManager aResourceManager)
+ throws ResourceInitializationException {
// build a list of metadata objects
List mdList = getMetaDataList(aComponentDescriptionsOrMetaData, aResourceManager);
@@ -395,12 +395,12 @@
if (aTypeSystem != null) // existing type system object was specified; use that
{
return createCas(aTypeSystem, aggTypePriorities, aggIndexColl.getFsIndexes(),
- aPerformanceTuningSettings, aResourceManager);
+ aPerformanceTuningSettings, aResourceManager);
} else {
// no type system object specified; merge type system descriptions in metadata
TypeSystemDescription aggTypeDesc = mergeTypeSystems(typeSystems);
return createCas(aggTypeDesc, aggTypePriorities, aggIndexColl.getFsIndexes(),
- aPerformanceTuningSettings, aResourceManager);
+ aPerformanceTuningSettings, aResourceManager);
}
}
@@ -421,8 +421,8 @@
* if CAS creation fails
*/
public static CAS createCas(TypeSystem aTypeSystem, TypePriorities aTypePriorities,
- FsIndexDescription[] aFsIndexes, Properties aPerformanceTuningSettings)
- throws ResourceInitializationException {
+ FsIndexDescription[] aFsIndexes, Properties aPerformanceTuningSettings)
+ throws ResourceInitializationException {
return createCas(aTypeSystem, aTypePriorities, aFsIndexes, aPerformanceTuningSettings, null);
}
@@ -445,10 +445,10 @@
* if CAS creation fails
*/
public static CAS createCas(TypeSystem aTypeSystem, TypePriorities aTypePriorities,
- FsIndexDescription[] aFsIndexes, Properties aPerformanceTuningSettings,
- ResourceManager aResourceManager) throws ResourceInitializationException {
+ FsIndexDescription[] aFsIndexes, Properties aPerformanceTuningSettings,
+ ResourceManager aResourceManager) throws ResourceInitializationException {
return doCreateCas(aTypeSystem, null, aTypePriorities, aFsIndexes, aPerformanceTuningSettings,
- aResourceManager);
+ aResourceManager);
}
/**
@@ -475,9 +475,9 @@
* if CAS creation fails
*/
private static CAS doCreateCas(TypeSystem aTypeSystem, TypeSystemDescription aTypeSystemDesc,
- TypePriorities aTypePriorities, FsIndexDescription[] aFsIndexes,
- Properties aPerformanceTuningSettings, ResourceManager aResourceManager)
- throws ResourceInitializationException {
+ TypePriorities aTypePriorities, FsIndexDescription[] aFsIndexes,
+ Properties aPerformanceTuningSettings, ResourceManager aResourceManager)
+ throws ResourceInitializationException {
if (aResourceManager == null) {
aResourceManager = UIMAFramework.newDefaultResourceManager();
}
@@ -498,7 +498,7 @@
String initialHeapSizeStr = null;
if (aPerformanceTuningSettings != null) {
initialHeapSizeStr = aPerformanceTuningSettings
- .getProperty(UIMAFramework.CAS_INITIAL_HEAP_SIZE);
+ .getProperty(UIMAFramework.CAS_INITIAL_HEAP_SIZE);
}
// create CAS using either aTypeSystem or aTypeSystemDesc
@@ -562,7 +562,7 @@
* TCAS interface have been moved to CAS.
*/
public static TCAS createTCas(AnalysisEngineMetaData aMetaData)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
List list = new ArrayList();
list.add(aMetaData);
return createTCas(list);
@@ -584,7 +584,7 @@
* TCAS interface have been moved to CAS.
*/
public static TCAS createTCas(ProcessingResourceMetaData aMetaData)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
List list = new ArrayList();
list.add(aMetaData);
return createTCas(list);
@@ -595,7 +595,7 @@
* TCAS interface have been moved to CAS.
*/
public static TCAS createTCas(AnalysisEngineDescription aDescription)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
return createTCas(aDescription, UIMAFramework.getDefaultPerformanceTuningProperties());
}
@@ -604,7 +604,7 @@
* TCAS interface have been moved to CAS.
*/
public static TCAS createTCas(AnalysisEngineDescription aDescription,
- Properties aPerformanceTuningSettings) throws ResourceInitializationException {
+ Properties aPerformanceTuningSettings) throws ResourceInitializationException {
List list = new ArrayList();
list.add(aDescription);
return createTCas(list, aPerformanceTuningSettings);
@@ -615,9 +615,9 @@
* TCAS interface have been moved to CAS.
*/
public static TCAS createTCas(Collection aComponentDescriptionsOrMetaData)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
return createTCas(aComponentDescriptionsOrMetaData, UIMAFramework
- .getDefaultPerformanceTuningProperties());
+ .getDefaultPerformanceTuningProperties());
}
/**
@@ -625,9 +625,9 @@
* TCAS interface have been moved to CAS.
*/
public static TCAS createTCas(Collection aComponentDescriptionsOrMetaData,
- Properties aPerformanceTuningSettings) throws ResourceInitializationException {
+ Properties aPerformanceTuningSettings) throws ResourceInitializationException {
return createTCas(aComponentDescriptionsOrMetaData, aPerformanceTuningSettings, UIMAFramework
- .newDefaultResourceManager());
+ .newDefaultResourceManager());
}
/**
@@ -635,8 +635,8 @@
* TCAS interface have been moved to CAS.
*/
public static TCAS createTCas(Collection aComponentDescriptionsOrMetaData,
- Properties aPerformanceTuningSettings, ResourceManager aResourceManager)
- throws ResourceInitializationException {
+ Properties aPerformanceTuningSettings, ResourceManager aResourceManager)
+ throws ResourceInitializationException {
// build a list of metadata objects
List mdList = getMetaDataList(aComponentDescriptionsOrMetaData, aResourceManager);
@@ -661,7 +661,7 @@
FsIndexCollection aggIndexColl = mergeFsIndexes(fsIndexes, aResourceManager);
return createTCas(aggTypeDesc, aggTypePriorities, aggIndexColl.getFsIndexes(),
- aPerformanceTuningSettings, aResourceManager);
+ aPerformanceTuningSettings, aResourceManager);
}
/**
@@ -669,9 +669,9 @@
* TCAS interface have been moved to CAS.
*/
public static TCAS createTCas(Collection aComponentDescriptionsOrMetaData, TypeSystem aTypeSystem)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
return createTCas(aComponentDescriptionsOrMetaData, aTypeSystem, UIMAFramework
- .getDefaultPerformanceTuningProperties());
+ .getDefaultPerformanceTuningProperties());
}
/**
@@ -679,10 +679,10 @@
* TCAS interface have been moved to CAS.
*/
public static TCAS createTCas(Collection aComponentDescriptionsOrMetaData,
- TypeSystem aTypeSystem, Properties aPerformanceTuningSettings)
- throws ResourceInitializationException {
+ TypeSystem aTypeSystem, Properties aPerformanceTuningSettings)
+ throws ResourceInitializationException {
return createTCas(aComponentDescriptionsOrMetaData, aTypeSystem, aPerformanceTuningSettings,
- UIMAFramework.newDefaultResourceManager());
+ UIMAFramework.newDefaultResourceManager());
}
/**
@@ -690,8 +690,8 @@
* TCAS interface have been moved to CAS.
*/
public static TCAS createTCas(Collection aComponentDescriptionsOrMetaData,
- TypeSystem aTypeSystem, Properties aPerformanceTuningSettings,
- ResourceManager aResourceManager) throws ResourceInitializationException {
+ TypeSystem aTypeSystem, Properties aPerformanceTuningSettings,
+ ResourceManager aResourceManager) throws ResourceInitializationException {
// build a list of metadata objects
List mdList = getMetaDataList(aComponentDescriptionsOrMetaData, aResourceManager);
@@ -717,12 +717,12 @@
if (aTypeSystem != null) // existing type system object was specified; use that
{
return createTCas(aTypeSystem, aggTypePriorities, aggIndexColl.getFsIndexes(),
- aPerformanceTuningSettings, aResourceManager);
+ aPerformanceTuningSettings, aResourceManager);
} else {
// no type system object specified; merge type system descriptions in metadata
TypeSystemDescription aggTypeDesc = mergeTypeSystems(typeSystems);
return createTCas(aggTypeDesc, aggTypePriorities, aggIndexColl.getFsIndexes(),
- aPerformanceTuningSettings, aResourceManager);
+ aPerformanceTuningSettings, aResourceManager);
}
}
@@ -731,9 +731,9 @@
* TCAS interface have been moved to CAS.
*/
public static TCAS createTCas(TypeSystemDescription aTypeSystem, TypePriorities aTypePriorities,
- FsIndexDescription[] aFsIndexes) throws ResourceInitializationException {
+ FsIndexDescription[] aFsIndexes) throws ResourceInitializationException {
return createTCas(aTypeSystem, aTypePriorities, aFsIndexes, UIMAFramework
- .getDefaultPerformanceTuningProperties());
+ .getDefaultPerformanceTuningProperties());
}
/**
@@ -741,8 +741,8 @@
* TCAS interface have been moved to CAS.
*/
public static TCAS createTCas(TypeSystemDescription aTypeSystem, TypePriorities aTypePriorities,
- FsIndexDescription[] aFsIndexes, Properties aPerformanceTuningSettings)
- throws ResourceInitializationException {
+ FsIndexDescription[] aFsIndexes, Properties aPerformanceTuningSettings)
+ throws ResourceInitializationException {
return createTCas(aTypeSystem, aTypePriorities, aFsIndexes, aPerformanceTuningSettings, null);
}
@@ -751,11 +751,11 @@
* TCAS interface have been moved to CAS.
*/
public static TCAS createTCas(TypeSystemDescription aTypeSystem, TypePriorities aTypePriorities,
- FsIndexDescription[] aFsIndexes, Properties aPerformanceTuningSettings,
- ResourceManager aResourceManager) throws ResourceInitializationException {
+ FsIndexDescription[] aFsIndexes, Properties aPerformanceTuningSettings,
+ ResourceManager aResourceManager) throws ResourceInitializationException {
// Create CAS, then create default text Sofa and return TCAS view
CAS cas = createCas(aTypeSystem, aTypePriorities, aFsIndexes, aPerformanceTuningSettings,
- aResourceManager);
+ aResourceManager);
return (TCAS) cas;
}
@@ -764,9 +764,9 @@
* TCAS interface have been moved to CAS.
*/
public static TCAS createTCas(TypeSystem aTypeSystem, TypePriorities aTypePriorities,
- FsIndexDescription[] aFsIndexes) throws ResourceInitializationException {
+ FsIndexDescription[] aFsIndexes) throws ResourceInitializationException {
return createTCas(aTypeSystem, aTypePriorities, aFsIndexes, UIMAFramework
- .getDefaultPerformanceTuningProperties());
+ .getDefaultPerformanceTuningProperties());
}
/**
@@ -774,8 +774,8 @@
* TCAS interface have been moved to CAS.
*/
public static TCAS createTCas(TypeSystem aTypeSystem, TypePriorities aTypePriorities,
- FsIndexDescription[] aFsIndexes, Properties aPerformanceTuningSettings)
- throws ResourceInitializationException {
+ FsIndexDescription[] aFsIndexes, Properties aPerformanceTuningSettings)
+ throws ResourceInitializationException {
return createTCas(aTypeSystem, aTypePriorities, aFsIndexes, aPerformanceTuningSettings, null);
}
@@ -784,11 +784,11 @@
* TCAS interface have been moved to CAS.
*/
public static TCAS createTCas(TypeSystem aTypeSystem, TypePriorities aTypePriorities,
- FsIndexDescription[] aFsIndexes, Properties aPerformanceTuningSettings,
- ResourceManager aResourceManager) throws ResourceInitializationException {
+ FsIndexDescription[] aFsIndexes, Properties aPerformanceTuningSettings,
+ ResourceManager aResourceManager) throws ResourceInitializationException {
// Create CAS, then create default text Sofa and return TCAS view
CAS cas = createCas(aTypeSystem, aTypePriorities, aFsIndexes, aPerformanceTuningSettings,
- aResourceManager);
+ aResourceManager);
return (TCAS) cas;
}
@@ -804,10 +804,9 @@
* @return a new CAS matching the given CasDefinition
*/
public static CAS createCas(CasDefinition casDef, Properties performanceTuningSettings)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
return createCas(casDef.getTypeSystemDescription(), casDef.getTypePriorities(), casDef
- .getFsIndexDescriptions(), performanceTuningSettings, casDef
- .getResourceManager());
+ .getFsIndexDescriptions(), performanceTuningSettings, casDef.getResourceManager());
}
/**
@@ -824,9 +823,9 @@
* @return a new CAS matching the given CasDefinition
*/
public static CAS createCas(CasDefinition casDef, Properties performanceTuningSettings,
- TypeSystem typeSystem) throws ResourceInitializationException {
+ TypeSystem typeSystem) throws ResourceInitializationException {
return createCas(typeSystem, casDef.getTypePriorities(), casDef.getFsIndexDescriptions(),
- performanceTuningSettings, casDef.getResourceManager());
+ performanceTuningSettings, casDef.getResourceManager());
}
/**
@@ -841,7 +840,7 @@
* if an error occurs during modification of the type system
*/
public static void setupTypeSystem(CASMgr aCASMgr, TypeSystemDescription aTypeSystem)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
TypeSystemMgr typeSystemMgr = aCASMgr.getTypeSystemMgr();
if (aTypeSystem != null) {
TypeDescription[] types = aTypeSystem.getTypes();
@@ -869,8 +868,8 @@
String superTypeName = curTypeDesc.getSupertypeName();
if (superTypeName == null) {
throw new ResourceInitializationException(
- ResourceInitializationException.NO_SUPERTYPE, new Object[] {
- typeName, curTypeDesc.getSourceUrlString() });
+ ResourceInitializationException.NO_SUPERTYPE, new Object[] { typeName,
+ curTypeDesc.getSourceUrlString() });
}
Type supertype = typeSystemMgr.getType(superTypeName);
if (supertype != null) {
@@ -880,8 +879,8 @@
AllowedValue[] vals = curTypeDesc.getAllowedValues();
if (vals == null) {
throw new ResourceInitializationException(
- ResourceInitializationException.MISSING_ALLOWED_VALUES,
- new Object[] { typeName, curTypeDesc.getSourceUrlString() });
+ ResourceInitializationException.MISSING_ALLOWED_VALUES, new Object[] {
+ typeName, curTypeDesc.getSourceUrlString() });
}
String[] valStrs = new String[vals.length];
for (int i = 0; i < valStrs.length; i++) {
@@ -892,10 +891,10 @@
{
// make sure that allowed values are NOT specified for non-string subtypes
if (curTypeDesc.getAllowedValues() != null
- && curTypeDesc.getAllowedValues().length > 0) {
+ && curTypeDesc.getAllowedValues().length > 0) {
throw new ResourceInitializationException(
- ResourceInitializationException.ALLOWED_VALUES_ON_NON_STRING_TYPE,
- new Object[] { typeName, curTypeDesc.getSourceUrlString() });
+ ResourceInitializationException.ALLOWED_VALUES_ON_NON_STRING_TYPE,
+ new Object[] { typeName, curTypeDesc.getSourceUrlString() });
}
typeSystemMgr.addType(typeName, supertype);
}
@@ -913,9 +912,9 @@
if (numTypes > 0) {
TypeDescription firstFailed = (TypeDescription) typeList.getFirst();
throw new ResourceInitializationException(
- ResourceInitializationException.UNDEFINED_SUPERTYPE, new Object[] {
- firstFailed.getSupertypeName(), firstFailed.getName(),
- firstFailed.getSourceUrlString() });
+ ResourceInitializationException.UNDEFINED_SUPERTYPE, new Object[] {
+ firstFailed.getSupertypeName(), firstFailed.getName(),
+ firstFailed.getSourceUrlString() });
}
// now for each type, add its features. We add features to supertypes before subtypes. This
@@ -939,9 +938,9 @@
Type rangeType = typeSystemMgr.getType(rangeTypeName);
if (rangeType == null) {
throw new ResourceInitializationException(
- ResourceInitializationException.UNDEFINED_RANGE_TYPE, new Object[] {
- rangeTypeName, featName, typeDesc.getName(),
- features[j].getSourceUrlString() });
+ ResourceInitializationException.UNDEFINED_RANGE_TYPE, new Object[] {
+ rangeTypeName, featName, typeDesc.getName(),
+ features[j].getSourceUrlString() });
}
if (rangeType.isArray()) // TODO: also List?
{
@@ -952,9 +951,9 @@
Type elementType = typeSystemMgr.getType(elementTypeName);
if (elementType == null) {
throw new ResourceInitializationException(
- ResourceInitializationException.UNDEFINED_RANGE_TYPE,
- new Object[] { elementTypeName, featName, typeDesc.getName(),
- features[j].getSourceUrlString() });
+ ResourceInitializationException.UNDEFINED_RANGE_TYPE, new Object[] {
+ elementTypeName, featName, typeDesc.getName(),
+ features[j].getSourceUrlString() });
}
rangeType = typeSystemMgr.getArrayType(elementType);
}
@@ -983,10 +982,10 @@
* if an error occurs during type priority setup
*/
public static void setupTypePriorities(CASMgr aCASMgr, TypePriorities aTypePriorities)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
if (aTypePriorities != null) {
LinearTypeOrderBuilder typeOrderBuilder = aCASMgr.getIndexRepositoryMgr()
- .getDefaultOrderBuilder();
+ .getDefaultOrderBuilder();
TypePriorityList[] priorityLists = aTypePriorities.getPriorityLists();
for (int i = 0; i < priorityLists.length; i++) {
// check that all types exist. This error would be caught in
@@ -996,8 +995,8 @@
for (int j = 0; j < typeList.length; j++) {
if (aCASMgr.getTypeSystemMgr().getType(typeList[j]) == null) {
throw new ResourceInitializationException(
- ResourceInitializationException.UNDEFINED_TYPE_FOR_PRIORITY_LIST,
- new Object[] { typeList[j], priorityLists[i].getSourceUrlString() });
+ ResourceInitializationException.UNDEFINED_TYPE_FOR_PRIORITY_LIST, new Object[] {
+ typeList[j], priorityLists[i].getSourceUrlString() });
}
}
try {
@@ -1006,8 +1005,8 @@
// typically caused by a cycle in the priorities - the caused-by message
// will clarify.
throw new ResourceInitializationException(
- ResourceInitializationException.INVALID_TYPE_PRIORITIES,
- new Object[] { priorityLists[i].getSourceUrlString() }, e);
+ ResourceInitializationException.INVALID_TYPE_PRIORITIES,
+ new Object[] { priorityLists[i].getSourceUrlString() }, e);
}
}
}
@@ -1025,7 +1024,7 @@
* if an error occurs during index creation
*/
public static void setupIndexes(CASMgr aCASMgr, FsIndexDescription[] aIndexes)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
if (aIndexes != null) {
TypeSystemMgr tsm = aCASMgr.getTypeSystemMgr();
FSIndexRepositoryMgr irm = aCASMgr.getIndexRepositoryMgr();
@@ -1045,9 +1044,9 @@
Type type = tsm.getType(aIndexes[i].getTypeName());
if (type == null) {
throw new ResourceInitializationException(
- ResourceInitializationException.UNDEFINED_TYPE_FOR_INDEX, new Object[] {
- aIndexes[i].getTypeName(), aIndexes[i].getLabel(),
- aIndexes[i].getSourceUrlString() });
+ ResourceInitializationException.UNDEFINED_TYPE_FOR_INDEX, new Object[] {
+ aIndexes[i].getTypeName(), aIndexes[i].getLabel(),
+ aIndexes[i].getSourceUrlString() });
}
FSIndexComparator comparator = irm.createComparator();
comparator.setType(type);
@@ -1061,9 +1060,9 @@
Feature feature = type.getFeatureByBaseName(keys[j].getFeatureName());
if (feature == null) {
throw new ResourceInitializationException(
- ResourceInitializationException.INDEX_KEY_FEATURE_NOT_FOUND,
- new Object[] { keys[j].getFeatureName(), aIndexes[i].getLabel(),
- aIndexes[i].getSourceUrlString() });
+ ResourceInitializationException.INDEX_KEY_FEATURE_NOT_FOUND, new Object[] {
+ keys[j].getFeatureName(), aIndexes[i].getLabel(),
+ aIndexes[i].getSourceUrlString() });
}
comparator.addKey(feature, keys[j].getComparator());
}
@@ -1085,7 +1084,7 @@
*/
public static TypeSystemDescription convertData2TypeSystem(CasData aCasData) {
TypeSystemDescription result = UIMAFramework.getResourceSpecifierFactory()
- .createTypeSystemDescription();
+ .createTypeSystemDescription();
Iterator iter = aCasData.getFeatureStructures();
ArrayList typesArr = new ArrayList();
while (iter.hasNext()) {
@@ -1133,7 +1132,7 @@
* if an incompatibiliy exists or if an import could not be resolved
*/
public static TypeSystemDescription mergeTypeSystems(Collection aTypeSystems)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
return mergeTypeSystems(aTypeSystems, UIMAFramework.newDefaultResourceManager());
}
@@ -1153,10 +1152,10 @@
* if an incompatibiliy exists or if an import could not be resolved
*/
public static TypeSystemDescription mergeTypeSystems(Collection aTypeSystems,
- ResourceManager aResourceManager) throws ResourceInitializationException {
+ ResourceManager aResourceManager) throws ResourceInitializationException {
// create the type system into which we are merging
TypeSystemDescription result = UIMAFramework.getResourceSpecifierFactory()
- .createTypeSystemDescription();
+ .createTypeSystemDescription();
// also build a Map from Type names to Types
Map typeNameMap = new HashMap();
@@ -1179,7 +1178,7 @@
if (existingType == null) {
// create new type
existingType = result.addType(types[i].getName(), types[i].getDescription(), types[i]
- .getSupertypeName());
+ .getSupertypeName());
existingType.setAllowedValues(types[i].getAllowedValues());
existingType.setSourceUrl(types[i].getSourceUrl());
typeNameMap.put(types[i].getName(), existingType);
@@ -1199,9 +1198,9 @@
} else {
// error
throw new ResourceInitializationException(
- ResourceInitializationException.INCOMPATIBLE_SUPERTYPES,
- new Object[] { typeName, supertypeName, existingSupertypeName,
- types[i].getSourceUrlString() });
+ ResourceInitializationException.INCOMPATIBLE_SUPERTYPES, new Object[] {
+ typeName, supertypeName, existingSupertypeName,
+ types[i].getSourceUrlString() });
}
}
@@ -1232,10 +1231,9 @@
* if an incompatibiliy exists or if an import could not be resolved
*/
public static TypeSystemDescription mergeDelegateAnalysisEngineTypeSystems(
- AnalysisEngineDescription aAggregateDescription)
- throws ResourceInitializationException {
+ AnalysisEngineDescription aAggregateDescription) throws ResourceInitializationException {
return mergeDelegateAnalysisEngineTypeSystems(aAggregateDescription, UIMAFramework
- .newDefaultResourceManager());
+ .newDefaultResourceManager());
}
/**
@@ -1254,8 +1252,8 @@
* if an incompatibiliy exists or if an import could not be resolved
*/
public static TypeSystemDescription mergeDelegateAnalysisEngineTypeSystems(
- AnalysisEngineDescription aAggregateDescription, ResourceManager aResourceManager)
- throws ResourceInitializationException {
+ AnalysisEngineDescription aAggregateDescription, ResourceManager aResourceManager)
+ throws ResourceInitializationException {
// expand the aggregate AE description into the individual delegates
ArrayList l = new ArrayList();
l.add(aAggregateDescription);
@@ -1285,7 +1283,7 @@
* if an incompatibiliy exists or if an import could not be resolved
*/
public static FsIndexCollection mergeFsIndexes(List aFsIndexCollections,
- ResourceManager aResourceManager) throws ResourceInitializationException {
+ ResourceManager aResourceManager) throws ResourceInitializationException {
Map aggIndexes = new HashMap();
Iterator it = aFsIndexCollections.iterator();
while (it.hasNext()) {
@@ -1301,16 +1299,16 @@
for (int i = 0; i < indexes.length; i++) {
// does an index with this label already exist?
FsIndexDescription duplicateIndex = (FsIndexDescription) aggIndexes.get(indexes[i]
- .getLabel());
+ .getLabel());
if (duplicateIndex == null) {
// no, so add it
aggIndexes.put(indexes[i].getLabel(), indexes[i]);
} else if (!duplicateIndex.equals(indexes[i])) {
// index with same label exists, they better be equal!
throw new ResourceInitializationException(
- ResourceInitializationException.DUPLICATE_INDEX_NAME, new Object[] {
- duplicateIndex.getLabel(), duplicateIndex.getSourceUrlString(),
- indexes[i].getSourceUrlString() });
+ ResourceInitializationException.DUPLICATE_INDEX_NAME, new Object[] {
+ duplicateIndex.getLabel(), duplicateIndex.getSourceUrlString(),
+ indexes[i].getSourceUrlString() });
}
}
}
@@ -1318,7 +1316,7 @@
// convert index map to FsIndexCollection
FsIndexCollection aggIndexColl = UIMAFramework.getResourceSpecifierFactory()
- .createFsIndexCollection();
+ .createFsIndexCollection();
Collection indexes = aggIndexes.values();
FsIndexDescription[] indexArray = new FsIndexDescription[indexes.size()];
indexes.toArray(indexArray);
@@ -1340,10 +1338,9 @@
* if an incompatibiliy exists or if an import could not be resolved
*/
public static FsIndexCollection mergeDelegateAnalysisEngineFsIndexCollections(
- AnalysisEngineDescription aAggregateDescription)
- throws ResourceInitializationException {
+ AnalysisEngineDescription aAggregateDescription) throws ResourceInitializationException {
return mergeDelegateAnalysisEngineFsIndexCollections(aAggregateDescription, UIMAFramework
- .newDefaultResourceManager());
+ .newDefaultResourceManager());
}
/**
@@ -1362,8 +1359,8 @@
* if an incompatibiliy exists or if an import could not be resolved
*/
public static FsIndexCollection mergeDelegateAnalysisEngineFsIndexCollections(
- AnalysisEngineDescription aAggregateDescription, ResourceManager aResourceManager)
- throws ResourceInitializationException {
+ AnalysisEngineDescription aAggregateDescription, ResourceManager aResourceManager)
+ throws ResourceInitializationException {
// expand the aggregate AE description into the individual delegates
ArrayList l = new ArrayList();
l.add(aAggregateDescription);
@@ -1393,9 +1390,9 @@
* if an import could not be resolved
*/
public static TypePriorities mergeTypePriorities(List aTypePriorities,
- ResourceManager aResourceManager) throws ResourceInitializationException {
+ ResourceManager aResourceManager) throws ResourceInitializationException {
TypePriorities aggTypePriorities = UIMAFramework.getResourceSpecifierFactory()
- .createTypePriorities();
+ .createTypePriorities();
Iterator it = aTypePriorities.iterator();
while (it.hasNext()) {
TypePriorities tp = (TypePriorities) it.next();
@@ -1428,10 +1425,9 @@
* if an incompatibility exists
*/
public static TypePriorities mergeDelegateAnalysisEngineTypePriorities(
- AnalysisEngineDescription aAggregateDescription)
- throws ResourceInitializationException {
+ AnalysisEngineDescription aAggregateDescription) throws ResourceInitializationException {
return mergeDelegateAnalysisEngineTypePriorities(aAggregateDescription, UIMAFramework
- .newDefaultResourceManager());
+ .newDefaultResourceManager());
}
/**
@@ -1450,8 +1446,8 @@
* if an incompatibility exists
*/
public static TypePriorities mergeDelegateAnalysisEngineTypePriorities(
- AnalysisEngineDescription aAggregateDescription, ResourceManager aResourceManager)
- throws ResourceInitializationException {
+ AnalysisEngineDescription aAggregateDescription, ResourceManager aResourceManager)
+ throws ResourceInitializationException {
// expand the aggregate AE description into the individual delegates
ArrayList l = new ArrayList();
l.add(aAggregateDescription);
@@ -1513,7 +1509,7 @@
* if an incompatibility exists
*/
protected static void mergeFeatures(TypeDescription aType, FeatureDescription[] aFeatures)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
FeatureDescription[] existingFeatures = aType.getFeatures();
if (existingFeatures == null) {
existingFeatures = new FeatureDescription[0];
@@ -1537,16 +1533,16 @@
if (feat == null) {
// doesn't exist; add it
FeatureDescription featDesc = aType.addFeature(featName, aFeatures[i].getDescription(),
- rangeTypeName, elementTypeName, multiRefsAllowed);
+ rangeTypeName, elementTypeName, multiRefsAllowed);
featDesc.setSourceUrl(aFeatures[i].getSourceUrl());
} else // feature does exist
{
// check that the range types match
if (!feat.getRangeTypeName().equals(rangeTypeName)) {
throw new ResourceInitializationException(
- ResourceInitializationException.INCOMPATIBLE_RANGE_TYPES, new Object[] {
- aType.getName() + ":" + feat.getName(), rangeTypeName,
- feat.getRangeTypeName(), aType.getSourceUrlString() });
+ ResourceInitializationException.INCOMPATIBLE_RANGE_TYPES, new Object[] {
+ aType.getName() + ":" + feat.getName(), rangeTypeName,
+ feat.getRangeTypeName(), aType.getSourceUrlString() });
}
}
}
@@ -1571,7 +1567,7 @@
* if a failure occurs because an import could not be resolved
*/
public static List getMetaDataList(Collection aComponentDescriptionOrMetaData,
- ResourceManager aResourceManager) throws ResourceInitializationException {
+ ResourceManager aResourceManager) throws ResourceInitializationException {
List mdList = new ArrayList();
if (null == aComponentDescriptionOrMetaData) {
return mdList;
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasPool.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasPool.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasPool.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasPool.java Tue Nov 28 14:25:39 2006
@@ -86,8 +86,8 @@
* if the CAS instances could not be created
*/
public CasPool(int aNumInstances, Collection aComponentDescriptionsOrMetaData,
- Properties aPerformanceTuningSettings, ResourceManager aResourceManager)
- throws ResourceInitializationException {
+ Properties aPerformanceTuningSettings, ResourceManager aResourceManager)
+ throws ResourceInitializationException {
mNumInstances = aNumInstances;
fillPool(aComponentDescriptionsOrMetaData, aPerformanceTuningSettings, aResourceManager);
@@ -106,12 +106,12 @@
* if the CAS instances could not be created
*/
public CasPool(int aNumInstances, AnalysisEngine aAnalysisEngine)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
mNumInstances = aNumInstances;
ArrayList mdList = new ArrayList();
mdList.add(aAnalysisEngine.getMetaData());
fillPool(mdList, aAnalysisEngine.getPerformanceTuningSettings(), aAnalysisEngine
- .getResourceManager());
+ .getResourceManager());
}
/**
@@ -126,7 +126,7 @@
* if the CAS instances could not be created
*/
public CasPool(int aNumInstances, ProcessingResourceMetaData aMetaData)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
mNumInstances = aNumInstances;
ArrayList mdList = new ArrayList();
mdList.add(aMetaData);
@@ -145,7 +145,7 @@
* if the CAS instances could not be created
*/
public CasPool(int aNumInstances, ProcessingResourceMetaData aMetaData,
- ResourceManager aResourceManager) throws ResourceInitializationException {
+ ResourceManager aResourceManager) throws ResourceInitializationException {
mNumInstances = aNumInstances;
ArrayList mdList = new ArrayList();
@@ -166,7 +166,7 @@
* defined on {@link UIMAFramework} interface
*/
public CasPool(int aNumInstances, CasDefinition aCasDefinition,
- Properties aPerformanceTuningSettings) throws ResourceInitializationException {
+ Properties aPerformanceTuningSettings) throws ResourceInitializationException {
mNumInstances = aNumInstances;
fillPool(aCasDefinition, aPerformanceTuningSettings);
}
@@ -202,7 +202,7 @@
// make sure this CAS actually belongs to this pool and is checked out
if (!mAllInstances.contains(cas) || mFreeInstances.contains(cas)) {
UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(), "releaseCas",
- LOG_RESOURCE_BUNDLE, "UIMA_return_cas_to_pool__WARNING");
+ LOG_RESOURCE_BUNDLE, "UIMA_return_cas_to_pool__WARNING");
} else {
// reset CAS
cas.reset();
@@ -255,13 +255,13 @@
* @param resourceManager
*/
private void fillPool(Collection mdList, Properties performanceTuningSettings,
- ResourceManager resourceManager) throws ResourceInitializationException {
+ ResourceManager resourceManager) throws ResourceInitializationException {
CasDefinition casDef = new CasDefinition(mdList, resourceManager);
fillPool(casDef, performanceTuningSettings);
}
private void fillPool(CasDefinition casDef, Properties performanceTuningSettings)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
// create first CAS from metadata
CAS c0 = CasCreationUtils.createCas(casDef, performanceTuningSettings);
// set owner so cas.release() can return it to the pool
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasToInlineXml.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasToInlineXml.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasToInlineXml.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasToInlineXml.java Tue Nov 28 14:25:39 2006
@@ -143,7 +143,7 @@
handler.characters(docCharArray, pos, nextAnnot.getBegin() - pos);
pos = nextAnnot.getBegin();
handler.startElement("", nextAnnot.getType().getName(),
- nextAnnot.getType().getName(), getFeatureAttributes(nextAnnot, aCAS));
+ nextAnnot.getType().getName(), getFeatureAttributes(nextAnnot, aCAS));
// push parent annotation on stack
stack.add(curAnnot);
@@ -151,7 +151,7 @@
curAnnot = nextAnnot;
} catch (StringIndexOutOfBoundsException e) {
System.err.println("Invalid annotation range: " + nextAnnot.getBegin() + ","
- + nextAnnot.getEnd() + " in document of length " + docText.length());
+ + nextAnnot.getEnd() + " in document of length " + docText.length());
}
}
iterator.moveToNext();
@@ -163,7 +163,7 @@
pos = curAnnot.getEnd();
} catch (StringIndexOutOfBoundsException e) {
System.err.println("Invalid annotation range: " + curAnnot.getBegin() + ","
- + curAnnot.getEnd() + " in document of length " + docText.length());
+ + curAnnot.getEnd() + " in document of length " + docText.length());
}
handler.endElement("", curAnnot.getType().getName(), curAnnot.getType().getName());
@@ -179,7 +179,7 @@
pos = curAnnot.getEnd();
} catch (StringIndexOutOfBoundsException e) {
System.err.println("Invalid annotation range: " + curAnnot.getBegin() + ","
- + curAnnot.getEnd() + "in document of length " + docText.length());
+ + curAnnot.getEnd() + "in document of length " + docText.length());
}
handler.endElement("", curAnnot.getType().getName(), curAnnot.getType().getName());
@@ -193,7 +193,7 @@
pos = curAnnot.getEnd();
} catch (StringIndexOutOfBoundsException e) {
System.err.println("Invalid annotation range: " + curAnnot.getBegin() + ","
- + curAnnot.getEnd() + "in document of length " + docText.length());
+ + curAnnot.getEnd() + "in document of length " + docText.length());
}
handler.endElement("", curAnnot.getType().getName(), curAnnot.getType().getName());
}
@@ -225,7 +225,7 @@
// how we get feature value depends on feature's range type)
String rangeTypeName = feat.getRange().getName();
if (aCAS.getTypeSystem().subsumes(stringType, feat.getRange())) // must check for subtypes of
- // string
+ // string
{
String str = aFS.getStringValue(feat);
if (str == null) {
@@ -238,12 +238,12 @@
}
} else if (CAS.TYPE_NAME_INTEGER.equals(rangeTypeName)) {
attrs
- .addAttribute("", featName, featName, "CDATA", Integer.toString(aFS
- .getIntValue(feat)));
+ .addAttribute("", featName, featName, "CDATA", Integer.toString(aFS
+ .getIntValue(feat)));
} else if (CAS.TYPE_NAME_FLOAT.equals(rangeTypeName)) {
attrs
- .addAttribute("", featName, featName, "CDATA", Float.toString(aFS
- .getFloatValue(feat)));
+ .addAttribute("", featName, featName, "CDATA", Float.toString(aFS
+ .getFloatValue(feat)));
} else if (CAS.TYPE_NAME_STRING_ARRAY.equals(rangeTypeName)) {
StringArrayFS arrayFS = (StringArrayFS) aFS.getFeatureValue(feat);
if (arrayFS == null) {
@@ -327,8 +327,8 @@
private void replaceInvalidXmlChars(char[] aChars) {
for (int i = 0; i < aChars.length; i++) {
if ((aChars[i] < 0x20 && aChars[i] != 0x09 && aChars[i] != 0x0A && aChars[i] != 0x0D)
- || (aChars[i] > 0xD7FF && aChars[i] < 0xE000) || aChars[i] == 0xFFFE
- || aChars[i] == 0xFFFF) {
+ || (aChars[i] > 0xD7FF && aChars[i] < 0xE000) || aChars[i] == 0xFFFE
+ || aChars[i] == 0xFFFF) {
// System.out.println("Found invalid XML character: " + (int)aChars[i] + " at position " +
// i); //temp
aChars[i] = ' ';
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/ConsumerCasUtils.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/ConsumerCasUtils.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/ConsumerCasUtils.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/ConsumerCasUtils.java Tue Nov 28 14:25:39 2006
@@ -33,8 +33,7 @@
while (idIter.isValid()) {
org.apache.uima.cas.FeatureStructure idFS = idIter.get();
result = idFS
- .getIntValue(aTcas.getTypeSystem().getFeatureByFullName(
- aTypeS + ":" + aFeatS));
+ .getIntValue(aTcas.getTypeSystem().getFeatureByFullName(aTypeS + ":" + aFeatS));
idIter.moveToNext();
}
}
@@ -49,7 +48,7 @@
while (idIter.isValid()) {
org.apache.uima.cas.FeatureStructure idFS = idIter.get();
result = idFS.getStringValue(aTcas.getTypeSystem().getFeatureByFullName(
- aTypeS + ":" + aFeatS));
+ aTypeS + ":" + aFeatS));
idIter.moveToNext();
}
}
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/FileSystemCollectionReader.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/FileSystemCollectionReader.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/FileSystemCollectionReader.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/FileSystemCollectionReader.java Tue Nov 28 14:25:39 2006
@@ -100,8 +100,7 @@
// if input directory does not exist or is not a directory, throw exception
if (!directory.exists() || !directory.isDirectory()) {
throw new ResourceInitializationException(ResourceConfigurationException.DIRECTORY_NOT_FOUND,
- new Object[] { PARAM_INPUTDIR, this.getMetaData().getName(),
- directory.getPath() });
+ new Object[] { PARAM_INPUTDIR, this.getMetaData().getName(), directory.getPath() });
}
// get list of files (not subdirectories) in the specified directory
@@ -172,7 +171,7 @@
srcDocInfo.setUri(file.getAbsoluteFile().toURL().toString());
srcDocInfo.setOffsetInSource(0);
srcDocInfo.setDocumentSize((int) file.length());
- srcDocInfo.setLastSegment(mCurrentIndex == mFiles.size());
+ srcDocInfo.setLastSegment(mCurrentIndex == mFiles.size());
srcDocInfo.addToIndexes();
}
// XCAS input files
@@ -221,9 +220,9 @@
*/
public static CollectionReaderDescription getDescription() throws InvalidXMLException {
InputStream descStream = FileSystemCollectionReader.class
- .getResourceAsStream("FileSystemCollectionReader.xml");
+ .getResourceAsStream("FileSystemCollectionReader.xml");
return UIMAFramework.getXMLParser().parseCollectionReaderDescription(
- new XMLInputSource(descStream, null));
+ new XMLInputSource(descStream, null));
}
}
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/InlineXmlCasConsumer.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/InlineXmlCasConsumer.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/InlineXmlCasConsumer.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/InlineXmlCasConsumer.java Tue Nov 28 14:25:39 2006
@@ -123,7 +123,7 @@
jcas = aCAS.getView(CAS.NAME_DEFAULT_SOFA).getJCas();
hasDefaultView = true;
FSIterator it = jcas.getJFSIndexRepository().getAnnotationIndex(
- SourceDocumentInformation.type).iterator();
+ SourceDocumentInformation.type).iterator();
if (it.hasNext()) {
// get the output file name from the annotation in the CAS ...
// ... note this is a little flakey if processing an XCAS file,
@@ -186,9 +186,9 @@
*/
public static CasConsumerDescription getDescription() throws InvalidXMLException {
InputStream descStream = InlineXmlCasConsumer.class
- .getResourceAsStream("InlineXmlCasConsumer.xml");
+ .getResourceAsStream("InlineXmlCasConsumer.xml");
return UIMAFramework.getXMLParser().parseCasConsumerDescription(
- new XMLInputSource(descStream, null));
+ new XMLInputSource(descStream, null));
}
}
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/InstrumentationFacility.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/InstrumentationFacility.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/InstrumentationFacility.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/InstrumentationFacility.java Tue Nov 28 14:25:39 2006
@@ -85,5 +85,5 @@
* @return the new event
*/
public void addEvent(String aResourceName, String aType, String aDescription, int aDuration,
- String aResultMsg);
+ String aResultMsg);
}
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/InvalidXMLException.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/InvalidXMLException.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/InvalidXMLException.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/InvalidXMLException.java Tue Nov 28 14:25:39 2006
@@ -169,7 +169,7 @@
* the original exception that caused this exception to be thrown, if any
*/
public InvalidXMLException(String aResourceBundleName, String aMessageKey, Object[] aArguments,
- Throwable aCause) {
+ Throwable aCause) {
super(aResourceBundleName, aMessageKey, aArguments, aCause);
}
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/JCasPool.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/JCasPool.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/JCasPool.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/JCasPool.java Tue Nov 28 14:25:39 2006
@@ -77,7 +77,7 @@
* {@link #JCasPool(int, AnalysisEngine)} instead.
*/
public JCasPool(int aNumInstances, TextAnalysisEngine aTextAnalysisEngine)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
mNumInstances = aNumInstances;
fillPool(aTextAnalysisEngine.getAnalysisEngineMetaData());
@@ -96,7 +96,7 @@
* if the JCas instances could not be created
*/
public JCasPool(int aNumInstances, AnalysisEngine aAnalysisEngine)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
mNumInstances = aNumInstances;
fillPool(aAnalysisEngine.getAnalysisEngineMetaData());
@@ -114,7 +114,7 @@
* if the CAS instances could not be created
*/
public JCasPool(int aNumInstances, ProcessingResourceMetaData aMetaData)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
mNumInstances = aNumInstances;
fillPool(aMetaData);
@@ -148,7 +148,7 @@
// make sure this CAS actually belongs to this pool and is checked out
if (!mAllInstances.contains(aJCas) || mFreeInstances.contains(aJCas)) {
UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(), "releaseJCas",
- LOG_RESOURCE_BUNDLE, "UIMA_return_jcas_to_pool__WARNING");
+ LOG_RESOURCE_BUNDLE, "UIMA_return_jcas_to_pool__WARNING");
} else {
// reset CAS
aJCas.reset();
@@ -205,7 +205,7 @@
* if the Resource instances could not be created
*/
protected void fillPool(ProcessingResourceMetaData aMetaData)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
// fill the pool
ArrayList mdList = new ArrayList();
mdList.add(aMetaData);
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/Logger.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/Logger.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/Logger.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/Logger.java Tue Nov 28 14:25:39 2006
@@ -153,7 +153,7 @@
* message key
*/
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName,
- String msgKey);
+ String msgKey);
/**
* Logs a message with a message key and one parameter. The real message is extracted from a
@@ -173,7 +173,7 @@
* message parameter
*/
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName,
- String msgKey, Object param1);
+ String msgKey, Object param1);
/**
* Logs a message with a message key and an arbitrary number of parameters. The real message is
@@ -193,7 +193,7 @@
* message parameter array with an arbitrary number of parameters
*/
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName,
- String msgKey, Object[] params);
+ String msgKey, Object[] params);
/**
* Logs a message with a message key and a throwable object. The real message is extracted from a
@@ -213,7 +213,7 @@
* throwable object
*/
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName,
- String msgKey, Throwable thrown);
+ String msgKey, Throwable thrown);
/**
* Checks if the argument level is greater or equal to the specified level
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/NameClassPair.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/NameClassPair.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/NameClassPair.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/NameClassPair.java Tue Nov 28 14:25:39 2006
@@ -36,7 +36,7 @@
* A class name
*/
private String mClassName;
-
+
/**
* Creates a new <code>NameClassPair</code> with the specified name and class.
*
@@ -81,10 +81,10 @@
NameClassPair that = (NameClassPair) aObj;
boolean nameMatch = this.getName() == null ? that.getName() == null : this.getName().equals(
- that.getName());
+ that.getName());
boolean classNameMatch = this.getClassName() == null ? that.getClassName() == null : this
- .getClassName().equals(that.getClassName());
+ .getClassName().equals(that.getClassName());
return nameMatch && classNameMatch;
}
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/ProcessTrace.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/ProcessTrace.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/ProcessTrace.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/ProcessTrace.java Tue Nov 28 14:25:39 2006
@@ -86,7 +86,7 @@
* result message of event
*/
public void addEvent(String aResourceName, String aType, String aDescription, int aDuration,
- String aResultMsg);
+ String aResultMsg);
/**
* Adds a completed event object to this <code>ProcessTrace</code>. This method is useful for
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/RunAE.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/RunAE.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/RunAE.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/RunAE.java Tue Nov 28 14:25:39 2006
@@ -126,23 +126,23 @@
// create and configure collection reader that will read input docs
CollectionReaderDescription collectionReaderDesc = FileSystemCollectionReader
- .getDescription();
+ .getDescription();
ConfigurationParameterSettings paramSettings = collectionReaderDesc.getMetaData()
- .getConfigurationParameterSettings();
+ .getConfigurationParameterSettings();
paramSettings.setParameterValue(FileSystemCollectionReader.PARAM_INPUTDIR, inputDir
- .getAbsolutePath());
+ .getAbsolutePath());
paramSettings.setParameterValue(FileSystemCollectionReader.PARAM_ENCODING, encoding);
paramSettings.setParameterValue(FileSystemCollectionReader.PARAM_LANGUAGE, language);
paramSettings.setParameterValue(FileSystemCollectionReader.PARAM_XCAS, Boolean
- .toString(xcasInput));
+ .toString(xcasInput));
CollectionReader collectionReader = UIMAFramework
- .produceCollectionReader(collectionReaderDesc);
+ .produceCollectionReader(collectionReaderDesc);
// if XML tag was specified, also create SimpleXmlCasInitializer to handle this
if (xmlTagName != null && xmlTagName.length() > 0) {
CasInitializerDescription casIniDesc = SimpleXmlCasInitializer.getDescription();
ConfigurationParameterSettings casIniParamSettings = casIniDesc.getMetaData()
- .getConfigurationParameterSettings();
+ .getConfigurationParameterSettings();
casIniParamSettings.setParameterValue(SimpleXmlCasInitializer.PARAM_XMLTAG, xmlTagName);
CasInitializer casInitializer = UIMAFramework.produceCasInitializer(casIniDesc);
collectionReader.setCasInitializer(casInitializer);
@@ -152,11 +152,11 @@
if (outputDir != null) {
CasConsumerDescription casConsumerDesc = InlineXmlCasConsumer.getDescription();
ConfigurationParameterSettings consumerParamSettings = casConsumerDesc.getMetaData()
- .getConfigurationParameterSettings();
+ .getConfigurationParameterSettings();
consumerParamSettings.setParameterValue(InlineXmlCasConsumer.PARAM_OUTPUTDIR, outputDir
- .getAbsolutePath());
+ .getAbsolutePath());
consumerParamSettings.setParameterValue(InlineXmlCasConsumer.PARAM_XCAS, Boolean
- .toString(xcasInput));
+ .toString(xcasInput));
mCPM.addCasConsumer(UIMAFramework.produceCasConsumer(casConsumerDesc));
}
@@ -190,7 +190,7 @@
// (it was put there by the FileSystemCollectionReader)
if (!xcasInput) {
Type fileLocType = aCas.getTypeSystem().getType(
- "org.apache.uima.examples.SourceDocumentInformation");
+ "org.apache.uima.examples.SourceDocumentInformation");
Feature fileNameFeat = fileLocType.getFeatureByBaseName("uri");
FSIterator it = aCas.getAnnotationIndex(fileLocType).iterator();
FeatureStructure fileLoc = it.get();
@@ -223,7 +223,7 @@
// output performance stats
if (statsLevel > 0) {
AnalysisEnginePerformanceReports performanceReports = new AnalysisEnginePerformanceReports(
- mCPM.getPerformanceReport());
+ mCPM.getPerformanceReport());
System.out.println("\n\nPERFORMANCE STATS\n-----------------\n\n");
if (statsLevel > 1) {
System.out.println(performanceReports.getFullReport());
@@ -250,21 +250,20 @@
*/
private void printUsageMessage() {
System.err.println("\nUsage: java " + this.getClass().getName()
- + " [OPTIONS] <AE descriptor or JAR file name> <input dir> [<output dir>] ");
+ + " [OPTIONS] <AE descriptor or JAR file name> <input dir> [<output dir>] ");
System.err.println("\nIf <output dir> is not specified, the analysis "
- + "results will not be output. This can be useful when only interested "
- + "in performance statistics.");
+ + "results will not be output. This can be useful when only interested "
+ + "in performance statistics.");
System.err.println("\nOPTIONS\n-------");
System.err.println("-t <TagName> (XML Text Tag) - specifies the name of "
- + "an XML tag, found within the input documents, that contains the text "
- + "to be analyzed. Documents not containing this tag will not be "
- + "processed. If this option is not specified, the entire document text "
- + "will be processed.");
+ + "an XML tag, found within the input documents, that contains the text "
+ + "to be analyzed. Documents not containing this tag will not be "
+ + "processed. If this option is not specified, the entire document text "
+ + "will be processed.");
System.err.println("-q (Quiet) - supresses progress messages that are "
- + "normally printed as each document is processed.");
- System.err
- .println("-s<x> (Stats level) - determines the verboseness of "
- + "performance statistics. s0=none, s1=brief, s2=full. The default is brief.");
+ + "normally printed as each document is processed.");
+ System.err.println("-s<x> (Stats level) - determines the verboseness of "
+ + "performance statistics. s0=none, s1=brief, s2=full. The default is brief.");
System.err.println("-x - process input files as XCAS files.");
}
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/SimpleResourceFactory.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/SimpleResourceFactory.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/SimpleResourceFactory.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/SimpleResourceFactory.java Tue Nov 28 14:25:39 2006
@@ -64,7 +64,7 @@
* first.
*/
protected Map mClassMap = Collections.synchronizedMap(new HashMap());
-
+
/**
* Produces an appropriate <code>Resource</code> instance from a <code>ResourceSpecifier</code>.
*
@@ -87,7 +87,7 @@
* @see org.apache.uima.ResourceFactory#produceResource(Class, ResourceSpecifier,Map)
*/
public Resource produceResource(Class aResourceClass, ResourceSpecifier aSpecifier,
- Map aAdditionalParams) throws ResourceInitializationException {
+ Map aAdditionalParams) throws ResourceInitializationException {
ResourceInitializationException lastException = null;
// get all interfaces implemented by aSpecifier
@@ -116,8 +116,8 @@
Resource resource = (Resource) currentClass.newInstance();
// attempt to initialize it
UIMAFramework.getLogger(CLASS_NAME).logrb(Level.CONFIG, CLASS_NAME.getName(),
- "produceResource", LOG_RESOURCE_BUNDLE,
- "UIMA_trying_resource_class__CONFIG", currentClass.getName());
+ "produceResource", LOG_RESOURCE_BUNDLE, "UIMA_trying_resource_class__CONFIG",
+ currentClass.getName());
if (resource.initialize(aSpecifier, aAdditionalParams)) {
// success!
@@ -128,17 +128,16 @@
// if an exception occurs, log it but do not throw it... yet
catch (IllegalAccessException e) {
currentException = new ResourceInitializationException(
- ResourceInitializationException.COULD_NOT_INSTANTIATE, new Object[] {
- currentClass.getName(), aSpecifier.getSourceUrlString() }, e);
+ ResourceInitializationException.COULD_NOT_INSTANTIATE, new Object[] {
+ currentClass.getName(), aSpecifier.getSourceUrlString() }, e);
} catch (InstantiationException e) {
currentException = new ResourceInitializationException(
- ResourceInitializationException.COULD_NOT_INSTANTIATE, new Object[] {
- currentClass.getName(), aSpecifier.getSourceUrlString() }, e);
+ ResourceInitializationException.COULD_NOT_INSTANTIATE, new Object[] {
+ currentClass.getName(), aSpecifier.getSourceUrlString() }, e);
} catch (Throwable t) {
currentException = new ResourceInitializationException(
- ResourceInitializationException.ERROR_INITIALIZING_FROM_DESCRIPTOR,
- new Object[] { currentClass.getName(), aSpecifier.getSourceUrlString() },
- t);
+ ResourceInitializationException.ERROR_INITIALIZING_FROM_DESCRIPTOR, new Object[] {
+ currentClass.getName(), aSpecifier.getSourceUrlString() }, t);
} finally {
if (currentException != null) {
currentException.fillInStackTrace();
@@ -193,7 +192,7 @@
* resource specifiers of the given class.
*/
public void addMapping(String aSpecifierInterfaceName, String aResourceClassName)
- throws ClassNotFoundException {
+ throws ClassNotFoundException {
addMapping(Class.forName(aSpecifierInterfaceName), Class.forName(aResourceClassName));
}
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/SimpleXmlCasInitializer.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/SimpleXmlCasInitializer.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/SimpleXmlCasInitializer.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/SimpleXmlCasInitializer.java Tue Nov 28 14:25:39 2006
@@ -87,7 +87,7 @@
inputSource = new InputSource((InputStream) aObj);
} else {
throw new CollectionException(CollectionException.INCORRECT_INPUT_TO_CAS_INITIALIZER,
- new Object[] { InputStream.class.getName(), aObj.getClass().getName() });
+ new Object[] { InputStream.class.getName(), aObj.getClass().getName() });
}
// create SAX ContentHandler that populates CAS
SaxHandler handler = new SaxHandler(aCAS);
@@ -113,9 +113,9 @@
*/
public static CasInitializerDescription getDescription() throws InvalidXMLException {
InputStream descStream = SimpleXmlCasInitializer.class
- .getResourceAsStream("SimpleXmlCasInitializer.xml");
+ .getResourceAsStream("SimpleXmlCasInitializer.xml");
return UIMAFramework.getXMLParser().parseCasInitializerDescription(
- new XMLInputSource(descStream, null));
+ new XMLInputSource(descStream, null));
}
/**
@@ -143,7 +143,7 @@
* java.lang.String, org.xml.sax.Attributes)
*/
public void startElement(String uri, String localName, String qName, Attributes attributes)
- throws SAXException {
+ throws SAXException {
if (mInsideTextTag) {
mBuf.append('<').append(qName).append('>');
} else if (qName.equalsIgnoreCase(mXmlTagContainingText)) {
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TCasPool.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TCasPool.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TCasPool.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TCasPool.java Tue Nov 28 14:25:39 2006
@@ -54,13 +54,12 @@
*/
private static final Class CLASS_NAME = TCasPool.class;
-
private Vector mAllInstances = new Vector();
private Vector mFreeInstances = new Vector();
private int mNumInstances;
-
+
/**
* Creates a new TCasPool
*
@@ -77,7 +76,7 @@
* {@link #TCasPool(int, AnalysisEngine)} instead.
*/
public TCasPool(int aNumInstances, TextAnalysisEngine aTextAnalysisEngine)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
mNumInstances = aNumInstances;
fillPool(aTextAnalysisEngine.getAnalysisEngineMetaData());
@@ -96,7 +95,7 @@
* if the TCAS instances could not be created
*/
public TCasPool(int aNumInstances, AnalysisEngine aAnalysisEngine)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
mNumInstances = aNumInstances;
fillPool(aAnalysisEngine.getAnalysisEngineMetaData());
@@ -114,7 +113,7 @@
* if the CAS instances could not be created
*/
public TCasPool(int aNumInstances, ProcessingResourceMetaData aMetaData)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
mNumInstances = aNumInstances;
fillPool(aMetaData);
@@ -165,7 +164,7 @@
// make sure this CAS actually belongs to this pool and is checked out
if (!mAllInstances.contains(aTCas) || mFreeInstances.contains(aTCas)) {
UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(), "releaseTCas",
- LOG_RESOURCE_BUNDLE, "UIMA_return_tcas_to_pool__WARNING");
+ LOG_RESOURCE_BUNDLE, "UIMA_return_tcas_to_pool__WARNING");
} else {
// reset CAS
aTCas.reset();
@@ -222,7 +221,7 @@
* if the Resource instances could not be created
*/
protected void fillPool(ProcessingResourceMetaData aMetaData)
- throws ResourceInitializationException {
+ throws ResourceInitializationException {
// create first CAS from metadata
ArrayList mdList = new ArrayList();
mdList.add(aMetaData);
@@ -232,7 +231,7 @@
// create additional CASes that share same type system
for (int i = 1; i < mNumInstances; i++) {
TCAS c = CasCreationUtils.createTCas(c0.getTypeSystem(), aMetaData.getTypePriorities(),
- aMetaData.getFsIndexes());
+ aMetaData.getFsIndexes());
mAllInstances.add(c);
mFreeInstances.add(c);
}
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TCasToInlineXml.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TCasToInlineXml.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TCasToInlineXml.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TCasToInlineXml.java Tue Nov 28 14:25:39 2006
@@ -143,9 +143,8 @@
try {
handler.characters(docCharArray, pos, nextAnnot.getBegin() - pos);
pos = nextAnnot.getBegin();
- handler
- .startElement("", nextAnnot.getType().getName(), nextAnnot.getType()
- .getName(), getFeatureAttributes(nextAnnot, aTCAS));
+ handler.startElement("", nextAnnot.getType().getName(),
+ nextAnnot.getType().getName(), getFeatureAttributes(nextAnnot, aTCAS));
// push parent annotation on stack
stack.add(curAnnot);
@@ -153,7 +152,7 @@
curAnnot = nextAnnot;
} catch (StringIndexOutOfBoundsException e) {
System.err.println("Invalid annotation range: " + nextAnnot.getBegin() + ","
- + nextAnnot.getEnd() + " in document of length " + docText.length());
+ + nextAnnot.getEnd() + " in document of length " + docText.length());
}
}
iterator.moveToNext();
@@ -165,7 +164,7 @@
pos = curAnnot.getEnd();
} catch (StringIndexOutOfBoundsException e) {
System.err.println("Invalid annotation range: " + curAnnot.getBegin() + ","
- + curAnnot.getEnd() + " in document of length " + docText.length());
+ + curAnnot.getEnd() + " in document of length " + docText.length());
}
handler.endElement("", curAnnot.getType().getName(), curAnnot.getType().getName());
@@ -181,7 +180,7 @@
pos = curAnnot.getEnd();
} catch (StringIndexOutOfBoundsException e) {
System.err.println("Invalid annotation range: " + curAnnot.getBegin() + ","
- + curAnnot.getEnd() + "in document of length " + docText.length());
+ + curAnnot.getEnd() + "in document of length " + docText.length());
}
handler.endElement("", curAnnot.getType().getName(), curAnnot.getType().getName());
@@ -195,7 +194,7 @@
pos = curAnnot.getEnd();
} catch (StringIndexOutOfBoundsException e) {
System.err.println("Invalid annotation range: " + curAnnot.getBegin() + ","
- + curAnnot.getEnd() + "in document of length " + docText.length());
+ + curAnnot.getEnd() + "in document of length " + docText.length());
}
handler.endElement("", curAnnot.getType().getName(), curAnnot.getType().getName());
}
@@ -227,7 +226,7 @@
// how we get feature value depends on feature's range type)
String rangeTypeName = feat.getRange().getName();
if (aTCAS.getTypeSystem().subsumes(stringType, feat.getRange())) // must check for subtypes
- // of string
+ // of string
{
String str = aFS.getStringValue(feat);
if (str == null) {
@@ -240,12 +239,12 @@
}
} else if (CAS.TYPE_NAME_INTEGER.equals(rangeTypeName)) {
attrs
- .addAttribute("", featName, featName, "CDATA", Integer.toString(aFS
- .getIntValue(feat)));
+ .addAttribute("", featName, featName, "CDATA", Integer.toString(aFS
+ .getIntValue(feat)));
} else if (CAS.TYPE_NAME_FLOAT.equals(rangeTypeName)) {
attrs
- .addAttribute("", featName, featName, "CDATA", Float.toString(aFS
- .getFloatValue(feat)));
+ .addAttribute("", featName, featName, "CDATA", Float.toString(aFS
+ .getFloatValue(feat)));
} else if (CAS.TYPE_NAME_STRING_ARRAY.equals(rangeTypeName)) {
StringArrayFS arrayFS = (StringArrayFS) aFS.getFeatureValue(feat);
if (arrayFS == null) {
@@ -329,8 +328,8 @@
private void replaceInvalidXmlChars(char[] aChars) {
for (int i = 0; i < aChars.length; i++) {
if ((aChars[i] < 0x20 && aChars[i] != 0x09 && aChars[i] != 0x0A && aChars[i] != 0x0D)
- || (aChars[i] > 0xD7FF && aChars[i] < 0xE000) || aChars[i] == 0xFFFE
- || aChars[i] == 0xFFFF) {
+ || (aChars[i] > 0xD7FF && aChars[i] < 0xE000) || aChars[i] == 0xFFFE
+ || aChars[i] == 0xFFFF) {
// System.out.println("Found invalid XML character: " + (int)aChars[i] + " at position " +
// i); //temp
aChars[i] = ' ';
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TypeSystemUtil.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TypeSystemUtil.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TypeSystemUtil.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TypeSystemUtil.java Tue Nov 28 14:25:39 2006
@@ -111,7 +111,7 @@
*/
public static FeatureDescription feature2FeatureDescription(Feature aFeature) {
FeatureDescription featDesc = UIMAFramework.getResourceSpecifierFactory()
- .createFeatureDescription();
+ .createFeatureDescription();
featDesc.setName(aFeature.getShortName());
featDesc.setRangeTypeName(aFeature.getRange().getName());
return featDesc;
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/XCasWriterCasConsumer.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/XCasWriterCasConsumer.java?view=diff&rev=480252&r1=480251&r2=480252
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/XCasWriterCasConsumer.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/XCasWriterCasConsumer.java Tue Nov 28 14:25:39 2006
@@ -96,7 +96,7 @@
// retreive the filename of the input file from the CAS
FSIterator it = jcas.getJFSIndexRepository().getAnnotationIndex(SourceDocumentInformation.type)
- .iterator();
+ .iterator();
File outFile = null;
if (it.hasNext()) {
SourceDocumentInformation fileLoc = (SourceDocumentInformation) it.next();
@@ -164,9 +164,9 @@
*/
public static CasConsumerDescription getDescription() throws InvalidXMLException {
InputStream descStream = XCasWriterCasConsumer.class
- .getResourceAsStream("XCasWriterCasConsumer.xml");
+ .getResourceAsStream("XCasWriterCasConsumer.xml");
return UIMAFramework.getXMLParser().parseCasConsumerDescription(
- new XMLInputSource(descStream, null));
+ new XMLInputSource(descStream, null));
}
}