1 13 14 package mondrian.olap; 15 16 55 public class Property extends EnumeratedValues.BasicValue { 56 public enum Datatype { 57 TYPE_STRING, 58 TYPE_NUMERIC, 59 TYPE_BOOLEAN, 60 TYPE_OTHER 61 } 62 63 public static final int FORMAT_EXP_ORDINAL = 0; 64 68 public static final Property FORMAT_EXP = 69 new Property("$format_exp", Datatype.TYPE_OTHER, FORMAT_EXP_ORDINAL, true, false, false, null); 70 71 public static final int AGGREGATION_TYPE_ORDINAL = 1; 72 77 public static final Property AGGREGATION_TYPE = 78 new Property("$aggregation_type", Datatype.TYPE_OTHER, AGGREGATION_TYPE_ORDINAL, true, false, false, null); 79 80 public static final int NAME_ORDINAL = 2; 81 82 86 public static final Property NAME = 87 new Property("$name", Datatype.TYPE_STRING, NAME_ORDINAL, true, false, false, null); 88 89 public static final int CAPTION_ORDINAL = 3; 90 94 public static final Property CAPTION = 95 new Property("$caption", Datatype.TYPE_STRING, CAPTION_ORDINAL, true, false, false, null); 96 97 public static final int CONTRIBUTING_CHILDREN_ORDINAL = 4; 98 104 public static final Property CONTRIBUTING_CHILDREN = 105 new Property("$contributingChildren", Datatype.TYPE_OTHER, CONTRIBUTING_CHILDREN_ORDINAL, true, false, false, null); 106 107 public static final int FORMULA_ORDINAL = 5; 108 112 public static final Property FORMULA = 113 new Property("$formula", Datatype.TYPE_OTHER, FORMULA_ORDINAL, true, false, false, null); 114 115 public static final int MEMBER_SCOPE_ORDINAL = 6; 116 120 public static final Property MEMBER_SCOPE = 121 new Property("$member_scope", Datatype.TYPE_OTHER, MEMBER_SCOPE_ORDINAL, true, true, false, null); 122 123 public static final int CATALOG_NAME_ORDINAL = 10; 124 128 public static final Property CATALOG_NAME = 129 new Property("CATALOG_NAME", Datatype.TYPE_STRING, CATALOG_NAME_ORDINAL, false, true, false, "Optional. The name of the catalog to which this member belongs. NULL if the provider does not support catalogs."); 130 131 public static final int SCHEMA_NAME_ORDINAL = 11; 132 136 public static final Property SCHEMA_NAME = 137 new Property("SCHEMA_NAME", Datatype.TYPE_STRING, SCHEMA_NAME_ORDINAL, false, true, false, "Optional. The name of the schema to which this member belongs. NULL if the provider does not support schemas."); 138 139 public static final int CUBE_NAME_ORDINAL = 12; 140 144 public static final Property CUBE_NAME = 145 new Property("CUBE_NAME", Datatype.TYPE_STRING, CUBE_NAME_ORDINAL, false, true, false, "Required. Name of the cube to which this member belongs."); 146 147 public static final int DIMENSION_UNIQUE_NAME_ORDINAL = 13; 148 152 public static final Property DIMENSION_UNIQUE_NAME = 153 new Property("DIMENSION_UNIQUE_NAME", Datatype.TYPE_STRING, DIMENSION_UNIQUE_NAME_ORDINAL, false, true, false, "Required. Unique name of the dimension to which this member belongs. For providers that generate unique names by qualification, each component of this name is delimited."); 154 155 public static final int HIERARCHY_UNIQUE_NAME_ORDINAL = 14; 156 160 public static final Property HIERARCHY_UNIQUE_NAME = 161 new Property("HIERARCHY_UNIQUE_NAME", Datatype.TYPE_STRING, HIERARCHY_UNIQUE_NAME_ORDINAL, false, true, false, "Required. Unique name of the hierarchy. If the member belongs to more than one hierarchy, there is one row for each hierarchy to which it belongs. For providers that generate unique names by qualification, each component of this name is delimited."); 162 163 public static final int LEVEL_UNIQUE_NAME_ORDINAL = 15; 164 168 public static final Property LEVEL_UNIQUE_NAME = 169 new Property("LEVEL_UNIQUE_NAME", Datatype.TYPE_STRING, LEVEL_UNIQUE_NAME_ORDINAL, false, true, false, "Required. Unique name of the level to which the member belongs. For providers that generate unique names by qualification, each component of this name is delimited."); 170 171 public static final int LEVEL_NUMBER_ORDINAL = 16; 172 176 public static final Property LEVEL_NUMBER = 177 new Property("LEVEL_NUMBER", Datatype.TYPE_STRING, LEVEL_NUMBER_ORDINAL, false, true, false, "Required. The distance of the member from the root of the hierarchy. The root level is zero."); 178 179 public static final int MEMBER_ORDINAL_ORDINAL = 17; 180 184 public static final Property MEMBER_ORDINAL = 185 new Property("MEMBER_ORDINAL", Datatype.TYPE_NUMERIC, MEMBER_ORDINAL_ORDINAL, false, true, false, "Required. Ordinal number of the member. Sort rank of the member when members of this dimension are sorted in their natural sort order. If providers do not have the concept of natural ordering, this should be the rank when sorted by MEMBER_NAME."); 186 187 public static final int MEMBER_NAME_ORDINAL = 18; 188 192 public static final Property MEMBER_NAME = 193 new Property("MEMBER_NAME", Datatype.TYPE_STRING, MEMBER_NAME_ORDINAL, false, true, false, "Required. Name of the member."); 194 195 public static final int MEMBER_UNIQUE_NAME_ORDINAL = 19; 196 200 public static final Property MEMBER_UNIQUE_NAME = 201 new Property("MEMBER_UNIQUE_NAME", Datatype.TYPE_STRING, MEMBER_UNIQUE_NAME_ORDINAL, false, true, false, "Required. Unique name of the member. For providers that generate unique names by qualification, each component of this name is delimited."); 202 203 public static final int MEMBER_TYPE_ORDINAL = 20; 204 208 public static final Property MEMBER_TYPE = 209 new Property("MEMBER_TYPE", Datatype.TYPE_STRING, MEMBER_TYPE_ORDINAL, false, true, false, "Required. Type of the member. Can be one of the following values: MDMEMBER_TYPE_REGULAR, MDMEMBER_TYPE_ALL, MDMEMBER_TYPE_FORMULA, MDMEMBER_TYPE_MEASURE, MDMEMBER_TYPE_UNKNOWN. MDMEMBER_TYPE_FORMULA takes precedence over MDMEMBER_TYPE_MEASURE. Therefore, if there is a formula (calculated) member on the Measures dimension, it is listed as MDMEMBER_TYPE_FORMULA."); 210 211 public static final int MEMBER_GUID_ORDINAL = 21; 212 216 public static final Property MEMBER_GUID = 217 new Property("MEMBER_GUID", Datatype.TYPE_STRING, MEMBER_GUID_ORDINAL, false, true, false, "Optional. Member GUID. NULL if no GUID exists."); 218 219 public static final int MEMBER_CAPTION_ORDINAL = 22; 220 225 public static final Property MEMBER_CAPTION = 226 new Property("MEMBER_CAPTION", Datatype.TYPE_STRING, MEMBER_CAPTION_ORDINAL, false, true, false, "Required. A label or caption associated with the member. Used primarily for display purposes. If a caption does not exist, MEMBER_NAME is returned."); 227 228 public static final int CHILDREN_CARDINALITY_ORDINAL = 23; 229 233 public static final Property CHILDREN_CARDINALITY = 234 new Property("CHILDREN_CARDINALITY", Datatype.TYPE_NUMERIC, CHILDREN_CARDINALITY_ORDINAL, false, true, false, "Required. Number of children that the member has. This can be an estimate, so consumers should not rely on this to be the exact count. Providers should return the best estimate possible."); 235 236 public static final int PARENT_LEVEL_ORDINAL = 24; 237 241 public static final Property PARENT_LEVEL = 242 new Property("PARENT_LEVEL", Datatype.TYPE_NUMERIC, PARENT_LEVEL_ORDINAL, false, true, false, "Required. The distance of the member's parent from the root level of the hierarchy. The root level is zero."); 243 244 public static final int PARENT_UNIQUE_NAME_ORDINAL = 25; 245 249 public static final Property PARENT_UNIQUE_NAME = 250 new Property("PARENT_UNIQUE_NAME", Datatype.TYPE_STRING, PARENT_UNIQUE_NAME_ORDINAL, false, true, false, "Required. Unique name of the member's parent. NULL is returned for any members at the root level. For providers that generate unique names by qualification, each component of this name is delimited."); 251 252 public static final int PARENT_COUNT_ORDINAL = 26; 253 257 public static final Property PARENT_COUNT = 258 new Property("PARENT_COUNT", Datatype.TYPE_NUMERIC, PARENT_COUNT_ORDINAL, false, true, false, "Required. Number of parents that this member has."); 259 260 public static final int DESCRIPTION_ORDINAL = 27; 261 265 public static final Property DESCRIPTION = 266 new Property("DESCRIPTION", Datatype.TYPE_STRING, DESCRIPTION_ORDINAL, false, true, false, "Optional. A human-readable description of the member."); 267 268 public static final int VISIBLE_ORDINAL = 28; 269 275 public static final Property VISIBLE = 276 new Property("$visible", Datatype.TYPE_BOOLEAN, VISIBLE_ORDINAL, true, false, false, null); 277 278 280 281 public static final int BACK_COLOR_ORDINAL = 30; 282 public static final Property BACK_COLOR = 283 new Property("BACK_COLOR", Datatype.TYPE_STRING, BACK_COLOR_ORDINAL, false, false, true, "The background color for displaying the VALUE or FORMATTED_VALUE property. For more information, see FORE_COLOR and BACK_COLOR Contents."); 284 285 public static final int CELL_EVALUATION_LIST_ORDINAL = 31; 286 public static final Property CELL_EVALUATION_LIST = 287 new Property("CELL_EVALUATION_LIST", Datatype.TYPE_STRING, CELL_EVALUATION_LIST_ORDINAL, false, false, true, "The semicolon-delimited list of evaluated formulas applicable to the cell, in order from lowest to highest solve order. For more information about solve order, see Understanding Pass Order and Solve Order"); 288 289 public static final int CELL_ORDINAL_ORDINAL = 32; 290 public static final Property CELL_ORDINAL = 291 new Property("CELL_ORDINAL", Datatype.TYPE_NUMERIC, CELL_ORDINAL_ORDINAL, false, false, true, "The ordinal number of the cell in the dataset."); 292 293 public static final int FORE_COLOR_ORDINAL = 33; 294 public static final Property FORE_COLOR = 295 new Property("FORE_COLOR", Datatype.TYPE_STRING, FORE_COLOR_ORDINAL, false, false, true, "The foreground color for displaying the VALUE or FORMATTED_VALUE property. For more information, see FORE_COLOR and BACK_COLOR Contents."); 296 297 public static final int FONT_NAME_ORDINAL = 34; 298 public static final Property FONT_NAME = 299 new Property("FONT_NAME", Datatype.TYPE_STRING, FONT_NAME_ORDINAL, false, false, true, "The font to be used to display the VALUE or FORMATTED_VALUE property."); 300 301 public static final int FONT_SIZE_ORDINAL = 35; 302 public static final Property FONT_SIZE = 303 new Property("FONT_SIZE", Datatype.TYPE_STRING, FONT_SIZE_ORDINAL, false, false, true, "Font size to be used to display the VALUE or FORMATTED_VALUE property."); 304 305 public static final int FONT_FLAGS_ORDINAL = 36; 306 public static final Property FONT_FLAGS = 307 new Property("FONT_FLAGS", Datatype.TYPE_NUMERIC, FONT_FLAGS_ORDINAL, false, false, true, "The bitmask detailing effects on the font. The value is the result of a bitwise OR operation of one or more of the following constants: MDFF_BOLD = 1, MDFF_ITALIC = 2, MDFF_UNDERLINE = 4, MDFF_STRIKEOUT = 8. For example, the value 5 represents the combination of bold (MDFF_BOLD) and underline (MDFF_UNDERLINE) font effects."); 308 309 310 public static final int FORMATTED_VALUE_ORDINAL = 37; 311 315 public static final Property FORMATTED_VALUE = 316 new Property("FORMATTED_VALUE", Datatype.TYPE_STRING, FORMATTED_VALUE_ORDINAL, false, false, true, "The character string that represents a formatted display of the VALUE property."); 317 318 public static final int FORMAT_STRING_ORDINAL = 38; 319 323 public static final Property FORMAT_STRING = 324 new Property("FORMAT_STRING", Datatype.TYPE_STRING, FORMAT_STRING_ORDINAL, false, false, true, "The format string used to create the FORMATTED_VALUE property value. For more information, see FORMAT_STRING Contents."); 325 326 public static final int NON_EMPTY_BEHAVIOR_ORDINAL = 39; 327 public static final Property NON_EMPTY_BEHAVIOR = 328 new Property("NON_EMPTY_BEHAVIOR", Datatype.TYPE_STRING, NON_EMPTY_BEHAVIOR_ORDINAL, false, false, true, "The measure used to determine the behavior of calculated members when resolving empty cells."); 329 330 public static final int SOLVE_ORDER_ORDINAL = 40; 331 336 public static final Property SOLVE_ORDER = 337 new Property("SOLVE_ORDER", Datatype.TYPE_NUMERIC, SOLVE_ORDER_ORDINAL, false, false, true, "The solve order of the cell."); 338 339 public static final int VALUE_ORDINAL = 41; 340 347 public static final Property VALUE = 348 new Property("VALUE", Datatype.TYPE_NUMERIC, VALUE_ORDINAL, false, true, true, "The unformatted value of the cell."); 349 350 public static final int DATATYPE_ORDINAL = 42; 351 359 public static final Property DATATYPE = 360 new Property("DATATYPE", Datatype.TYPE_STRING, DATATYPE_ORDINAL, false, false, true, "The datatype of the cell."); 361 362 public static final int DEPTH_ORDINAL = 43; 363 369 public static final Property DEPTH = 370 new Property("DEPTH", Datatype.TYPE_NUMERIC, DEPTH_ORDINAL, true, true, false, "The level depth of a member"); 371 372 public static final int DISPLAY_INFO_ORDINAL = 44; 373 378 public static final Property DISPLAY_INFO = 379 new Property("DISPLAY_INFO", Datatype.TYPE_NUMERIC, DISPLAY_INFO_ORDINAL, false, true, false, "Display instruction of a member for XML/A"); 380 381 384 static final String [] FORMAT_PROPERTIES = { 385 "format", "format_string", "FORMAT", FORMAT_STRING.name, 386 }; 387 388 390 393 private final Datatype type; 394 395 398 private final boolean internal; 399 private final boolean member; 400 private final boolean cell; 401 402 private static int nextOrdinal = 100; 403 404 406 410 protected Property( 411 String name, 412 Datatype type, 413 int ordinal, 414 boolean internal, 415 boolean member, 416 boolean cell, 417 String description) { 418 super(name, ordinal < 0 ? nextOrdinal++ : ordinal, description); 419 this.type = type; 420 this.internal = internal; 421 this.member = member; 422 this.cell = cell; 423 } 424 425 428 public Datatype getType() { 429 return type; 430 } 431 432 public PropertyFormatter getFormatter() { 433 return null; 434 } 435 436 439 public String getCaption() { 440 return name; 441 } 442 443 446 public boolean isInternal() { 447 return internal; 448 } 449 450 453 public boolean isMemberProperty() { 454 return member; 455 } 456 457 460 public boolean isCellProperty() { 461 return cell && ordinal <= VALUE_ORDINAL; 462 } 463 464 467 public boolean isStandard() { 468 return ordinal <= VALUE_ORDINAL; 469 } 470 471 472 public static final EnumeratedValues<Property> enumeration = 473 new EnumeratedValues<Property>( 474 new Property[] { 475 FORMAT_EXP, 476 AGGREGATION_TYPE, 477 NAME, 478 CAPTION, 479 CONTRIBUTING_CHILDREN, 480 FORMULA, 481 CATALOG_NAME, 482 SCHEMA_NAME, 483 CUBE_NAME, 484 DIMENSION_UNIQUE_NAME, 485 HIERARCHY_UNIQUE_NAME, 486 LEVEL_UNIQUE_NAME, 487 LEVEL_NUMBER, 488 MEMBER_UNIQUE_NAME, 489 MEMBER_NAME, 490 MEMBER_TYPE, 491 MEMBER_GUID, 492 MEMBER_CAPTION, 493 MEMBER_ORDINAL, 494 CHILDREN_CARDINALITY, 495 PARENT_LEVEL, 496 PARENT_UNIQUE_NAME, 497 PARENT_COUNT, 498 DESCRIPTION, 499 VISIBLE, 500 BACK_COLOR, 501 CELL_EVALUATION_LIST, 502 CELL_ORDINAL, 503 FORE_COLOR, 504 FONT_NAME, 505 FONT_SIZE, 506 FONT_FLAGS, 507 FORMAT_STRING, 508 FORMATTED_VALUE, 509 NON_EMPTY_BEHAVIOR, 510 SOLVE_ORDER, 511 VALUE, 512 DATATYPE, 513 }); 514 515 519 public static Property lookup(int ordinal) { 520 return enumeration.getValue(ordinal); 521 } 522 523 530 public static Property lookup(String name, boolean matchCase) { 531 if (!matchCase) { 532 return enumeration.getValueIgnoreCase(name, false); 533 } else { 534 return enumeration.getValue(name, false); 535 } 536 } 537 } 538 539 | Popular Tags |