• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java STMessage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.stringtemplate.v4.misc.STMessage的典型用法代码示例。如果您正苦于以下问题:Java STMessage类的具体用法?Java STMessage怎么用?Java STMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



STMessage类属于org.stringtemplate.v4.misc包,在下文中一共展示了STMessage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: STViz

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
public STViz(ErrorManager errMgr,
			 EvalTemplateEvent root,
			 String output,
			 Interpreter interp,
                List<String> trace,
                List<STMessage> errors)
   {
	this.errMgr = errMgr;
	this.currentEvent = root;
	this.currentScope = root.scope;
	this.output = output;
	this.interp = interp;
       this.allEvents = interp.getEvents();
	this.trace = trace;
       this.errors = errors;
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:17,代码来源:STViz.java


示例2: STViz

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
public STViz(ErrorManager errMgr, EvalTemplateEvent root, String output, Interpreter interp, List<String> trace, List<STMessage> errors) {
    this.errMgr = errMgr;
    this.currentEvent = root;
    this.currentScope = root.scope;
    this.output = output;
    this.interp = interp;
    this.allEvents = interp.getEvents();
    this.trace = trace;
    this.errors = errors;
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:11,代码来源:STViz.java


示例3: report

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
private void report(String msgType, STMessage msg)
{
    // only report the full error with potential stack trace if verbose
    if (verboseMode) {
        logError(msgType + " " + msg.toString());
    } else {
        logError(msgType + " " + String.format(msg.error.message, msg.arg, msg.arg2, msg.arg3) );
    }
}
 
开发者ID:jsnyders,项目名称:STSTv4,代码行数:10,代码来源:STStandaloneTool.java


示例4: renderContentTemplate

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
/** Renders template into string
 * @return The rendered template if exists, or empty string */
private final String renderContentTemplate(final ST contentTemplate, final Map<String, Object> values/*, final String language*/, final ErrorBuffer error) {
    if (contentTemplate != null) { // it has to be possible to use a layout without defining a template
        Writer sw = new StringBuilderWriter();
        
        final ErrorBuffer templateErrors = new ErrorBuffer();
        renderContentTemplate(contentTemplate, sw, values/*, language*/, templateErrors);
        
        // handle potential errors
        if (!templateErrors.errors.isEmpty()) {
            for (STMessage err : templateErrors.errors) {
                if (err.error == ErrorType.INTERNAL_ERROR) {
                    log.warn("Reloading GroupDir as we have found a problem during rendering of template \"{}\"\n{}",contentTemplate.getName(), templateErrors.errors.toString());
                    //README when errors occur, try to reload the specified templates and try the whole thing again
                    // this often rectifies the problem
                    reloadGroup();
                    ST reloadedContentTemplate = readTemplate(contentTemplate.getName());
                    sw = new StringBuilderWriter();
                    renderContentTemplate(reloadedContentTemplate, sw, values/*, language*/, error);
                    break;
                }
            }
        }

        return sw.toString();
    }
    return "";
}
 
开发者ID:MTDdk,项目名称:jawn,代码行数:30,代码来源:StringTemplateTemplateEngine.java


示例5: compileTimeError

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void compileTimeError(@NotNull final STMessage stMessage)
{
    @Nullable final Log log = UniqueLogFactory.getLog(AbstractQueryJTemplate.class);

    if (log != null)
    {
        log.error(stMessage.toString());
    }
}
 
开发者ID:rydnr,项目名称:queryj,代码行数:14,代码来源:AbstractTemplate.java


示例6: runTimeError

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void runTimeError(@NotNull final STMessage stMessage)
{
    @Nullable final Log log = UniqueLogFactory.getLog(AbstractQueryJTemplate.class);

    if (log != null)
    {
        log.error(stMessage.toString());
    }
}
 
开发者ID:rydnr,项目名称:queryj,代码行数:14,代码来源:AbstractTemplate.java


示例7: IOError

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void IOError(@NotNull final STMessage stMessage)
{
    @Nullable final Log log = UniqueLogFactory.getLog(AbstractQueryJTemplate.class);

    if (log != null)
    {
        log.error(stMessage.toString());
    }
}
 
开发者ID:rydnr,项目名称:queryj,代码行数:14,代码来源:AbstractTemplate.java


示例8: internalError

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void internalError(@NotNull final STMessage stMessage)
{
    @Nullable final Log log = UniqueLogFactory.getLog(AbstractQueryJTemplate.class);

    if (log != null)
    {
        log.error(stMessage.toString());
    }
}
 
开发者ID:rydnr,项目名称:queryj,代码行数:14,代码来源:AbstractTemplate.java


示例9: throwFor

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
private void throwFor(STMessage msg) {
	// Best API in the world, have to format things manually, because only toString() does this for us, but
	// toString() will also include the stack trace and the result would be ugly.
	String text = String.format(msg.error.message, msg.arg, msg.arg2, msg.arg3);

	// We throw Errors, because ST will catch Exceptions and call us again
	if (msg.cause != null)
		throw new Error(text, msg.cause);
	else
		throw new Error(text);
}
 
开发者ID:CvO-Theory,项目名称:apt,代码行数:12,代码来源:ThrowingErrorListener.java


示例10: userCodeException

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
public String userCodeException(STMessage arg) {
  Throwable t = arg.cause;
  if (t instanceof STNoSuchPropertyException) {
    STNoSuchPropertyException exp = (STNoSuchPropertyException)t;
    if (exp.getCause() != null && exp.getCause() instanceof InvocationTargetException) {
      InvocationTargetException ite = (InvocationTargetException)exp.getCause();
      return "User Code Exception: " + ite.getCause();
    }
  }
  return "<Unknown>";
}
 
开发者ID:smaccm,项目名称:smaccm,代码行数:12,代码来源:TbSTErrorListener.java


示例11: compileTimeError

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
@Override
public void compileTimeError(STMessage msg) {
  System.err.println(msg.toString());
}
 
开发者ID:FIXTradingCommunity,项目名称:fix-orchestra,代码行数:5,代码来源:TestGenerator.java


示例12: internalError

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
@Override
public void internalError(STMessage msg) {
  System.err.println(msg.toString());
}
 
开发者ID:FIXTradingCommunity,项目名称:fix-orchestra,代码行数:5,代码来源:TestGenerator.java


示例13: IOError

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
@Override
public void IOError(STMessage msg) {
  System.err.println(msg.toString());
}
 
开发者ID:FIXTradingCommunity,项目名称:fix-orchestra,代码行数:5,代码来源:TestGenerator.java


示例14: runTimeError

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
@Override
public void runTimeError(STMessage msg) {
  System.err.println(msg.toString());
}
 
开发者ID:FIXTradingCommunity,项目名称:fix-orchestra,代码行数:5,代码来源:TestGenerator.java


示例15: compileTimeError

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
@Override
public void compileTimeError(STMessage stMessage) {
    throw new GeneratorException(stMessage.toString());
}
 
开发者ID:protostuff,项目名称:protostuff-compiler,代码行数:5,代码来源:StErrorListener.java


示例16: runTimeError

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
@Override
public void runTimeError(STMessage stMessage) {
    throw new GeneratorException(stMessage.toString());
}
 
开发者ID:protostuff,项目名称:protostuff-compiler,代码行数:5,代码来源:StErrorListener.java


示例17: IOError

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
@Override
public void IOError(STMessage stMessage) {
    throw new GeneratorException(stMessage.toString());
}
 
开发者ID:protostuff,项目名称:protostuff-compiler,代码行数:5,代码来源:StErrorListener.java


示例18: internalError

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
@Override
public void internalError(STMessage stMessage) {
    throw new GeneratorException(stMessage.toString());
}
 
开发者ID:protostuff,项目名称:protostuff-compiler,代码行数:5,代码来源:StErrorListener.java


示例19: compileTimeError

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
@Override
public void compileTimeError(STMessage msg)
{
    compileError = true;
    report(resources.getString("CompileTimeError"), msg);
}
 
开发者ID:jsnyders,项目名称:STSTv4,代码行数:7,代码来源:STStandaloneTool.java


示例20: internalError

import org.stringtemplate.v4.misc.STMessage; //导入依赖的package包/类
@Override
public void internalError(STMessage msg)
{
    logError("xxx internal error");
    report(resources.getString("InternalError"), msg);
}
 
开发者ID:jsnyders,项目名称:STSTv4,代码行数:7,代码来源:STStandaloneTool.java



注:本文中的org.stringtemplate.v4.misc.STMessage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java StatePool类代码示例发布时间:2022-05-22
下一篇:
Java GuiSelectWorld类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap