@Override public void setConfigParameterValue(String aParamName, Object aValue) { configParams.setParameterValue(aParamName, aValue); }
private static AllowedValue[] getAllowedValues(TypeDescription type) { AllowedValue[] r = type.getAllowedValues(); if (r == null) { return new AllowedValue[0]; } return r; }
/** * @see org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData#getFsIndexes() */ public FsIndexDescription[] getFsIndexes() { return mFsIndexCollection == null ? null : mFsIndexCollection.getFsIndexes(); }
private void inferFeatureMap(TypeDescription type) { // 1 - Recursively add features of the super type TypeDescription superType = typeSystemDescription.getType(type.getSupertypeName()); if(superType != null) inferFeatureMap(superType); // 2 - Add features of this type for(FeatureDescription feature:type.getFeatures()) { String featureFQN = type.getName() + ":" + feature.getName(); featureMap.put(feature.getName(), featureFQN); featureMap.put(featureFQN, featureFQN); } }
@Override public void generateFeature(TypeSystemDescription aTSD, TypeDescription aTD, AnnotationFeature aFeature) { // Link type TypeDescription linkTD = aTSD.addType(aFeature.getLinkTypeName(), "", CAS.TYPE_NAME_TOP); linkTD.addFeature(aFeature.getLinkTypeRoleFeatureName(), "", CAS.TYPE_NAME_STRING); linkTD.addFeature(aFeature.getLinkTypeTargetFeatureName(), "", aFeature.getType()); // Link feature aTD.addFeature(aFeature.getName(), "", CAS.TYPE_NAME_FS_ARRAY, linkTD.getName(), false); }
private void addConfigIntParameter(String aParamName, int aParamValue) { ConfigurationParameter cp = new ConfigurationParameter_impl(); cp.setMandatory(false); cp.setMultiValued(false); cp.setName(aParamName); cp.setType("Integer"); getAnalysisEngineMetadata().getConfigurationParameterDeclarations().addConfigurationParameter( cp); getAnalysisEngineMetadata().getConfigurationParameterSettings().setParameterValue(aParamName, aParamValue); }
/** * Checks if is imported allowed value. * * @param td the td * @param av the av * @return true, if is imported allowed value */ protected boolean isImportedAllowedValue(TypeDescription td, AllowedValue av) { TypeDescription importedTd = editor.getImportedTypeSystemDesription().getType(td.getName()); if (null == importedTd) return false; return null != getAllowedValue(av.getString(), importedTd); }
/** * @see org.apache.uima.resource.ConfigurableResource#getConfigParameterValue(java.lang.String) */ public Object getConfigParameterValue(String aParamName) { return getMetaData().getConfigurationParameterSettings().getParameterValue(aParamName); }
/** * Fixup cpd. */ private void fixupCpd() { if (null == cpd.getConfigurationParameters()) cpd.setConfigurationParameters(AbstractSection.configurationParameterArray0); if (null == cpd.getCommonParameters()) cpd.setCommonParameters(AbstractSection.configurationParameterArray0); if (null == cpd.getConfigurationGroups()) cpd.setConfigurationGroups(AbstractSection.configurationGroupArray0); ConfigurationGroup[] cgs = cpd.getConfigurationGroups(); for (int i = 0; i < cgs.length; i++) { if (null == cgs[i].getConfigurationParameters()) cgs[i].setConfigurationParameters(AbstractSection.configurationParameterArray0); } }
public void resolveImports(ResourceManager aResourceManager) throws InvalidXMLException { if (getTypeSystem() != null) { getTypeSystem().resolveImports(aResourceManager); } if (getTypePriorities() != null) { getTypePriorities().resolveImports(aResourceManager); } if (getFsIndexCollection() != null) { getFsIndexCollection().resolveImports(aResourceManager); } }
@Override public Object getConfigParameterValue(String aGroupName, String aParamName) { return configParams.getParameterValue(aGroupName, aParamName); }
/** * Returns true. By contract, CAS Consumers must be read only. * * @see org.apache.uima.collection.base_cpm.CasProcessor#isReadOnly() */ public final boolean isReadOnly() { OperationalProperties opProps = getProcessingResourceMetaData().getOperationalProperties(); return opProps == null ? true : !opProps.getModifiesCas(); }
@Override public void generateFeature(TypeSystemDescription aTSD, TypeDescription aTD, AnnotationFeature aFeature) { // Link type TypeDescription linkTD = aTSD.addType(aFeature.getLinkTypeName(), "", CAS.TYPE_NAME_TOP); linkTD.addFeature(aFeature.getLinkTypeRoleFeatureName(), "", CAS.TYPE_NAME_STRING); linkTD.addFeature(aFeature.getLinkTypeTargetFeatureName(), "", aFeature.getType()); // Link feature aTD.addFeature(aFeature.getName(), "", CAS.TYPE_NAME_FS_ARRAY, linkTD.getName(), false); }
/** * Gets the local type definition. * * @param td the td * @return the local type definition */ protected TypeDescription getLocalTypeDefinition(TypeDescription td) { TypeSystemDescription tsdLocal = getTypeSystemDescription(); if (null == tsdLocal) return null; return tsdLocal.getType(td.getName()); }
/** * @see org.apache.uima.resource.ConfigurableResource#getConfigParameterValue(java.lang.String, * java.lang.String) */ public Object getConfigParameterValue(String aGroupName, String aParamName) { return getMetaData().getConfigurationParameterSettings().getParameterValue(aGroupName, aParamName); }
@Override public void setConfigParameterValue(String aGroupName, String aParamName, Object aValue) { configParams.setParameterValue(aGroupName, aParamName, aValue); }
@Override public Object getConfigParameterValue(String aParamName) { return configParams.getParameterValue(aParamName); }
@Override public void generateFeature(TypeSystemDescription aTSD, TypeDescription aTD, AnnotationFeature aFeature) { // Link type TypeDescription linkTD = aTSD.addType(aFeature.getLinkTypeName(), "", CAS.TYPE_NAME_TOP); linkTD.addFeature(aFeature.getLinkTypeRoleFeatureName(), "", CAS.TYPE_NAME_STRING); linkTD.addFeature(aFeature.getLinkTypeTargetFeatureName(), "", aFeature.getType()); // Link feature aTD.addFeature(aFeature.getName(), "", CAS.TYPE_NAME_FS_ARRAY, linkTD.getName(), false); }