/** * Gets list of properties that are marked as system. * * @return list of properties. */ public static List<TablePropertyDefinition> getSystemProperties() { List<TablePropertyDefinition> result = new ArrayList<TablePropertyDefinition>(); for (TablePropertyDefinition propDefinition : DefaultPropertyDefinitions.getDefaultDefinitions()) { if (propDefinition.isSystem()) { result.add(propDefinition); } } return result; }
public static TablePropertyDefinition[] getDefaultDefinitionsForTable(String tableType, InheritanceLevel inheritanceLevel, boolean ignoreSystem) { List<TablePropertyDefinition> resultDefinitions = new ArrayList<TablePropertyDefinition>(); for (TablePropertyDefinition propertyDefinition : DefaultPropertyDefinitions.getDefaultDefinitions()) { String name = propertyDefinition.getName(); if (PropertiesChecker.isPropertySuitableForTableType(name, tableType) && (inheritanceLevel == null // any // level || ArrayUtils.contains(propertyDefinition.getInheritanceLevel(), inheritanceLevel)) && (!ignoreSystem || (ignoreSystem && !propertyDefinition.isSystem()))) { resultDefinitions.add(propertyDefinition); } } return resultDefinitions.toArray(new TablePropertyDefinition[resultDefinitions.size()]); }
private List<String> getAllPossibleProperties(String tableType) { List<String> possibleProperties = new ArrayList<String>(); TablePropertyDefinition[] propDefinitions = DefaultPropertyDefinitions.getDefaultDefinitions(); for (TablePropertyDefinition propDefinition : propDefinitions) { if (!propDefinition.isSystem()) { String propertyName = propDefinition.getName(); // check if the property can be defined in current type of table // and if property can be defined on TABLE level. if (PropertiesChecker.isPropertySuitableForTableType(propertyName, tableType) && PropertiesChecker.isPropertySuitableForLevel(InheritanceLevel.TABLE, propertyName)) { possibleProperties.add(propDefinition.getName()); } } } return possibleProperties; }
private List<String> getAllPossibleProperties(String tableType) { List<String> possibleProperties = new ArrayList<String>(); TablePropertyDefinition[] propDefinitions = DefaultPropertyDefinitions.getDefaultDefinitions(); for (TablePropertyDefinition propDefinition : propDefinitions) { if (!propDefinition.isSystem()) { String propertyName = propDefinition.getName(); // check if the property can be defined in current type of table // and if property can be defined on TABLE level. if (PropertiesChecker.isPropertySuitableForTableType(propertyName, tableType) && PropertiesChecker.isPropertySuitableForLevel(InheritanceLevel.TABLE, propertyName)) { possibleProperties.add(propDefinition.getName()); } } } return possibleProperties; }
private List<String> getAllPossibleProperties(String tableType) { List<String> possibleProperties = new ArrayList<String>(); TablePropertyDefinition[] propDefinitions = DefaultPropertyDefinitions.getDefaultDefinitions(); for (TablePropertyDefinition propDefinition : propDefinitions) { if (!propDefinition.isSystem()) { String propertyName = propDefinition.getName(); // check if the property can be defined in current type of table // and if property can be defined on TABLE level. if (PropertiesChecker.isPropertySuitableForTableType(propertyName, tableType) && PropertiesChecker.isPropertySuitableForLevel(InheritanceLevel.TABLE, propertyName)) { possibleProperties.add(propDefinition.getName()); } } } return possibleProperties; }
public TableProperty(TablePropertyDefinition propDefinition) { this.name = propDefinition.getName(); this.displayName = propDefinition.getDisplayName(); this.type = propDefinition.getType() == null ? String.class : propDefinition.getType().getInstanceClass(); this.group = propDefinition.getGroup(); this.format = propDefinition.getFormat(); this.deprecation = propDefinition.getDeprecation(); this.constraints = propDefinition.getConstraints(); this.description = propDefinition.getDescription(); this.system = propDefinition.isSystem(); this.dimensional = propDefinition.isDimensional(); }
public TableProperty(TablePropertyDefinition propDefinition) { this.name = propDefinition.getName(); this.displayName = propDefinition.getDisplayName(); this.type = propDefinition.getType() == null ? String.class : propDefinition.getType().getInstanceClass(); this.group = propDefinition.getGroup(); this.format = propDefinition.getFormat(); this.deprecation = propDefinition.getDeprecation(); this.constraints = propDefinition.getConstraints(); this.description = propDefinition.getDescription(); this.system = propDefinition.isSystem(); this.dimensional = propDefinition.isDimensional(); }
if (!propDefinition.isSystem()) {
private void initProperties() { List<TableProperty> definedProperties = new ArrayList<TableProperty>(); ITableProperties tableProperties = table.getProperties(); for (String possiblePropertyName : propertiesManager.getPossibleToAddProperties()) { TablePropertyDefinition propDefinition = TablePropertyDefinitionUtils.getPropertyByName(possiblePropertyName); if (propDefinition != null && !propDefinition.isSystem() && propDefinition.getDeprecation() == null) { Object propertyValue = tableProperties.getPropertyValue(possiblePropertyName) != null ? tableProperties.getPropertyValue(possiblePropertyName) : null; if (tableProperties.getTableProperties().containsKey(possiblePropertyName)) { Class<?> propertyType = null; if (propDefinition.getType() != null) { propertyType = propDefinition.getType().getInstanceClass(); } String displayName = propDefinition.getDisplayName(); String format = propDefinition.getFormat(); boolean dimensional = propDefinition.isDimensional(); TableProperty tableProperty = new TableProperty.TablePropertyBuilder(possiblePropertyName, propertyType).value( propertyValue).displayName(displayName).format(format).dimensional(dimensional).build(); definedProperties.add(tableProperty); } } } propertiesManager.setProperties(definedProperties); }
private void initProperties() { List<TableProperty> definedProperties = new ArrayList<TableProperty>(); ITableProperties tableProperties = table.getProperties(); for (String possiblePropertyName : propertiesManager.getPossibleToAddProperties()) { TablePropertyDefinition propDefinition = TablePropertyDefinitionUtils.getPropertyByName(possiblePropertyName); if (propDefinition != null && !propDefinition.isSystem() && propDefinition.getDeprecation() == null) { Object propertyValue = tableProperties.getPropertyValue(possiblePropertyName) != null ? tableProperties.getPropertyValue(possiblePropertyName) : null; if (tableProperties.getTableProperties().containsKey(possiblePropertyName)) { Class<?> propertyType = null; if (propDefinition.getType() != null) { propertyType = propDefinition.getType().getInstanceClass(); } String displayName = propDefinition.getDisplayName(); String format = propDefinition.getFormat(); boolean dimensional = propDefinition.isDimensional(); TableProperty tableProperty = new TableProperty.TablePropertyBuilder(possiblePropertyName, propertyType).value( propertyValue).displayName(displayName).format(format).dimensional(dimensional).build(); definedProperties.add(tableProperty); } } } propertiesManager.setProperties(definedProperties); }