Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * This program is free software; you can redistribute it and/or modify it under the
   * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
   * Foundation.
   *
   * You should have received a copy of the GNU Lesser General Public License along with this
   * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
   * or from the Free Software Foundation, Inc.,
   * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * See the GNU Lesser General Public License for more details.
  *
  * Copyright (c) 2006 - 2009 Pentaho Corporation..  All rights reserved.
  */
 package org.pentaho.pms.schema.concept.types;
 

Deprecated:
as of metadata 3.0. please use org.pentaho.metadata.util.PropertyTypeRegistry
 
 public class ConceptPropertyType
 {
     public static final int PROPERTY_TYPE_STRING           =  0;
     public static final int PROPERTY_TYPE_DATE             =  1;
     public static final int PROPERTY_TYPE_NUMBER           =  2;
     public static final int PROPERTY_TYPE_COLOR            =  3;
     public static final int PROPERTY_TYPE_FONT             =  4;
     public static final int PROPERTY_TYPE_FIELDTYPE        =  5;
     public static final int PROPERTY_TYPE_AGGREGATION      =  6;
     public static final int PROPERTY_TYPE_BOOLEAN          =  7;
     public static final int PROPERTY_TYPE_DATATYPE         =  8;
     public static final int PROPERTY_TYPE_LOCALIZED_STRING =  9;
     public static final int PROPERTY_TYPE_TABLETYPE        = 10;
     public static final int PROPERTY_TYPE_URL              = 11;
     public static final int PROPERTY_TYPE_SECURITY         = 12;
     public static final int PROPERTY_TYPE_ALIGNMENT        = 13;
     public static final int PROPERTY_TYPE_COLUMN_WIDTH     = 14;
     public static final int PROPERTY_TYPE_ROW_LEVEL_SECURITY = 15;
     public static final int PROPERTY_TYPE_AGGREGATION_LIST = 16;

    
These are the core property types to bootstrap the property system.
 
     public static final ConceptPropertyType[] propertyTypes =
         {
             new ConceptPropertyType,           "String",      Messages.getString("ConceptPropertyType.USER_STRING_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
             new ConceptPropertyType,             "Date",        Messages.getString("ConceptPropertyType.USER_DATE_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
             new ConceptPropertyType,           "Number",      Messages.getString("ConceptPropertyType.USER_NUMBER_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
             new ConceptPropertyType,            "Color",       Messages.getString("ConceptPropertyType.USER_COLOR_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
             new ConceptPropertyType,             "Font",        Messages.getString("ConceptPropertyType.USER_FONT_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
             new ConceptPropertyType,        "FieldType",   Messages.getString("ConceptPropertyType.USER_FIELDTYPE_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
             new ConceptPropertyType,      "Aggregation", Messages.getString("ConceptPropertyType.USER_AGGREGATION_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
             new ConceptPropertyType,          "Boolean",     Messages.getString("ConceptPropertyType.USER_BOOLEAN_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
             new ConceptPropertyType,         "DataType",    Messages.getString("ConceptPropertyType.USER_DATATYPE_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
             new ConceptPropertyType"LocString",   Messages.getString("ConceptPropertyType.USER_LOCALIZED_STRING_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
             new ConceptPropertyType,        "TableType",   Messages.getString("ConceptPropertyType.USER_TABLE_TYPE_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
             new ConceptPropertyType,              "URL",         Messages.getString("ConceptPropertyType.USER_URL_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
             new ConceptPropertyType,         "Security",    Messages.getString("ConceptPropertyType.USER_SECURITY_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
             new ConceptPropertyType,        "Alignment",   Messages.getString("ConceptPropertyType.USER_ALIGNMENT_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
             new ConceptPropertyType,     "ColumnWidth", Messages.getString("ConceptPropertyType.USER_COLUMN_WIDTH_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
             new ConceptPropertyType"RowLevelSecurity", Messages.getString("ConceptPropertyType.USER_ROW_LEVEL_SECURITY_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
             new ConceptPropertyType"AggregationList", Messages.getString("ConceptPropertyType.USER_AGGREGATION_LIST_DESC")), //$NON-NLS-1$ //$NON-NLS-2$
         };
 
     public static final ConceptPropertyType STRING           =  ];
     public static final ConceptPropertyType DATE             =  ];
     public static final ConceptPropertyType NUMBER           =  ];
     public static final ConceptPropertyType COLOR            =  ];
     public static final ConceptPropertyType FONT             =  ];
     public static final ConceptPropertyType FIELDTYPE        =  ];
     public static final ConceptPropertyType AGGREGATION      =  ];
     public static final ConceptPropertyType BOOLEAN          =  ];
     public static final ConceptPropertyType DATATYPE         =  ];
     public static final ConceptPropertyType TABLETYPE        =  ];
     public static final ConceptPropertyType URL              =  ];
     public static final ConceptPropertyType SECURITY         =  ];
     public static final ConceptPropertyType ALIGNMENT        =  ];
     public static final ConceptPropertyType COLUMN_WIDTH     = ];
 
     public static final String ISO_DATE_FORMAT = "yyyy/MM/dd'T'HH:mm:ss"//$NON-NLS-1$
 
    

Returns:
an array of the core concept property type descriptions
 
     public static String[] getTypeDescriptions()
     {
         String types[] = new String[.];
         for (int i=0;i<types.length;i++)
         {
            types[i] = [i].getDescription();
        }
        return types;
    }

    

Returns:
an array of the core concept property type codes
    public static String[] getTypeCodes()
    {
        String types[] = new String[.];
        for (int i=0;i<types.length;i++)
        {
            types[i] = [i].getCode();
        }
        return types;
    }
    private int type;
    private String code;
    private String description;

    

Parameters:
type
code
description
    public ConceptPropertyType(int typeString codeString description)
    {
        this. = type;
        this. = code;
        this. = description;
    }
    public String toString()
    {
      return new ToStringBuilder(this.).
      append().
      append().
      append().
      toString();
    }
    public boolean equals(Object obj)
    {
      if (obj instanceof ConceptPropertyType == false) {
        return false;
      }
      if (this == obj) {
        return true;
      }
      ConceptPropertyType rhs = (ConceptPropertyTypeobj;
      return new EqualsBuilder().append(rhs.type).append(rhs.code).append(rhs.description)
        .isEquals();
    }
    public int hashCode() {
      return new HashCodeBuilder(97, 269).append().append().append().toHashCode();
    }

    

Returns:
the code
    public String getCode()
    {
        return ;
    }

    

Parameters:
code the code to set
    public void setCode(String code)
    {
        this. = code;
    }

    

Returns:
the description
    public String getDescription()
    {
        return ;
    }

    

Parameters:
description the description to set
    public void setDescription(String description)
    {
        this. = description;
    }

    

Returns:
the type
    public int getType()
    {
        return ;
    }

    

Parameters:
type the type to set
    public void setType(int type)
    {
        this. = type;
    }

    

Parameters:
typeDesc The description or code of the type
Returns:
The concept property type or null if nothing was found to match.
    public static ConceptPropertyType getType(String typeDesc)
    {
        for (int i=0;i<.;i++)
        {
            if ([i].getDescription().equals(typeDesc)) return [i];
            if ([i].getCode().equals(typeDesc)) return [i];
        }
        return null;
    }
New to GrepCode? Check out our FAQ X