Java BuildVersion.getInstance方法代码示例(javabuildversion.getinstance方法的典型用法代码示例)

本文整理汇总了Java中org.pentaho.di.version.BuildVersion.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java BuildVersion.getInstance方法的具体用法?Java BuildVersion.getInstance怎么用?Java BuildVersion.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.version.BuildVersion的用法示例。


Java BuildVersion.getInstance方法代码示例(javabuildversion.getinstance方法的典型用法代码示例)

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

示例1: format

import org.pentaho.di.version.BuildVersion; //导入方法依赖的package包/类
public String format(LoggingEvent event)
{
    // OK, perhaps the logging information has multiple lines of data.
    // We need to split this up into different lines and all format these lines...
    StringBuffer line=new StringBuffer();
    
    String dateTimeString = "";
    if (timeAdded)
    {
        dateTimeString = ((SimpleDateFormat)LOCAL_SIMPLE_DATE_PARSER.get()).format(new Date(event.timeStamp))+" - ";
    }

    Object object = event.getMessage();
    if (object instanceof Log4jMessage)
    {
        Log4jMessage message = (Log4jMessage)object;

        String parts[] = message.getMessage().split(Const.CR);
        for (int i=0;i<parts.length;i++)
        {
            // Start every line of the output with a dateTimeString
            line.append(dateTimeString);
            
            // Include the subject too on every line...
            if (message.getSubject()!=null)
            {
                line.append(message.getSubject()).append(" - ");
            }
            
            if (message.isError())  
            {
                BuildVersion buildVersion = BuildVersion.getInstance();
                line.append(ERROR_STRING);
                line.append(" (version ");
                line.append(buildVersion.getVersion());
                if (!Const.isEmpty(buildVersion.getRevision())) {
                	line.append(", build ");
                	line.append(buildVersion.getRevision());
                }
                if (!Const.isEmpty(buildVersion.getBuildDate())) {
                 line.append(" from ");
                 line.append( buildVersion.getBuildDate() );
                }
                if (!Const.isEmpty(buildVersion.getBuildUser())) {
                	line.append(" by ");
                	line.append(buildVersion.getBuildUser());
                }
                line.append(") : ");                
             }
            
            line.append(parts[i]);
            if (i<parts.length-1) line.append(Const.CR); // put the CR's back in there!
        }
    }
    else
    {
        line.append(dateTimeString);
        line.append((object!=null?object.toString():"<null>"));
    }
    
    return line.toString();
} 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:63,代码来源:Log4jKettleLayout.java

示例2: format

import org.pentaho.di.version.BuildVersion; //导入方法依赖的package包/类
public String format(LoggingEvent event) {
  // OK, perhaps the logging information has multiple lines of data.
  // We need to split this up into different lines and all format these
  // lines...
  //
  StringBuffer line = new StringBuffer();

  String dateTimeString = "";
  if (timeAdded) {
    dateTimeString = ((SimpleDateFormat) LOCAL_SIMPLE_DATE_PARSER.get()).format(new Date(event.timeStamp)) + " - ";
  }

  Object object = event.getMessage();
  if (object instanceof LogMessage) {
    LogMessage message = (LogMessage) object;

    String parts[] = message.getMessage().split(Const.CR);
    for (int i = 0; i < parts.length; i++) {
      // Start every line of the output with a dateTimeString
      line.append(dateTimeString);

      // Include the subject too on every line...
      if (message.getSubject() != null) {
        line.append(message.getSubject());
        if (message.getCopy() != null) {
          line.append(".").append(message.getCopy());
        }
        line.append(" - ");
      }

      if (message.isError()) {
        BuildVersion buildVersion = BuildVersion.getInstance();
        line.append(ERROR_STRING);
        line.append(" (version ");
        line.append(buildVersion.getVersion());
        if (!Const.isEmpty(buildVersion.getRevision())) {
          line.append(", build ");
          line.append(buildVersion.getRevision());
        }
        if (!Const.isEmpty(buildVersion.getBuildDate())) {
          line.append(" from ");
          line.append(buildVersion.getBuildDate());
        }
        if (!Const.isEmpty(buildVersion.getBuildUser())) {
          line.append(" by ");
          line.append(buildVersion.getBuildUser());
        }
        line.append(") : ");
      }

      line.append(parts[i]);
      if (i < parts.length - 1)
        line.append(Const.CR); // put the CR's back in there!
    }
  } else {
    line.append(dateTimeString);
    line.append((object != null ? object.toString() : "<null>"));
  }

  return line.toString();
} 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:62,代码来源:Log4jKettleLayout.java

示例3: format

import org.pentaho.di.version.BuildVersion; //导入方法依赖的package包/类
public String format(LoggingEvent event) {
  // OK, perhaps the logging information has multiple lines of data.
  // We need to split this up into different lines and all format these
  // lines...
  //
  StringBuffer line = new StringBuffer();

  String dateTimeString = "";
  if (timeAdded) {
    dateTimeString = ((SimpleDateFormat) LOCAL_SIMPLE_DATE_PARSER.get()).format(new Date(event.timeStamp)) + " - ";
  }

  Object object = event.getMessage();
  if (object instanceof LogMessage) {
    LogMessage message = (LogMessage) object;

    String parts[] = message.getMessage() == null ? new String[] {} : message.getMessage().split(Const.CR);
    for (int i = 0; i < parts.length; i++) {
      // Start every line of the output with a dateTimeString
      line.append(dateTimeString);

      // Include the subject too on every line...
      if (message.getSubject() != null) {
        line.append(message.getSubject());
        if (message.getCopy() != null) {
          line.append(".").append(message.getCopy());
        }
        line.append(" - ");
      }

      if (i==0 && message.isError()) {
        BuildVersion buildVersion = BuildVersion.getInstance();
        line.append(ERROR_STRING);
        line.append(" (version ");
        line.append(buildVersion.getVersion());
        if (!Const.isEmpty(buildVersion.getRevision())) {
          line.append(", build ");
          line.append(buildVersion.getRevision());
        }
        if (!Const.isEmpty(buildVersion.getBuildDate())) {
          line.append(" from ");
          line.append(buildVersion.getBuildDate());
        }
        if (!Const.isEmpty(buildVersion.getBuildUser())) {
          line.append(" by ");
          line.append(buildVersion.getBuildUser());
        }
        line.append(") : ");
      }

      line.append(parts[i]);
      if (i < parts.length - 1)
        line.append(Const.CR); // put the CR's back in there!
    }
  } else {
    line.append(dateTimeString);
    line.append((object != null ? object.toString() : "<null>"));
  }

  return line.toString();
} 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:62,代码来源:Log4jKettleLayout.java

示例4: format

import org.pentaho.di.version.BuildVersion; //导入方法依赖的package包/类
public String format( KettleLoggingEvent event ) {
  // OK, perhaps the logging information has multiple lines of data.
  // We need to split this up into different lines and all format these
  // lines...
  //
  StringBuilder line = new StringBuilder();

  String dateTimeString = "";
  if ( timeAdded ) {
    dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - ";
  }

  Object object = event.getMessage();
  if ( object instanceof LogMessage ) {
    LogMessage message = (LogMessage) object;

    String[] parts = message.getMessage() == null ? new String[] {} : message.getMessage().split( Const.CR );
    for ( int i = 0; i < parts.length; i++ ) {
      // Start every line of the output with a dateTimeString
      line.append( dateTimeString );

      // Include the subject too on every line...
      if ( message.getSubject() != null ) {
        line.append( message.getSubject() );
        if ( message.getCopy() != null ) {
          line.append( "." ).append( message.getCopy() );
        }
        line.append( " - " );
      }

      if ( i == 0 && message.isError() ) {
        BuildVersion buildVersion = BuildVersion.getInstance();
        line.append( ERROR_STRING );
        line.append( " (version " );
        line.append( buildVersion.getVersion() );
        if ( !Utils.isEmpty( buildVersion.getRevision() ) ) {
          line.append( ", build " );
          line.append( buildVersion.getRevision() );
        }
        if ( !Utils.isEmpty( buildVersion.getBuildDate() ) ) {
          line.append( " from " );
          line.append( buildVersion.getBuildDate() );
        }
        if ( !Utils.isEmpty( buildVersion.getBuildUser() ) ) {
          line.append( " by " );
          line.append( buildVersion.getBuildUser() );
        }
        line.append( ") : " );
      }

      line.append( parts[i] );
      if ( i < parts.length - 1 ) {
        line.append( Const.CR ); // put the CR's back in there!
      }
    }
  } else {
    line.append( dateTimeString );
    line.append( ( object != null ? object.toString() : "<null>" ) );
  }

  return line.toString();
} 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:63,代码来源:KettleLogLayout.java

示例5: format

import org.pentaho.di.version.BuildVersion; //导入方法依赖的package包/类
public String format( LoggingEvent event ) {
  // OK, perhaps the logging information has multiple lines of data.
  // We need to split this up into different lines and all format these
  // lines...
  //
  StringBuffer line = new StringBuffer();

  String dateTimeString = "";
  if ( timeAdded ) {
    dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - ";
  }

  Object object = event.getMessage();
  if ( object instanceof LogMessage ) {
    LogMessage message = (LogMessage) object;

    String[] parts = message.getMessage().split( Const.CR );
    for ( int i = 0; i < parts.length; i++ ) {
      // Start every line of the output with a dateTimeString
      line.append( dateTimeString );

      // Include the subject too on every line...
      if ( message.getSubject() != null ) {
        line.append( message.getSubject() );
        if ( message.getCopy() != null ) {
          line.append( "." ).append( message.getCopy() );
        }
        line.append( " - " );
      }

      if ( message.isError() ) {
        BuildVersion buildVersion = BuildVersion.getInstance();
        line.append( ERROR_STRING );
        line.append( " (version " );
        line.append( buildVersion.getVersion() );
        if ( !Utils.isEmpty( buildVersion.getRevision() ) ) {
          line.append( ", build " );
          line.append( buildVersion.getRevision() );
        }
        if ( !Utils.isEmpty( buildVersion.getBuildDate() ) ) {
          line.append( " from " );
          line.append( buildVersion.getBuildDate() );
        }
        if ( !Utils.isEmpty( buildVersion.getBuildUser() ) ) {
          line.append( " by " );
          line.append( buildVersion.getBuildUser() );
        }
        line.append( ") : " );
      }

      line.append( parts[i] );
      if ( i < parts.length - 1 ) {
        line.append( Const.CR ); // put the CR's back in there!
      }
    }
  } else {
    line.append( dateTimeString );
    line.append( ( object != null ? object.toString() : "<null>" ) );
  }

  return line.toString();
} 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:63,代码来源:Log4jKettleLayout.java

本文标签属性:

示例:示例英文

代码:代码编程

java:javascript18岁

BuildVersion:BuildVersion

getInstance:getInstance

上一篇:C# BackgroundDownloader.CreateDownloadAsync方法代码示例(backgrounddownloader.createdownloadasync方法的典型用法代码示例)
下一篇:地球上有哪些神秘失踪的人类?人类十大失踪案件之谜(中国历史上六大名人失踪之谜)(人类十大失踪之谜)

为您推荐