Package org.pentaho.reporting.libraries.base.util

Examples of org.pentaho.reporting.libraries.base.util.CSVQuoter


  public static String createStringResourceKey(final String schema,
                                               final String identifier,
                                               final Map factoryParameters)
  {
    final String factoryParamString = convertFactoryParametersToString(factoryParameters);
    final CSVQuoter quoter = new CSVQuoter(';');
    return quoter.doQuoting(SERIALIZATION_PREFIX + schema) + DELIMITER +
        quoter.doQuoting(identifier) +
        (factoryParamString == null ? "" : DELIMITER + quoter.doQuoting(factoryParamString));
  }
View Full Code Here


    if (factoryParameters == null || factoryParameters.size() <= 0)
    {
      return null;
    }

    final CSVQuoter innerQuoter = new CSVQuoter('=');
    final CSVQuoter quoter = new CSVQuoter(':');
    final StringBuilder sb = new StringBuilder();
    for (Iterator iterator = factoryParameters.keySet().iterator(); iterator.hasNext();)
    {
      if (sb.length() > 0)
      {
        sb.append(':');
      }

      final StringBuilder entrySb = new StringBuilder();
      final Object key = iterator.next();
      if (key instanceof FactoryParameterKey)
      {
        final FactoryParameterKey fkey = (FactoryParameterKey) key;
        entrySb.append(innerQuoter.doQuoting("f:" + fkey.getName()));
      }
      else if (key instanceof LoaderParameterKey)
      {
        final LoaderParameterKey fkey = (LoaderParameterKey) key;
        entrySb.append(innerQuoter.doQuoting("l:" + fkey.getName()));
      }
      else
      {
        throw new IllegalArgumentException(String.valueOf(key));
      }

      final Object value = factoryParameters.get(key);
      entrySb.append('=');
      if (value != null)
      {
        // todo: This String.valueOf is probably and very likely wrong
        entrySb.append(innerQuoter.doQuoting(String.valueOf(value)));
      }

      sb.append(quoter.doQuoting(entrySb.toString()));
    }
    logger.debug("Converted ResourceKey's Factory Parameters to String: [" + sb.toString() + "]");
    return sb.toString();
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.base.util.CSVQuoter

Copyright © 2018 www.massapicom. 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.