/** * @see TypeSystemMgr#addFeature(String, Type, Type) */ @Override public Feature addFeature(String featureName, Type domainType, Type rangeType, boolean multipleReferencesAllowed) throws CASAdminException { // assert(featureName != null); // assert(domainType != null); // assert(rangeType != null); if (this.locked) { throw new CASAdminException(CASAdminException.TYPE_SYSTEM_LOCKED); } Feature f = domainType.getFeatureByBaseName(featureName); if (f != null && f.getRange().equals(rangeType)) { return f; } if (domainType.isFeatureFinal()) { CASAdminException e = new CASAdminException(CASAdminException.TYPE_IS_FEATURE_FINAL); e.addArgument(domainType.getName()); throw e; } checkFeatureNameSyntax(featureName); final int featCode = this.addFeature(featureName, ((TypeImpl) domainType).getCode(), ((TypeImpl) rangeType).getCode(), multipleReferencesAllowed); if (featCode < this.featureNameST.getStart()) { return null; } return this.features.get(featCode); }
if ((type.getName().startsWith("uima.cas") && type.isFeatureFinal()) || type.isArray()) { continue; // this indicates a primitive type