PageRenderTime 561ms CodeModel.GetById 31ms RepoModel.GetById 1ms app.codeStats 0ms

/libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/FormulaContext.java

#
Java | 99 lines | 17 code | 10 blank | 72 comment | 0 complexity | db0d0e933e3fee956a972234e5a9a1f7 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /*
  2. * This program is free software; you can redistribute it and/or modify it under the
  3. * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
  4. * Foundation.
  5. *
  6. * You should have received a copy of the GNU Lesser General Public License along with this
  7. * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
  8. * or from the Free Software Foundation, Inc.,
  9. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  10. *
  11. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  12. * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU Lesser General Public License for more details.
  14. *
  15. * Copyright (c) 2006 - 2009 Pentaho Corporation and Contributors. All rights reserved.
  16. */
  17. package org.pentaho.reporting.libraries.formula;
  18. import org.pentaho.reporting.libraries.formula.function.FunctionRegistry;
  19. import org.pentaho.reporting.libraries.formula.operators.OperatorFactory;
  20. import org.pentaho.reporting.libraries.formula.typing.Type;
  21. import org.pentaho.reporting.libraries.formula.typing.TypeRegistry;
  22. import org.pentaho.reporting.libraries.base.config.Configuration;
  23. /**
  24. * The formula-context connects the formula functions with the outside world. The context can be used to resolve
  25. * external references, to query the configuration or to retrieve information about the formula-evaluation system.
  26. *
  27. * @author Thomas Morgner
  28. */
  29. public interface FormulaContext
  30. {
  31. /**
  32. * Checks whether the external object referenced by <code>name</code> has changed.
  33. *
  34. * @param name the name that identifies the reference.
  35. * @return true, if the reference has changed, false otherwise.
  36. * @throws ContextEvaluationException if an error occurs.
  37. */
  38. public boolean isReferenceDirty(Object name) throws ContextEvaluationException;
  39. /**
  40. * Resolves the given reference. How the name is interpreted by the outside system is an implementation detail.
  41. *
  42. * @param name the name that identifies the reference.
  43. * @return the resolved object.
  44. * @throws ContextEvaluationException if an error occurs.
  45. */
  46. public Object resolveReference(Object name) throws ContextEvaluationException;
  47. /**
  48. * Queries the type of the given reference. How the name is interpreted by the outside system is an implementation
  49. * detail. This return a LibFormula type object matching the type of the object that would be returned by
  50. * resolveReference.
  51. *
  52. * @param name the name that identifies the reference.
  53. * @return the type of the resolved object.
  54. * @throws ContextEvaluationException if an error occurs.
  55. */
  56. public Type resolveReferenceType(Object name) throws ContextEvaluationException;
  57. /**
  58. * Returns the localization context of this formula. The localization context can be used to query locale specific
  59. * configuration settings.
  60. *
  61. * @return the localization context.
  62. */
  63. public LocalizationContext getLocalizationContext();
  64. /**
  65. * Returns the local configuration of the formula.
  66. *
  67. * @return the local configuration.
  68. */
  69. public Configuration getConfiguration();
  70. /**
  71. * Returns the function registry. The function registry grants access to all formula-function implementations.
  72. *
  73. * @return the function registry.
  74. */
  75. public FunctionRegistry getFunctionRegistry();
  76. /**
  77. * Returns the type registry. The type registry contains all type information and allows to convert values between
  78. * different types.
  79. *
  80. * @return the function registry.
  81. */
  82. public TypeRegistry getTypeRegistry();
  83. /**
  84. * Returns the operator registry. The Operator-registry contains all operator-implementations.
  85. *
  86. * @return the operator registry.
  87. */
  88. public OperatorFactory getOperatorFactory();
  89. }