Package anvil.server

Examples of anvil.server.ApplicationPreferences


  /// Returns a named property from <code>application</code> configuration
  /// section, or <code>undefined</code> if property does not exist.
  /// @synopsis string getProperty(string propertyName)
  public static final Any getProperty(Context context, String property)
  {
    ApplicationPreferences app = context.address().getZone().getApplicationPreferences();
    return (app != null) ?
      Any.create(app.getPreference(property)) : Any.UNDEFINED;
  }
View Full Code Here


  /// <code>application</code> configuration section.
  /// @synopsis array getProperties()
  public static final Any getProperties(Context context)
  {
    Array props = new Array();
    ApplicationPreferences app = context.address().getZone().getApplicationPreferences();
    if (app != null) {
      String[] names = app.getAdditionalPreferenceNames();
      final int n = names.length;
      for(int i=0; i<n; i++) {
        props.put(new AnyString(names[i]), Any.create(app.getPreference(names[i])));
      }
    }
    return props;
  }
View Full Code Here

TOP

Related Classes of anvil.server.ApplicationPreferences

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.