protected JvmGenericArrayTypeReference array(JvmTypeReference typeRef, int i) {
   JvmGenericArrayTypeReference result =
       TypesFactory.eINSTANCE.createJvmGenericArrayTypeReference();
   result.setComponentType(typeRef);
   if (i != 1) {
     result = array(result, i - 1);
   }
   return result;
 }
 protected void convertListToArray(
     final JvmTypeReference arrayTypeReference,
     final ITreeAppendable appendable,
     XExpression context,
     final Later expression) {
   appendable.append("((");
   serialize(arrayTypeReference, context, appendable);
   appendable.append(")");
   JvmTypeReference conversions = getTypeReferences().getTypeForName(Conversions.class, context);
   serialize(conversions, context, appendable);
   appendable.append(".unwrapArray(");
   expression.exec(appendable);
   JvmGenericArrayTypeReference rawTypeArrayReference =
       (JvmGenericArrayTypeReference)
           rawTypeHelper.getRawTypeReference(arrayTypeReference, context.eResource());
   appendable.append(", ");
   serialize(rawTypeArrayReference.getComponentType(), context, appendable);
   appendable.append(".class))");
 }
Beispiel #3
0
 public JvmGenericArrayTypeReference createArrayType(JvmTypeReference componentType) {
   JvmGenericArrayTypeReference result = factory.createJvmGenericArrayTypeReference();
   result.setComponentType(EcoreUtil2.cloneIfContained(componentType));
   return result;
 }
 protected void appendParameters(
     final StringBuilder result,
     final JvmExecutable executable,
     final int insignificantParameters,
     final LightweightTypeReferenceFactory ownedConverter) {
   final EList<JvmFormalParameter> declaredParameters = executable.getParameters();
   int _size = declaredParameters.size();
   int _min = Math.min(insignificantParameters, _size);
   int _size_1 = declaredParameters.size();
   final List<JvmFormalParameter> relevantParameters = declaredParameters.subList(_min, _size_1);
   for (int i = 0; (i < relevantParameters.size()); i++) {
     {
       final JvmFormalParameter parameter = relevantParameters.get(i);
       if ((i != 0)) {
         result.append(", ");
       }
       boolean _and = false;
       boolean _and_1 = false;
       int _size_2 = relevantParameters.size();
       int _minus = (_size_2 - 1);
       boolean _equals = (i == _minus);
       if (!_equals) {
         _and_1 = false;
       } else {
         boolean _isVarArgs = executable.isVarArgs();
         _and_1 = _isVarArgs;
       }
       if (!_and_1) {
         _and = false;
       } else {
         JvmTypeReference _parameterType = parameter.getParameterType();
         _and = (_parameterType instanceof JvmGenericArrayTypeReference);
       }
       if (_and) {
         JvmTypeReference _parameterType_1 = parameter.getParameterType();
         final JvmGenericArrayTypeReference parameterType =
             ((JvmGenericArrayTypeReference) _parameterType_1);
         JvmTypeReference _componentType = parameterType.getComponentType();
         LightweightTypeReference _lightweightReference =
             ownedConverter.toLightweightReference(_componentType);
         String _humanReadableName = _lightweightReference.getHumanReadableName();
         result.append(_humanReadableName);
         result.append("...");
       } else {
         JvmTypeReference _parameterType_2 = parameter.getParameterType();
         boolean _notEquals = (!Objects.equal(_parameterType_2, null));
         if (_notEquals) {
           JvmTypeReference _parameterType_3 = parameter.getParameterType();
           LightweightTypeReference _lightweightReference_1 =
               ownedConverter.toLightweightReference(_parameterType_3);
           final String simpleName = _lightweightReference_1.getHumanReadableName();
           boolean _notEquals_1 = (!Objects.equal(simpleName, null));
           if (_notEquals_1) {
             result.append(simpleName);
           }
         }
       }
       result.append(" ");
       String _name = parameter.getName();
       String _valueOf = String.valueOf(_name);
       result.append(_valueOf);
     }
   }
 }