Package org.pentaho.reporting.libraries.docbundle.metadata

Examples of org.pentaho.reporting.libraries.docbundle.metadata.UserDefinedAttribute


    }
    else if ("boolean".equals(valueType))
    {
      if (value.equals("true"))
      {
        return new UserDefinedAttribute(name, Boolean.TRUE);
      }
      return new UserDefinedAttribute(name, Boolean.FALSE);

    }
    else
    {
      return new UserDefinedAttribute(name, value);
    }
  }
View Full Code Here


        {
          attributeList.addNamespaceDeclaration("autoGenNs", entryNamespace);
        }
      }

      final UserDefinedAttribute userDefinedAttribute = (UserDefinedAttribute) entryValue;
      final String valueType;
      final String value;
      final Object o = userDefinedAttribute.getValue();
      if (o instanceof Time)
      {
        valueType = "time";

        final SimpleDateFormat sdf = new SimpleDateFormat("'PT'HH'H'mm'M'ss'S'");
        value = sdf.format(o);
      }
      else if (o instanceof Date)
      {
        valueType = "date";

        final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss' 'z");
        value = sdf.format(o);
      }
      else if (o instanceof Number)
      {
        value = o.toString();
        valueType = "float";
      }
      else if (o instanceof Boolean)
      {
        value = o.toString();
        valueType = "boolean";
      }
      else if (o != null)
      {
        value = o.toString();
        valueType = "string";
      }
      else
      {
        return;
      }


      attributeList.setAttribute(ODFMetaAttributeNames.Meta.NAMESPACE, "name", userDefinedAttribute.getName());
      attributeList.setAttribute(ODFMetaAttributeNames.Office.NAMESPACE, "value-type", valueType);
      writer.writeTag(entryNamespace, entryName, attributeList, XmlWriterSupport.OPEN);
      writer.writeTextNormalized(value, false);
      writer.writeCloseTag();
    }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.docbundle.metadata.UserDefinedAttribute

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.