Package rocket.generator.rebind.type

Examples of rocket.generator.rebind.type.Type


    // get the filename
    final String resourceName = this.getImageName(method);
    context.debug(resourceName);

    final Type imageType = method.getReturnType();
    context.debug(imageType.getName());

    // get the stream.
    final InputStream inputStream = this.getImage(newType, resourceName);

    // fetch the image
View Full Code Here


  protected NewConcreteType assembleNewType(final Type cometClient, final String newTypeName) {
    this.verifyEnvironment();

    final NewConcreteType generated = this.subClassCometClient(newTypeName, cometClient);

    final Type serviceInterface = this.createRpcServiceInterface(generated);
    this.createRpcAsyncServiceInterface(generated);

    this.implementCreateGwtRpcProxy(generated, serviceInterface);
    return generated;
  }
View Full Code Here

    newMethod.setAbstract(true);
    newMethod.setFinal(false);
    newMethod.setName(Constants.PAYLOAD_DECLARATION_METHOD);
    newMethod.setNative(false);

    final Type payloadType = this.getPayloadType(newType.getSuperType());
    newMethod.setReturnType(payloadType);

    newMethod.setStatic(false);
    newMethod.setVisibility(Visibility.PUBLIC);
View Full Code Here

    if (null == typeName) {
      this.throwUnableToFindCometPayloadTypeAnnotation(type);
    }
    context.debug(typeName);

    final Type payloadType = context.findType(typeName);
    if (payloadType == null) {
      this.throwUnableToFindPayloadType(typeName);
    }

    context.debug(payloadType.toString());
    context.unbranch();

    return payloadType;
  }
View Full Code Here

    newMethod.setBody(body);
    body.setMethod(newMethod);
    body.setParameters(newMethod.getParameters());
    body.setServiceInterface(serviceInterface);

    final Type serializationFactoryComposer = this.createSerializationFactoryComposer(method, client, serviceInterface);
    body.setSerializationFactoryComposer(serializationFactoryComposer);

    context.debug("Completed.");
    context.unbranch();
  }
View Full Code Here

    context.branch();
    context.info("Processing " + method);

    final Iterator containerTypes = method.getMetadataValues(SerializationConstants.CONTAINER_TYPE).iterator();

    final Type list = this.getList();
    final Type set = this.getSet();
    final Type map = this.getMap();

    context.branch();
    context.debug("Parameters");

    // first process parameters...
    final Iterator parameters = method.getParameters().iterator();
    while (parameters.hasNext()) {
      final MethodParameter parameter = (MethodParameter) parameters.next();
      final Type parameterType = parameter.getType();

      context.debug(parameterType.getName());

      // skip primitive types...
      if (parameterType.isPrimitive()) {
        continue;
      }

      writableTypes.add(parameterType);
      context.debug(parameterType.getName());

      if (parameterType.equals(list)) {
        final Type listElementType = this.getTypeFromAnnotation(containerTypes, parameter);
        writableTypes.add(listElementType);

        context.debug(listElementType + " (List)");
        continue;
      }
      if (parameterType.equals(set)) {
        final Type setElementType = this.getTypeFromAnnotation(containerTypes, parameter);
        writableTypes.add(setElementType);

        context.debug(setElementType + " (Set)");
        continue;
      }
      if (parameterType.equals(map)) {
        final Type mapKeyType = this.getTypeFromAnnotation(containerTypes, parameter);
        writableTypes.add(mapKeyType);

        final Type mapValueType = this.getTypeFromAnnotation(containerTypes, parameter);
        writableTypes.add(mapValueType);

        context.debug(mapKeyType + " (Map Key)");
        context.debug(mapValueType + " (Map Value)");
        continue;
      }
    }

    context.unbranch();
    context.branch();
    context.debug("Return type");

    // process return type...
    final Type returnType = method.getReturnType();
    final Type voidd = this.getGeneratorContext().getVoid();

    context.debug(returnType.getName());

    // dont add if its primitive or void...
    if (false == (returnType.equals(voidd) || returnType.isPrimitive())) {
      readableTypes.add(returnType);

      while (true) {
        // skip primitive types...
        if (returnType.isPrimitive()) {
          break;
        }

        readableTypes.add(returnType);
        context.debug(returnType.getName());

        if (returnType.equals(list)) {
          final Type listElementType = this.getTypeFromAnnotation(containerTypes, returnType);
          readableTypes.add(listElementType);

          context.debug(listElementType + " (List)");
          break;
        }
        if (returnType.equals(set)) {
          final Type setElementType = this.getTypeFromAnnotation(containerTypes, returnType);
          readableTypes.add(setElementType);

          context.debug(setElementType + " (Set)");
          break;
        }
        if (returnType.equals(map)) {
          final Type mapKeyType = this.getTypeFromAnnotation(containerTypes, returnType);
          readableTypes.add(mapKeyType);

          final Type mapValueType = this.getTypeFromAnnotation(containerTypes, returnType);
          readableTypes.add(mapValueType);

          context.debug(mapKeyType + " (Map Key)");
          context.debug(mapValueType + " (Map Value)");
          break;
        }
      }
    }

    context.unbranch();
    context.branch();
    context.debug("Thrown types");

    // iterate over thrown types...
    final Iterator thrownTypes = method.getThrownTypes().iterator();
    while (thrownTypes.hasNext()) {
      final Type type = (Type) thrownTypes.next();

      context.debug(type.getName());

      readableTypes.add(type);
    }

    context.unbranch();
View Full Code Here

   *            The type that will receive the annotations.
   */
  protected void addAnnotations(final String annotationName, final Set types, final NewType target) {
    final Iterator iterator = types.iterator();
    while (iterator.hasNext()) {
      final Type type = (Type) iterator.next();
      this.addAnnotation(annotationName, type, target);
    }
  }
View Full Code Here

    newMethod.setFinal(true);
    newMethod.setNative(false);

    CodeBlock body = null;
    while (true) {
      final Type widgetType = method.getReturnType();

      if (widgetType.equals(this.getTextBox())) {
        body = buildTextBoxGetterMethodBody(method);
        break;
      }
      if (widgetType.equals(this.getTextArea())) {
        body = buildTextAreaGetterMethodBody(method);
        break;
      }
      if (widgetType.equals(this.getRadioButton())) {
        body = buildRadioButtonGetterMethodBody(method);
        break;
      }
      if (widgetType.equals(this.getCheckBox())) {
        body = buildCheckBoxGetterMethodBody(method);
        break;
      }
      if (widgetType.equals(this.getListBox())) {
        body = buildListBoxGetterMethodBody(method);
        break;
      }
      if (widgetType.equals(this.getLabel())) {
        body = buildLabelGetterMethodBody(method);
        break;
      }
      if (widgetType.equals(this.getButton())) {
        body = buildButtonGetterMethodBody(method);
        break;
      }
      if (widgetType.equals(this.getImage())) {
        body = buildImageGetterMethodBody(method);
        break;
      }
      if (widgetType.equals(this.getHyperlink())) {
        body = buildHyperlinkGetterMethodBody(method);
        break;
      }
      if (widgetType.equals(this.getHtml())) {
        body = buildHtmlGetterMethodBody(method);
        break;
      }
      if (widgetType.equals(this.getFormPanel())) {
        body = buildFormPanelGetterMethodBody(method);
        break;
      }

      this.throwUnsupportedWidgetType(method);
View Full Code Here

TOP

Related Classes of rocket.generator.rebind.type.Type

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.