當前位置: 首頁>>代碼示例>>Java>>正文


Java MessageLevel.WARNING屬性代碼示例

本文整理匯總了Java中com.google.caja.reporting.MessageLevel.WARNING屬性的典型用法代碼示例。如果您正苦於以下問題:Java MessageLevel.WARNING屬性的具體用法?Java MessageLevel.WARNING怎麽用?Java MessageLevel.WARNING使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.google.caja.reporting.MessageLevel的用法示例。


在下文中一共展示了MessageLevel.WARNING屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: parseImpl

private CssTree.StyleSheet parseImpl(String css) throws ParseException {
  InputSource inputSource = new InputSource(FAKE_SOURCE);
  CharProducer producer = CharProducer.Factory.create(new StringReader(css),
      inputSource);
  TokenStream<CssTokenType> lexer = new CssLexer(producer);
  TokenQueue<CssTokenType> queue = new TokenQueue<CssTokenType>(lexer, inputSource,
      new Criterion<Token<CssTokenType>>() {
        public boolean accept(Token<CssTokenType> t) {
          return CssTokenType.SPACE != t.type
              && CssTokenType.COMMENT != t.type;
        }
      });
  if (queue.isEmpty()) {
    // Return empty stylesheet
    return new CssTree.StyleSheet(null, Collections.<CssTree.CssStatement>emptyList());
  }
  MessageQueue mq = new SimpleMessageQueue();
  CssParser parser = new CssParser(queue, mq, MessageLevel.WARNING);
  return parser.parseStyleSheet();
}
 
開發者ID:inevo,項目名稱:shindig-1.1-BETA5-incubating,代碼行數:20,代碼來源:CajaCssParser.java

示例2: compile

private static PluginCompiler compile(Dom htmlDom, CompilerResult result_out, PluginMeta meta, HtmlSchema schema, MessageQueue messageQueue)
{
	PluginCompiler compiler = new PluginCompiler(BuildInfo.getInstance(), meta, messageQueue);
	compiler.setHtmlSchema(schema);
	
	try
	{
		compiler.addInput(htmlDom, new URI(""));
	}
	catch (URISyntaxException e)
	{
		s_logger.log(Level.SEVERE, "", e);
		
		result_out.onFailure(E_CompilationStatus.COMPILER_EXCEPTION);
		
		return null;
	}
	
	boolean successfulCompile = compiler.run();
	
	boolean foundErrorsInMessageQueue = false;
	MessageLevel lowestReportingLevel = MessageLevel.FATAL_ERROR;
	MessageLevel highestAllowableLevel = MessageLevel.WARNING;
	
	List<Message> messages = messageQueue.getMessages();
	for( int i = 0; i < messages.size(); i++ )
	{
		Message message = messages.get(i);
		
		if( message.getMessageLevel().ordinal() >= lowestReportingLevel.ordinal() )
		{
			CompilerMessage compilerError = createMessage(message);
			
			result_out.addMessage(compilerError);
			
			if(  message.getMessageLevel().ordinal() > highestAllowableLevel.ordinal() )
			{
				foundErrorsInMessageQueue = true;
			}
		}
		
		//s_logger.severe(message.getMessageLevel() + ": " + message.toString());
	}
	
	if( !foundErrorsInMessageQueue )
	{
		if( successfulCompile )
		{
			return compiler;
		}
		else
		{
			s_logger.severe("Compiler::run() failed, but no error messages were found.");
			
			result_out.onFailure(E_CompilationStatus.COMPILER_EXCEPTION);
		}
	}
	else
	{
		// result has compiler errors inside already.
	}
	
	return null;
}
 
開發者ID:dougkoellmer,項目名稱:swarm,代碼行數:64,代碼來源:ServerCodeCompiler.java


注:本文中的com.google.caja.reporting.MessageLevel.WARNING屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。