Examples of GeneratorException


Examples of org.ajax4jsf.builder.generator.GeneratorException

            templatesDir.getAbsolutePath());
      }
      Velocity.init(velocityProperties);
    } catch (Exception e1) {
      e1.printStackTrace();
      throw new GeneratorException(
          "Error initialization Velocity engine", e1);
    }

  }
View Full Code Here

Examples of org.ajax4jsf.builder.generator.GeneratorException

   */
  public static Template getTemplate(String templateName) throws GeneratorException {
    try {
      return Velocity.getTemplate(templateName);
    catch (Exception e) {
      throw new GeneratorException("Error loading template " + templateName,e);
    }
  }
View Full Code Here

Examples of org.ajax4jsf.builder.generator.GeneratorException

    Template template = _templates.get(name);
    if(null == template){
      try {
        template = engine.getTemplate(name);
      } catch (ResourceNotFoundException e) {
        throw new GeneratorException(e.getLocalizedMessage());
      } catch (ParseErrorException e) {
        throw new GeneratorException(e.getLocalizedMessage());
      } catch (Exception e) {
        throw new GeneratorException(e.getLocalizedMessage());
      }
      _templates.put(name, template);
    }
    return template;
  }
View Full Code Here

Examples of org.apache.torque.generator.GeneratorException

                    new RawText(generated.getBytes(charsetName)),
                    new RawText(edited.getBytes(charsetName)));
        }
        catch (UnsupportedEncodingException e)
        {
            throw new GeneratorException(
                    "unknown character set " + charsetName,
                    e);
        }
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        try
        {
            new MergeFormatter().formatMerge(
                    outputStream,
                    mergeResult,
                    "base",
                    "generated",
                    "edited",
                    charsetName);
        }
        catch (IOException e)
        {
            throw new GeneratorException("could nor render merge result", e);
        }
        try
        {
            String result
                = new String(outputStream.toByteArray(), charsetName);
            return result;
        }
        catch (UnsupportedEncodingException e)
        {
            throw new GeneratorException(
                    "unknown character set " + charsetName,
                    e);
        }
    }
View Full Code Here

Examples of org.apache.torque.generator.GeneratorException

                    .getConfigurationHandlers()
                    .getOutputTypes();
        OutputType outputType = outputTypes.get(outputTypeString);
        if (outputType == null)
        {
            throw new GeneratorException("Unknown output type "
                    + outputTypeString
                    + " in output "
                    + output.getName());
        }
        String commentStart = outputType.getCommentStart(lineBreak);
View Full Code Here

Examples of org.apache.torque.generator.GeneratorException

    public OutletResult execute(ControllerState controllerState)
            throws GeneratorException
    {
        if (count < 0)
        {
            throw new GeneratorException("count must not be < 0");
        }

        StringBuilder result = new StringBuilder();
        for (int i = 0; i < count; ++i)
        {
View Full Code Here

Examples of org.apache.torque.generator.GeneratorException

                false);
        Object attribute
                = sourceElement.getAttribute(attributeName);
        if (attribute == null)
        {
            throw new GeneratorException(
                    "Source element attribute not set in "
                    + clazz.getName()
                    + "\n"
                    + "The attribute "
                    + attributeName
View Full Code Here

Examples of org.apache.torque.generator.GeneratorException

        throws GeneratorException
    {
        Object optionValue = controllerState.getOption(optionName);
        if (optionValue == null)
        {
            throw new GeneratorException("Invalid configuration of "
                    + clazz.getName()
                    + "\n"
                    + "The option "
                    + optionName
                    + " is not set.");
View Full Code Here

Examples of org.apache.torque.generator.GeneratorException

        {
            return presetValue;
        }
        else
        {
            throw new GeneratorException("Invalid configuration of "
                    + clazz.getName()
                    + "\n"
                    + "Make sure that one and only one of "
                    + expectedFieldNames
                    + " are set.");
View Full Code Here

Examples of org.apache.torque.generator.GeneratorException

                        "");
                Velocity.init(properties);
            }
            catch (Exception e)
            {
                throw new GeneratorException(
                        "Could not initialize velocity",
                        e);
            }

            SourceElement sourceElement = controllerState.getSourceElement();

            String inputElementName = getInputElementName();
            if (inputElementName != null
                    && !inputElementName.equals(sourceElement.getName()))
            {
                throw new GeneratorException("Input element name, "
                        + sourceElement.getName()
                        + ", is not the expected name, "
                        + getInputElementName()
                        + ", for outlet "
                        + getName());
            }

            Context context = createVelocityContext(controllerState);

            Writer writer = new StringWriter();
            try
            {
                Velocity.evaluate(context, writer,
                        "VelocityTemplateOutlet:" + getName(),
                        getContent(controllerState));
                writer.flush();
                writer.close();
            }
            catch (Exception e)
            {
                log.error("error during execution of outlet "
                            + getName()
                            + " : " + e.getMessage(),
                        e);
                throw new GeneratorException(
                        "Error during execution of outlet "
                            + getName()
                            + " : "
                            + e.getMessage(),
                        e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.