Package org.pentaho.reporting.engine.classic.core.metadata

Examples of org.pentaho.reporting.engine.classic.core.metadata.AbstractMetaData


    return true;
  }

  public String printBundleText(final Locale locale)
  {
    final AbstractMetaData backend = getBackend();
    final String[] properties =
        {"display-name", "grouping", "grouping.ordinal",
            "ordinal", "description", "deprecated"};

    final StringWriter writer = new StringWriter();
    PrintWriter p = new PrintWriter(writer);
    for (int i = 0; i < properties.length; i++)
    {
      final String property = properties[i];
      PropertyHelper.saveConvert(backend.getKeyPrefix(), PropertyHelper.ESCAPE_KEY, p);
      PropertyHelper.saveConvert(backend.getName(), PropertyHelper.ESCAPE_KEY, p);
      p.print('.');
      PropertyHelper.saveConvert(property, PropertyHelper.ESCAPE_KEY, p);
      p.print('=');
      PropertyHelper.saveConvert(getMetaAttribute(property, locale), PropertyHelper.ESCAPE_VALUE, p);
      p.println();
View Full Code Here


    Arrays.sort(propertyMetaDatas, new GroupedMetaDataComparator(locale));
  }

  public String printBundleText(final Locale locale)
  {
    final AbstractMetaData backend = getBackend();
    final String[] properties =
        {"display-name", "short-name", "icon", "selected-icon", "grouping", "grouping.ordinal",
            "ordinal", "description", "deprecated"};

    final StringWriter writer = new StringWriter();
    PrintWriter p = new PrintWriter(writer);
    for (int i = 0; i < properties.length; i++)
    {
      final String property = properties[i];
      final String attribute = getMetaAttribute(property, locale);
      if (StringUtils.isEmpty(attribute))
      {
        if ("icon".equals(property) ||
            "selected-icon".equals(property) ||
            "short-name".equals(property))
        {
          continue;
        }
      }
      PropertyHelper.saveConvert(backend.getKeyPrefix(), PropertyHelper.ESCAPE_KEY, p);
      PropertyHelper.saveConvert(backend.getName(), PropertyHelper.ESCAPE_KEY, p);
      p.print('.');
      PropertyHelper.saveConvert(property, PropertyHelper.ESCAPE_KEY, p);
      p.print('=');
      PropertyHelper.saveConvert(attribute, PropertyHelper.ESCAPE_VALUE, p);
      p.println();
View Full Code Here

  }

  private static void printMetaBundle(final ExpressionMetaData data)
  {
    System.out.println("-----------------------------------------------------");
    final AbstractMetaData amd = (AbstractMetaData) data;
    final String keyPrefix = amd.getKeyPrefix();
    final String ename = amd.getName();
    final String ebundle = amd.getBundleLocation();

    System.out.println(keyPrefix + ename + ".display-name=" + ename);
    System.out.println(keyPrefix + ename + ".grouping=" + filter(amd.getGrouping(Locale.ENGLISH), "Group"));
    System.out.println(keyPrefix + ename + ".description=" + filter(amd.getDescription(Locale.ENGLISH), ""));
    System.out.println(keyPrefix + ename + ".deprecated=" + filter(amd.getDeprecationMessage(Locale.ENGLISH), ""));

    final ExpressionPropertyMetaData[] attributes = data.getPropertyDescriptions();

    for (int j = 0; j < attributes.length; j++)
    {
      final ExpressionPropertyMetaData attribute = attributes[j];
      final AbstractMetaData aamd = (AbstractMetaData) attribute;
      final String akeyPrefix = aamd.getKeyPrefix();
      final String abundle = aamd.getBundleLocation();
      final String aname = attribute.getName();

      System.out.println(akeyPrefix + aname + ".display-name=" + aname);
      System.out.println(akeyPrefix + aname + ".grouping=" + filter(aamd.getGrouping(Locale.ENGLISH), "Group"));
      System.out.println(akeyPrefix + aname + ".description=" + filter(aamd.getDescription(Locale.ENGLISH), ""));
      System.out.println(akeyPrefix + aname + ".deprecated=" + filter(aamd.getDeprecationMessage(Locale.ENGLISH), ""));
    }

    System.out.println("-----------------------------------------------------");
  }
View Full Code Here

    while (iterator.hasNext())
    {
      final Map.Entry o = (Map.Entry) iterator.next();

      final AttributeMetaData attribute = (AttributeMetaData) o.getValue();
      final AbstractMetaData aamd = (AbstractMetaData) attribute;
      final String akeyPrefix = aamd.getKeyPrefix();
      final String abundle = aamd.getBundleLocation();
      final String aname = attribute.getName();

      System.out.println(akeyPrefix + aname + ".display-name=" + aname);
      System.out.println(akeyPrefix + aname + ".grouping=" + filter(aamd.getGrouping(Locale.ENGLISH), "Group"));
      System.out.println(akeyPrefix + aname + ".description=" + filter(aamd.getDescription(Locale.ENGLISH), ""));
      System.out.println(akeyPrefix + aname + ".deprecated=" + filter(aamd.getDeprecationMessage(Locale.ENGLISH), ""));
    }
  }
View Full Code Here

  }

  private static void printMetaBundle(final ElementMetaData data, Map globalAttributes)
  {
    System.out.println("-----------------------------------------------------");
    final AbstractMetaData amd = (AbstractMetaData) data;
    final String keyPrefix = amd.getKeyPrefix();
    final String ename = amd.getName();
    final String ebundle = amd.getBundleLocation();

    System.out.println(keyPrefix + ename + ".display-name=" + ename);
    System.out.println(keyPrefix + ename + ".grouping=" + filter(amd.getGrouping(Locale.ENGLISH), "Group"));
    System.out.println(keyPrefix + ename + ".description=" + filter(amd.getDescription(Locale.ENGLISH), ""));
    System.out.println(keyPrefix + ename + ".deprecated=" + filter(amd.getDeprecationMessage(Locale.ENGLISH), ""));

    final AttributeMetaData[] attributes = data.getAttributeDescriptions();

    for (int j = 0; j < attributes.length; j++)
    {
      final AttributeMetaData attribute = attributes[j];
      final AbstractMetaData aamd = (AbstractMetaData) attribute;
      final String akeyPrefix = aamd.getKeyPrefix();
      final String abundle = aamd.getBundleLocation();
      final String aname = attribute.getName();
      if (abundle.equals(GLOBAL_BUNDLE) && akeyPrefix.startsWith("attribute."))
      {
        globalAttributes.put (aname, attribute);
        continue;
      }
      System.out.println(akeyPrefix + aname + ".display-name=" + aname);
      System.out.println(akeyPrefix + aname + ".grouping=" + filter(aamd.getGrouping(Locale.ENGLISH), "Group"));
      System.out.println(akeyPrefix + aname + ".description=" + filter(aamd.getDescription(Locale.ENGLISH), ""));
      System.out.println(akeyPrefix + aname + ".deprecated=" + filter(aamd.getDeprecationMessage(Locale.ENGLISH), ""));
    }

    System.out.println("-----------------------------------------------------");
  }
View Full Code Here

  private static String calculatePrefix(final MetaData type)
  {
    final String prefix;
    if (type instanceof AbstractMetaData)
    {
      final AbstractMetaData metaData = (AbstractMetaData) type;
      final String prefixMetadata = metaData.getKeyPrefix();
      if (StringUtils.isEmpty(prefixMetadata))
      {
        prefix = "";
      }
      else
View Full Code Here

  private static String printBundleLocation (final ExpressionMetaData metaData)
  {
    if (metaData instanceof AbstractMetaData)
    {
      final AbstractMetaData metaDataImpl = (AbstractMetaData) metaData;
      return metaDataImpl.getBundleLocation().replace('.', '/') + ".properties";
    }

    return metaData.getExpressionType().getCanonicalName().replace('.', '/') + "Bundle.properties";
  }
View Full Code Here

    {
      final ElementMetaData type = allTypes[i];
      final String prefix;
      if (type instanceof AbstractMetaData)
      {
        final AbstractMetaData metaData = (AbstractMetaData) type;
        final String prefixMetadata = metaData.getKeyPrefix();
        if (StringUtils.isEmpty(prefixMetadata))
        {
          prefix = "";
        }
        else
        {
          prefix = prefixMetadata + type.getName() + ".";
        }
      }
      else
      {
        prefix = "element." + type.getName() + ".";
      }

      printMetadata(type, prefix, "display-name", type.getName());
      printMetadata(type, prefix, "grouping", "");
      printMetadata(type, prefix, "grouping.ordinal", "0");
      printMetadata(type, prefix, "ordinal", "0");
      printMetadata(type, prefix, "description", "");
      printMetadata(type, prefix, "deprecated", "");
      printMetadata(type, prefix, "icon", "");
      System.out.println();

      final AttributeMetaData[] attributeDescriptions = type.getAttributeDescriptions();
      for (int j = 0; j < attributeDescriptions.length; j++)
      {
        final AttributeMetaData attribute = attributeDescriptions[j];
        final String attrNs = ElementTypeRegistry.getInstance().getNamespacePrefix(attribute.getNameSpace());
        final String attrPrefix;
        if (attribute instanceof AbstractMetaData)
        {
          final AbstractMetaData metaData = (AbstractMetaData) attribute;
          final String prefixMetadata = metaData.getKeyPrefix();
          if (StringUtils.isEmpty(prefixMetadata))
          {
            attrPrefix = "";
          }
          else
View Full Code Here

  private static String calculatePrefix(final MetaData type)
  {
    final String prefix;
    if (type instanceof AbstractMetaData)
    {
      final AbstractMetaData metaData = (AbstractMetaData) type;
      final String prefixMetadata = metaData.getKeyPrefix();
      if (StringUtils.isEmpty(prefixMetadata))
      {
        prefix = "";
      }
      else
View Full Code Here

    return true;
  }

  public String printBundleText(final Locale locale)
  {
    final AbstractMetaData backend = getBackend();
    final String[] properties =
        {"display-name", "grouping", "grouping.ordinal",
            "ordinal", "description", "deprecated"};

    final StringWriter writer = new StringWriter();
    PrintWriter p = new PrintWriter(writer);
    for (int i = 0; i < properties.length; i++)
    {
      final String property = properties[i];
      PropertyHelper.saveConvert(backend.getKeyPrefix(), PropertyHelper.ESCAPE_KEY, p);
      PropertyHelper.saveConvert(backend.getName(), PropertyHelper.ESCAPE_KEY, p);
      p.print('.');
      PropertyHelper.saveConvert(property, PropertyHelper.ESCAPE_KEY, p);
      p.print('=');
      PropertyHelper.saveConvert(getMetaAttribute(property, locale), PropertyHelper.ESCAPE_VALUE, p);
      p.println();
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.metadata.AbstractMetaData

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.