System.out.println(" <PropertyDefinition>"); System.out.println(" <Name>" + field.getName() + "</Name>"); System.out.println(" <Path>" + o.getPath() + "</Path>"); System.out.println( " <Description>" + o.getPath() + "</Description>"); System.out.println( " <Type>" : "String") + "</Type>"); if (o.getDefaultValue() != null) { System.out.println( " <Default>" + o.getDefaultValue() + "</Default" + ">");
public static boolean setProperty(String name, String value) { final Property property = PropertyInfo.lookupProperty( MondrianProperties.instance(), name); String oldValue = property.getString(); if (! Util.equals(oldValue, value)) { property.setString(value); return true; } else { return false; } }
public static void listPropertyNames(StringBuilder buf) { PropertyInfo propertyInfo = new PropertyInfo(MondrianProperties.instance()); for (int i = 0; i < propertyInfo.size(); i++) { buf.append(propertyInfo.getProperty(i).getPath()); buf.append(nl); } }
private void writePropertyValue(Writer writer, Property property) throws IOException { writer.write(property.getPath()); writer.write('='); String value = property.getInternal(null, false); if (value != null) { writer.write(value); } } }
/** * Returns the boolean value of this property. */ public boolean booleanValue() { final String value = getInternal(null, false); if (value == null) { return false; } return toBoolean(value); }
/** * Retrieves the value of a property, using a given default value, and * optionally failing if there is no value. */ protected String getInternal( String defaultValue, boolean required) { String value = properties.getProperty(path, defaultValue); if (value != null) { return value; } if (defaultValue == null) { value = getDefaultValue(); if (value != null) { return value; } } if (required) { throw new RuntimeException("Property " + path + " must be set"); } return value; }
public Object evaluate(Evaluator evaluator) { if (system) { final String name = SystemPropertyParameter.this.getName(); return System.getProperty(name); } else { return propertyDefinition.stringValue(); } } };
public static void listPropertiesAll(StringBuilder buf) { PropertyInfo propertyInfo = new PropertyInfo(MondrianProperties.instance()); for (int i = 0; i < propertyInfo.size(); i++) { String propertyName = propertyInfo.getPropertyName(i); String propertyValue = propertyInfo.getProperty(i).getString(); buf.append(propertyName); buf.append('='); buf.append(propertyValue); buf.append(nl); } }
/** * Returns the value of the property as a string, or null if the property is * not set. */ public String stringValue() { return getInternal(null, false); }
public Parameter getParameter(String name) { // Scan through schema parameters. for (RolapSchemaParameter parameter : schema.parameterList) { if (Util.equalName(parameter.getName(), name)) { return parameter; } } // Scan through mondrian properties. List<Property> propertyList = MondrianProperties.instance().getPropertyList(); for (Property property : propertyList) { if (property.getPath().equals(name)) { return new SystemPropertyParameter(name, false); } } return null; }
public void execute(Property property, String value) { synchronized (DefaultRules.class) { DefaultRules oldInstance = DefaultRules.instance; DefaultRules.instance = null; DefaultRules newInstance = null; Exception ex = null; try { newInstance = DefaultRules.getInstance(); } catch (Exception e) { ex = e; } if (ex != null) { DefaultRules.instance = oldInstance; throw new Trigger.VetoRT(ex); } else if (newInstance == null) { DefaultRules.instance = oldInstance; String msg = mres.FailedCreateNewDefaultAggregateRules.str( property.getPath(), value); throw new Trigger.VetoRT(msg); } else { instance = newInstance; } } } };
/** * Registers a property with this properties object to make it available for * callbacks. */ public void register(Property property) { properties.put( property.getPath(), property); }
/** * Returns the definition of a named property, or null if there is no such * property. * * @param path Name of the property * * @return Definition of property, or null if there is no property with this * name */ public Property getPropertyDefinition(String path) { final List /*<Property>*/ propertyList = getPropertyList(); for (int i = 0; i < propertyList.size(); i++) { Property property = (Property) propertyList.get(i); if (property.getPath().equals(path)) { return property; } } return null; }
Pattern.compile("^#?\\Q" + property.getPath() + "\\E=.*"); Matcher matcher = pattern.matcher("");