Package org.cruxframework.crux.core.rebind

Examples of org.cruxframework.crux.core.rebind.CruxGeneratorException


    {
      JSONObject metaElement = elementsMetaData.optJSONObject(i);

      if (!metaElement.has("_type"))
      {
        throw new CruxGeneratorException("Crux Meta Data contains an invalid meta element (without type attribute). View ID["+view.getId()+"]. "
            + "Validate your view file.");
      }
      if (isValidWidget(metaElement))
      {
        try
        {
          String type = getMetaElementType(metaElement);
          createWidget(printer, metaElement, type);
        }
        catch (Throwable e)
        {
          throw new CruxGeneratorException("Error Creating widget. See Log for more detail.", e);
        }
      }
    }

    printer.println("if ("+LogConfiguration.class.getCanonicalName()+".loggingIsEnabled()){");
View Full Code Here


      Map<String, String> classNamesByDevice = resourcesClassNames.get(resourceKey);
     
      String deviceKey = device.toString();
    if (resourcesCanonicalNames.containsKey(deviceKey))
      {
        throw new CruxGeneratorException("Duplicated resource: ["+resourceKey+"].");
      }
    canonicallCassNamesByDevice.put(deviceKey, resourceClass.getCanonicalName());
    classNamesByDevice.put(deviceKey, resourceClass.getName());
    }
View Full Code Here

      {
        Integer.parseInt(attributeValue);
      }
      catch (Exception e)
      {
        throw new CruxGeneratorException("Error parsing attribute value ["+attributeValue+"], of widget ["+context.getWidgetId()+"], on screen ["+getWidgetCreator().getView().getId()+"].",e);
      }
      out.println(context.getWidget()+".setRowCount("+attributeValue+", false);");
        }
View Full Code Here

    {
      getExpression = "(w==null?0:"+expression+"==null?0:"+expression+")";
    }
    else
    {
      throw new CruxGeneratorException("Invalid binding path ["+bindPath+"] on target dataObject ["+dataObjectClassName+"]. Property can not be void.");
    }
    return getExpression;
  }
View Full Code Here

    {
      getExpression = "0";
    }
    else
    {
      throw new CruxGeneratorException("Invalid binding path ["+bindPath+"] on target dataObject ["+dataObjectClassName+"]. Property can not be void.");
    }
    return getExpression;
  }
View Full Code Here

    {
      widgetType = stringType;
    }
    else
    {
      throw new CruxGeneratorException("converter ["+converterType.getQualifiedSourceName()+
          "] can not be used to convert values to widget of type ["+widgetClass.getQualifiedSourceName()+"]. Incompatible types.");
    }
    if (!propertyType.isAssignableTo(types[0]))
    {
      throw new CruxGeneratorException("converter ["+converterType.getQualifiedSourceName()+
          "] can not be used to convert values to widget of type ["+widgetClass.getQualifiedSourceName()+"]. Incompatible types.");
    }
    if (!widgetType.isAssignableTo(types[1]))
    {
      throw new CruxGeneratorException("converter ["+converterType.getQualifiedSourceName()+
          "] can not be used to convert values to property of type ["+propertyType.getQualifiedSourceName()+"]. Incompatible types.");
    }
  }
View Full Code Here

    {
      generateWidgetCreationForCellOnController(out, context, child, dataObject, dataObjectName);
    }
    else
    {
          throw new CruxGeneratorException("Invalid child tag on widget ["+context.getWidgetId()+"]. View ["+getView().getId()+"]");
    }
   
    out.println("};");
    }
View Full Code Here

       
        out.println("}");
      }
      catch (JSONException e)
      {
        throw new CruxGeneratorException("Missing required attribute [onCreateWidget], on widgetFactoryOnController tag on widget declaration. WidgetID ["+context.getWidgetId()+"]. View ["+getView().getId()+"]");
      }
    }
View Full Code Here

   */
  private Widget createWidget(JSONObject elem, View view) throws ScreenConfigException
  {
    if (!elem.has("id"))
    {
      throw new CruxGeneratorException("The id attribute is required for CRUX Widgets. " +
          "On view ["+view.getId()+"], there is an widget of type ["+elem.optString("_type")+"] without id.");
    }
    String widgetId;
        try
        {
          widgetId = elem.getString("id");
        }
        catch (JSONException e)
        {
      throw new CruxGeneratorException("The id attribute is required for CRUX Widgets. " +
          "On view ["+view.getId()+"], there is an widget of type ["+elem.optString("_type")+"] without id.");
        }
    Widget widget = view.getWidget(widgetId);
    if (widget != null)
    {
View Full Code Here

  protected void generateProxyMethods(SourcePrinter printer) throws CruxGeneratorException
  {
      String resourceClass = Resources.getResource(resourceId, device);
      if (resourceClass == null)
      {
        throw new CruxGeneratorException("Resource ["+resourceId+"], declared on View ["+view.getId()+"] could not be found.");
      }
      String resourceVariable = ViewFactoryCreator.createVariableName("resource");

      printer.println("public static void init(){");
      printer.println("if (!View.containsResource("+EscapeUtils.quote(resourceId)+")){");
View Full Code Here

TOP

Related Classes of org.cruxframework.crux.core.rebind.CruxGeneratorException

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.