当前位置: 首页>>代码示例>>Java>>正文


Java EnvUtil.createLocale方法代码示例

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


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

示例1: loadSettings

import org.pentaho.di.core.util.EnvUtil; //导入方法依赖的package包/类
private void loadSettings() throws IOException
{
    Properties properties = new Properties();
    FileInputStream fis = new FileInputStream(getSettingsFilename());
    try {
      properties.load(fis);
    } finally {
      try {
        fis.close();
      } catch (IOException ignored) {
        // Ignore closure exceptions
      }
    }
    
    String defaultLocaleStr = properties.getProperty(STRING_DEFAULT_LOCALE,  Const.DEFAULT_LOCALE.toString());
    defaultLocale = EnvUtil.createLocale(defaultLocaleStr);
    
    String failoverLocaleStr = properties.getProperty(STRING_FAILOVER_LOCALE, "en_US");  //$NON-NLS-1$
    failoverLocale = EnvUtil.createLocale(failoverLocaleStr);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:21,代码来源:LanguageChoice.java

示例2: loadSettings

import org.pentaho.di.core.util.EnvUtil; //导入方法依赖的package包/类
private void loadSettings() throws IOException {
  Properties properties = new Properties();
  FileInputStream fis = new FileInputStream( getSettingsFilename() );
  try {
    properties.load( fis );
  } finally {
    try {
      fis.close();
    } catch ( IOException ignored ) {
      // Ignore closure exceptions
    }
  }

  String defaultLocaleStr = properties.getProperty( STRING_DEFAULT_LOCALE, Const.DEFAULT_LOCALE.toString() );
  defaultLocale = EnvUtil.createLocale( defaultLocaleStr );

  String failoverLocaleStr = properties.getProperty( STRING_FAILOVER_LOCALE, "en_US" );
  failoverLocale = EnvUtil.createLocale( failoverLocaleStr );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:20,代码来源:LanguageChoice.java

示例3: ValueMeta

import org.pentaho.di.core.util.EnvUtil; //导入方法依赖的package包/类
public ValueMeta(Node node) throws KettleException 
   {
   	this();
   	
       type = getType( XMLHandler.getTagValue(node, "type") ) ;
       storageType = getStorageType( XMLHandler.getTagValue(node, "storagetype") );

       switch(storageType) {
       case STORAGE_TYPE_INDEXED:
           {
           	Node indexNode = XMLHandler.getSubNode(node, "index");
           	int nrIndexes = XMLHandler.countNodes(indexNode, "value");
           	index = new Object[nrIndexes];
           	
       	    for (int i=0;i<index.length;i++)
               {
       	    	Node valueNode = XMLHandler.getSubNodeByNr(indexNode, "value", i);
       	    	String valueString = XMLHandler.getNodeValue(valueNode);
       	    	if (Const.isEmpty(valueString))
       	    	{
       	    		index[i] = null;
       	    	}
       	    	else
       	    	{
                    switch(type)
                    {
                    case TYPE_STRING:    index[i] = valueString; break; 
                    case TYPE_NUMBER:    index[i] = Double.parseDouble( valueString ); break; 
                    case TYPE_INTEGER:   index[i] = Long.parseLong( valueString ); break; 
                    case TYPE_DATE:      index[i] = XMLHandler.stringToDate( valueString ); ; break; 
                    case TYPE_BIGNUMBER: index[i] = new BigDecimal( valueString ); ; break; 
                    case TYPE_BOOLEAN:   index[i] = Boolean.valueOf("Y".equalsIgnoreCase( valueString)); break; 
                    case TYPE_BINARY:    index[i] = XMLHandler.stringToBinary( valueString ); break;
                    default: throw new KettleException(toString()+" : Unable to de-serialize indexe storage type from XML for data type "+getType());
                    }
       	    	}
               }
           }
           break;
       
       case STORAGE_TYPE_BINARY_STRING:
           {
           	// Save the storage meta data...
           	//
           	Node storageMetaNode = XMLHandler.getSubNode(node, "storage-meta");
           	if (storageMetaNode!=null)
           	{
           		storageMetadata = new ValueMeta(storageMetaNode);
           	}
           }
           break;
           
      default:
   	   break;
      }
       
       name = XMLHandler.getTagValue(node, "name");  
       length =  Integer.parseInt( XMLHandler.getTagValue(node, "length") );  
       precision = Integer.parseInt( XMLHandler.getTagValue(node, "precision") );  
       origin = XMLHandler.getTagValue(node, "origin");  
       comments = XMLHandler.getTagValue(node, "comments");  
       conversionMask = XMLHandler.getTagValue(node, "conversion_Mask");  
       decimalSymbol = XMLHandler.getTagValue(node, "decimal_symbol");  
       groupingSymbol = XMLHandler.getTagValue(node, "grouping_symbol");  
       currencySymbol = XMLHandler.getTagValue(node, "currency_symbol");  
       trimType = getTrimTypeByCode( XMLHandler.getTagValue(node, "trim_type") );
       caseInsensitive = "Y".equalsIgnoreCase( XMLHandler.getTagValue(node, "case_insensitive") );
       sortedDescending = "Y".equalsIgnoreCase( XMLHandler.getTagValue(node, "sort_descending") );
       outputPaddingEnabled = "Y".equalsIgnoreCase( XMLHandler.getTagValue(node, "output_padding") );
       dateFormatLenient = "Y".equalsIgnoreCase( XMLHandler.getTagValue(node, "date_format_lenient") );
       String dateFormatLocaleString = XMLHandler.getTagValue(node, "date_format_locale");
       if (!Const.isEmpty( dateFormatLocaleString ))
       {
       	dateFormatLocale = EnvUtil.createLocale(dateFormatLocaleString);
       }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:77,代码来源:ValueMeta.java

示例4: ValueMeta

import org.pentaho.di.core.util.EnvUtil; //导入方法依赖的package包/类
public ValueMeta(Node node) throws KettleException 
   {
   	this();
   	
       type = getType( XMLHandler.getTagValue(node, "type") ) ;
       storageType = getStorageType( XMLHandler.getTagValue(node, "storagetype") );

       switch(storageType) {
       case STORAGE_TYPE_INDEXED:
           {
           	Node indexNode = XMLHandler.getSubNode(node, "index");
           	int nrIndexes = XMLHandler.countNodes(indexNode, "value");
           	index = new Object[nrIndexes];
           	
       	    for (int i=0;i<index.length;i++)
               {
       	    	Node valueNode = XMLHandler.getSubNodeByNr(indexNode, "value", i);
       	    	String valueString = XMLHandler.getNodeValue(valueNode);
       	    	if (Const.isEmpty(valueString))
       	    	{
       	    		index[i] = null;
       	    	}
       	    	else
       	    	{
                    switch(type)
                    {
                    case TYPE_STRING:    index[i] = valueString; break; 
                    case TYPE_NUMBER:    index[i] = Double.parseDouble( valueString ); break; 
                    case TYPE_INTEGER:   index[i] = Long.parseLong( valueString ); break; 
                    case TYPE_DATE:      index[i] = XMLHandler.stringToDate( valueString ); ; break; 
                    case TYPE_BIGNUMBER: index[i] = new BigDecimal( valueString ); ; break; 
                    case TYPE_BOOLEAN:   index[i] = Boolean.valueOf("Y".equalsIgnoreCase( valueString)); break; 
                    case TYPE_BINARY:    index[i] = XMLHandler.stringToBinary( valueString ); break;
                    default: throw new KettleException(toString()+" : Unable to de-serialize indexe storage type from XML for data type "+getType());
                    }
       	    	}
               }
           }
           break;
       
       case STORAGE_TYPE_BINARY_STRING:
           {
           	// Load the storage meta data...
           	//
             Node storageMetaNode = XMLHandler.getSubNode(node, "storage-meta");
             Node storageValueMetaNode = XMLHandler.getSubNode(storageMetaNode, XML_META_TAG);
             if (storageValueMetaNode!=null)
             {
               storageMetadata = new ValueMeta(storageValueMetaNode);
             }
           }
           break;
           
      default:
   	   break;
      }
       
       name = XMLHandler.getTagValue(node, "name");  
       length =  Integer.parseInt( XMLHandler.getTagValue(node, "length") );  
       precision = Integer.parseInt( XMLHandler.getTagValue(node, "precision") );  
       origin = XMLHandler.getTagValue(node, "origin");  
       comments = XMLHandler.getTagValue(node, "comments");  
       conversionMask = XMLHandler.getTagValue(node, "conversion_Mask");  
       decimalSymbol = XMLHandler.getTagValue(node, "decimal_symbol");  
       groupingSymbol = XMLHandler.getTagValue(node, "grouping_symbol");  
       currencySymbol = XMLHandler.getTagValue(node, "currency_symbol");  
       trimType = getTrimTypeByCode( XMLHandler.getTagValue(node, "trim_type") );
       caseInsensitive = "Y".equalsIgnoreCase( XMLHandler.getTagValue(node, "case_insensitive") );
       sortedDescending = "Y".equalsIgnoreCase( XMLHandler.getTagValue(node, "sort_descending") );
       outputPaddingEnabled = "Y".equalsIgnoreCase( XMLHandler.getTagValue(node, "output_padding") );
       dateFormatLenient = "Y".equalsIgnoreCase( XMLHandler.getTagValue(node, "date_format_lenient") );
       String dateFormatLocaleString = XMLHandler.getTagValue(node, "date_format_locale");
       if (!Const.isEmpty( dateFormatLocaleString ))
       {
       	dateFormatLocale = EnvUtil.createLocale(dateFormatLocaleString);
       }
}
 
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:78,代码来源:ValueMeta.java


注:本文中的org.pentaho.di.core.util.EnvUtil.createLocale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。