1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 package com.sun.star.report.pentaho;
24 
25 import org.pentaho.reporting.libraries.base.config.Configuration;
26 import org.pentaho.reporting.libraries.formula.ContextEvaluationException;
27 import org.pentaho.reporting.libraries.formula.FormulaContext;
28 import org.pentaho.reporting.libraries.formula.LocalizationContext;
29 import org.pentaho.reporting.libraries.formula.function.FunctionRegistry;
30 import org.pentaho.reporting.libraries.formula.operators.OperatorFactory;
31 import org.pentaho.reporting.libraries.formula.typing.Type;
32 import org.pentaho.reporting.libraries.formula.typing.TypeRegistry;
33 
34 /**
35  *
36  * @author Ocke Janssen
37  */
38 public class PentahoFormulaContext implements FormulaContext
39 {
40 
41     final private FormulaContext backend;
42     final private Configuration config;
43 
PentahoFormulaContext(final FormulaContext backend, final Configuration _config)44     public PentahoFormulaContext(final FormulaContext backend, final Configuration _config)
45     {
46         this.backend = backend;
47         config = _config;
48     }
49 
getLocalizationContext()50     public LocalizationContext getLocalizationContext()
51     {
52         return backend.getLocalizationContext();
53     }
54 
getConfiguration()55     public Configuration getConfiguration()
56     {
57         return config;
58     }
59 
getFunctionRegistry()60     public FunctionRegistry getFunctionRegistry()
61     {
62         return backend.getFunctionRegistry();
63     }
64 
getTypeRegistry()65     public TypeRegistry getTypeRegistry()
66     {
67         return backend.getTypeRegistry();
68     }
69 
getOperatorFactory()70     public OperatorFactory getOperatorFactory()
71     {
72         return backend.getOperatorFactory();
73     }
74 
resolveReferenceType(final Object name)75     public Type resolveReferenceType(final Object name) throws ContextEvaluationException
76     {
77         return backend.resolveReferenceType(name);
78     }
79 
resolveReference(final Object name)80     public Object resolveReference(final Object name) throws ContextEvaluationException
81     {
82         if (name == null)
83         {
84             throw new NullPointerException();
85         }
86         return backend.resolveReference(name);
87     }
88 
isReferenceDirty(final Object name)89     public boolean isReferenceDirty(final Object name) throws ContextEvaluationException
90     {
91         return backend.isReferenceDirty(name);
92     }
93 }
94