/** * @return the string describing a metamodel type, for debug / exception purposes */ private String typeStr(Type type) { return type.getTypename() == null ? "(null)" : type.getTypename(); }
private void gatherPathSegment(Type segmentType, String srcName, String trgName, PatternModelAcceptor<?> acceptor) throws SpecificationBuilderException { if (segmentType instanceof ReferenceType) { // EMF-specific EStructuralFeature typeObject = ((ReferenceType) segmentType).getRefname(); acceptor.acceptTypeConstraint(ImmutableList.of(srcName, trgName), new EStructuralFeatureInstancesKey(typeObject)); } else throw new SpecificationBuilderException("Unsupported path segment type {1} in pattern {2}: {3}", new String[] { segmentType.eClass().getName(), patternFQN, typeStr(segmentType) }, "Unsupported navigation step", pattern); }
} else { throw new SpecificationBuilderException("Unsupported path expression head type {1} in pattern {2}: {3}", new String[] { headType.eClass().getName(), patternFQN, typeStr(headType) }, "Unsupported navigation source", pattern);