@sitevision/api 2025.4.2 → 2025.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,90 +3,27 @@ import type { Object } from "../../../../../../java/lang/Object";
3
3
  import type { ExceptionSuppressingProxyConstants } from "../../../render/velocity/VelocityAccess.ExceptionSuppressingProxyConstants";
4
4
 
5
5
  /**
6
- * Proxies an object and delegates all interface method invocations to the proxied object in order to ensure that no invocation
7
- * will throw an exception.
8
- *
9
- * <p>
10
- * This interface is an exception suppressing implementation of a so called
11
- * <em><a href="http://docs.oracle.com/javase/8/docs/technotes/guides/reflection/proxy.html">Dynamic proxy</a></em>.
12
- * This means it will proxy all methods of an object that are declared in an interface implemented by the object.
13
- * If a method invocation through this proxy throws an <code>Exception</code>, it will be catched and the default value will be returned
14
- * (e.g. <code>null</code>, <code>0</code>, <code>false</code> etc).
15
- * </p>
16
- *
17
- * <p>
18
- * <strong>Important note! </strong>This interface is intended to be used <em>only</em> in contexts where exceptions will cause <em>serious</em>
19
- * trouble if they arise and the context doesn't provide proper exception handling (e.g. when executing a Velocity template).
20
- * Suppressing exceptions is generally a <em>really</em> bad idea and using this proxy will affect performance.
21
- * Hence, this interface should only be used where the upsides with suppressing exceptions far outweighs the downsides.
22
- * This interface should be used only as a temporary patch/solution until the "real" problem causing the exception has been solved.
23
- * </p>
24
- *
25
- * <p>
26
- * The state of an ExceptionSuppressingProxy is available at all times and updated for each method invocation
27
- * (except for invocations of methods declared in this interface).
28
- * If last method invocation resulted in a thrown exception the proxy status will be {@link #EXCEPTION_THROWN_STATUS}
29
- * and the exception will be available via {@link #getCurrentException()}.
30
- * </p>
31
- *
32
- * <p>
33
- * An instance of the Sitevision class implementing this interface can be obtained via
34
- * {@link senselogic.sitevision.api.Utils#getExceptionSuppressingProxy(Object)}.
35
- * See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the <code>Utils</code> interface.
36
- * </p>
37
- *
38
- * <p>
39
- * ----------------------------------------------------------------------------------------------------
40
- * </p>
41
- *
42
- * <p>
43
- * <strong>Example of how <code>ExceptionSuppressingProxy</code> could be used in Velocity:</strong>
44
- * </p>
45
- *
46
- * <p>Case description:</p>
47
- * <p>
48
- * <em>You have a Velocity template where a certain method invocation sometimes throws an exception.
49
- * The rendered output of the template gets corrupt whenever an exception is thrown and you have not yet tracked down the root cause
50
- * of the exception. Until the root cause is found and the problem is fixed, you need a temporary solution that ignores exceptions
51
- * to keep template output acceptable. Since the method is declared in an interface and implemented in the instance you're invoking,
52
- * you're in sheer luck. You can use an <code>ExceptionSuppressingProxy</code> to suppress exceptions in order to diminish output
53
- * problems.</em><p>This is what the code looks like before your temporary fix:
54
- * </p>
55
- * <pre><code>
56
- * &lt;p&gt;
57
- * $myObject.thisNeverThrowsExceptions()
58
- * $myObject.thisMethodSometimesThrowsExceptions() <em>## This method is declared in an interface, hence can be proxied</em>
59
- * &lt;/p&gt;
60
- * </code></pre>
61
- * This is how you could use an <code>ExceptionSuppressingProxy</code> to apply a temporary fix:<pre><code>
62
- * &lt;p&gt;
63
- * $myObject.thisNeverThrowsExceptions()
64
- *
65
- * <em>## Get an ExceptionSuppressingProxy instance for myObject</em>
66
- * #set ($proxy = $sitevisionUtils.getExceptionSuppressingProxy($myObject))
67
- *
68
- * $!proxy.thisMethodSometimesThrowsExceptions() <em>## Method invoked through a proxy, might return null</em>
69
- * &lt;/p&gt;
70
- * </code></pre>
6
+ * Deprecated interface that will be removed in a future version of Sitevision.
71
7
  * @author Magnus Lövgren
72
8
  * @since Sitevision 2.6.1_09
9
+ * @deprecated this interface is deprecated and will be removed in a future version of Sitevision
73
10
  */
74
11
  export type ExceptionSuppressingProxy = ExceptionSuppressingProxyConstants & {
75
12
  /**
76
- * Returns current status
77
- * @return {@link #NO_OBJECT_PROXIED_STATUS} or {@link #NO_EXCEPTION_THROWN_STATUS} or {@link #EXCEPTION_THROWN_STATUS}
13
+ * Always returns {@link #NO_EXCEPTION_THROWN_STATUS}.
14
+ * @return {@link #NO_EXCEPTION_THROWN_STATUS}
78
15
  */
79
16
  getCurrentStatus(): number;
80
17
 
81
18
  /**
82
- * Returns the exception that was thrown during last method invocation of the proxied object.
83
- * @return the exception thrown during last method invocation, or <code>null</code> if no exeption was thrown
19
+ * Always returns null.
20
+ * @return null
84
21
  */
85
22
  getCurrentException(): Exception;
86
23
 
87
24
  /**
88
- * Returns the proxied object
89
- * @return the object that is proxied by an instance of this interface, or <code>null</code> if no proxied object is set
25
+ * Returns the object this ExceptionSuppressingProxy was created for.
26
+ * @return the decorated object
90
27
  */
91
28
  getProxiedObject(): unknown;
92
29