protected int internalGetPrimitiveKindFromWrapper(JvmGenericType type) { String name = type.getIdentifier(); switch (name.length()) { case 17:
private Primitive getPrimitiveKind(JvmGenericType type) { if (type.eIsProxy()) return null; String name = type.getIdentifier(); switch (name.length()) { case 17:
private boolean isAppendComparisonFunctionsEnable(GenerationContext context, JvmGenericType target) { if (context.getGeneratorConfig2().isGenerateEqualityTestFunctions()) { JvmGenericType current = target; final Set<String> encounteredTypes = new TreeSet<>(); do { encounteredTypes.add(current.getIdentifier()); if (this.annotationFinder.findAnnotation(current, NoEqualityTestFunctionsGeneration.class) != null) { return false; } final JvmTypeReference superType = current.getExtendedClass(); current = null; if (superType != null) { final JvmType type = superType.getType(); if (type instanceof JvmGenericType) { current = (JvmGenericType) type; if (encounteredTypes.contains(current.getIdentifier())) { current = null; } } } } while (current != null); return true; } return false; }
public JvmParameterizedTypeReference createTypeRef(final JvmType type, final JvmTypeReference... typeArgs) { if ((type == null)) { throw new NullPointerException("type"); } final JvmParameterizedTypeReference reference = TypesFactory.eINSTANCE.createJvmParameterizedTypeReference(); reference.setType(type); for (final JvmTypeReference typeArg : typeArgs) { reference.getArguments().add(EcoreUtil2.<JvmTypeReference>cloneIfContained(typeArg)); } if ((type instanceof JvmGenericType)) { final EList<JvmTypeParameter> list = ((JvmGenericType)type).getTypeParameters(); if (((!reference.getArguments().isEmpty()) && (list.size() != reference.getArguments().size()))) { String _identifier = ((JvmGenericType)type).getIdentifier(); String _plus = ("The type " + _identifier); String _plus_1 = (_plus + " expects "); int _size = list.size(); String _plus_2 = (_plus_1 + Integer.valueOf(_size)); String _plus_3 = (_plus_2 + " type arguments, but was "); int _size_1 = reference.getArguments().size(); String _plus_4 = (_plus_3 + Integer.valueOf(_size_1)); String _plus_5 = (_plus_4 + ". Either pass zero arguments (raw type) or the correct number."); throw new IllegalArgumentException(_plus_5); } } return reference; }
/** Generate the implemented types for the given SARL statement. * * @param context the context of the generation. * @param owner the JVM element to change. * @param defaultJvmType the default JVM type. * @param defaultSarlType the default SARL type. * @param implementedtypes the implemented types. */ protected void appendConstrainedImplements( GenerationContext context, JvmGenericType owner, Class<?> defaultJvmType, Class<? extends XtendTypeDeclaration> defaultSarlType, List<? extends JvmParameterizedTypeReference> implementedtypes) { boolean explicitType = false; for (final JvmParameterizedTypeReference superType : implementedtypes) { if (!Objects.equal(owner.getIdentifier(), superType.getIdentifier()) && superType.getType() instanceof JvmGenericType /*&& this.inheritanceHelper.isProxyOrSubTypeOf(superType, defaultJvmType, defaultSarlType, true)*/) { owner.getSuperTypes().add(this.typeBuilder.cloneWithProxies(superType)); context.incrementSerial(superType.getIdentifier().hashCode()); explicitType = true; } } if (!explicitType) { final JvmTypeReference type = this._typeReferenceBuilder.typeRef(defaultJvmType); owner.getSuperTypes().add(type); context.incrementSerial(type.getIdentifier().hashCode()); } }
actionContainer.getIdentifier(), ((InferredValuedParameter) parameterSpec).getCallingArgument())); arguments.add(argumentValue.toString());
List<? extends JvmParameterizedTypeReference> supertypes) { boolean explicitType = false; final String ownerId = owner.getIdentifier(); for (final JvmParameterizedTypeReference superType : supertypes) { String superTypeId;
_matched=true; JvmAnnotationValue _switchResult_1 = null; String _identifier = ((JvmGenericType)type).getIdentifier(); boolean _matched_1 = false; String _name = String.class.getName();