@Override public JvmDeclaredType createType(Class<?> clazz) { try { JvmDeclaredType cachedResult = typeCache.get(clazz); // the cached result contains proxies and is not // contained in a resource set. clone it since the // client of #createClass will usually put the result // into a resource and perform proxy resolution afterwards // in the context of a single resource set. return EcoreUtil2.cloneWithProxies(cachedResult); } catch (Exception e) { if (log.isDebugEnabled()) { log.debug(e.getMessage(), e); } return delegate.createType(clazz); } }
@Override public JvmDeclaredType createType(Class<?> clazz) { try { JvmDeclaredType cachedResult = get(clazz); // the cached result contains proxies and is not // contained in a resource set. clone it since the // client of #createClass will usually put the result // into a resource and perform proxy resolution afterwards // in the context of a single resource set. return EcoreUtil2.cloneWithProxies(cachedResult); } catch (Exception e) { if (log.isDebugEnabled()) { log.debug(e.getMessage(), e); } return delegate.createType(clazz); } }
@Override public JvmDeclaredType createType(BinaryClass clazz) { try { JvmDeclaredType cachedResult = get(clazz); // the cached result contains proxies and is not // contained in a resource set. clone it since the // client of #createClass will usually put the result // into a resource and perform proxy resolution afterwards // in the context of a single resource set. return EcoreUtil2.cloneWithProxies(cachedResult); } catch (Exception e) { if (log.isDebugEnabled()) { log.debug(e.getMessage(), e); } return delegate.createType(clazz); } }
protected void _setValue(final JvmAnnotationAnnotationValue it, final AnnotationReference[] value, final String componentType, final boolean mustBeArray) { this.checkType(it, componentType, mustBeArray); for (final AnnotationReference annotationValue : value) { boolean _matched = false; if (annotationValue instanceof JvmAnnotationReferenceImpl) { _matched=true; it.getValues().add(EcoreUtil2.<JvmAnnotationReference>cloneWithProxies(((JvmAnnotationReferenceImpl)annotationValue).getDelegate())); } if (!_matched) { if (annotationValue instanceof XtendAnnotationReferenceImpl) { _matched=true; throw new IllegalArgumentException("Multiple source annotations cannot be set as values. Please the the expression not the value."); } } } }
public AnnotationReference addAnnotation(final AnnotationReference annotationReference) { AnnotationReference _xblockexpression = null; { this.checkMutable(); Preconditions.checkArgument((annotationReference != null), "annotationReference cannot be null"); AnnotationReference _xifexpression = null; if ((annotationReference instanceof JvmAnnotationReferenceImpl)) { AnnotationReference _xblockexpression_1 = null; { final JvmAnnotationReference jvmAnnotationReference = EcoreUtil2.<JvmAnnotationReference>cloneWithProxies(((JvmAnnotationReferenceImpl)annotationReference).getDelegate()); EList<JvmAnnotationReference> _annotations = this.getDelegate().getAnnotations(); _annotations.add(jvmAnnotationReference); _xblockexpression_1 = this.getCompilationUnit().toAnnotationReference(jvmAnnotationReference); } _xifexpression = _xblockexpression_1; } else { StringConcatenation _builder = new StringConcatenation(); _builder.append(annotationReference); _builder.append(" is not annotation reference"); throw new IllegalArgumentException(_builder.toString()); } _xblockexpression = _xifexpression; } return _xblockexpression; }