/** * Adds trace-listener-a with trace-listener-b and * returns the resulting multicast listener. * * @param a trace-listener-a * @param b trace-listener-b */ public static TraceListener add(TraceListener a, TraceListener b) { return (TraceListener) addInternal(a, b); }
/** * Removes the specified trace listener so that the listener will no longer * receive trace events. * * @param trace the trace listener. * @since 8.4 */ public void removeTraceListener(TraceListener trace) { traceListener = TraceEventMulticaster.remove(traceListener, trace); }
/** * Removes the old trace-listener from trace-listener-l and * returns the resulting multicast listener. * * @param l trace-listener-l * @param oldl the trace-listener being removed */ public static TraceListener remove(TraceListener l, TraceListener oldl) { return (TraceListener) removeInternal(l, oldl); }
/** * Removes a listener from this multicaster and returns the * resulting multicast listener. * * @param oldl the listener to be removed */ /*@Nullable*/ protected TraceListener remove(TraceListener oldl) { if (oldl == a) { return b; } if (oldl == b) { return a; } TraceListener a2 = removeInternal(a, oldl); TraceListener b2 = removeInternal(b, oldl); if (a2 == a && b2 == b) { return this; // it's not here } return addInternal(a2, b2); }
/** * Returns the resulting multicast listener from adding listener-a * and listener-b together. * If listener-a is null, it returns listener-b; * If listener-b is null, it returns listener-a * If neither are null, then it creates and returns * a new EventMulticaster instance which chains a with b. * * @param a event listener-a * @param b event listener-b */ protected static EventListener addInternal(EventListener a, EventListener b) { if (a == null) { return b; } if (b == null) { return a; } return new TraceEventMulticaster(a, b); }
/** * Adds the specified trace listener to receive trace events from * this instance. Note that although TraceListeners can be added * or removed dynamically, this has no effect unless the stylesheet * or query has been compiled with tracing enabled. This is achieved * by calling {@link Configuration#setTraceListener} or by setting * the attribute {@link net.sf.saxon.lib.FeatureKeys#TRACE_LISTENER} on the * TransformerFactory. Conversely, if this property has been set in the * Configuration or TransformerFactory, the TraceListener will automatically * be added to every Controller that uses that Configuration. * * @param trace the trace listener. If null is supplied, the call has no effect. * @since 8.4 */ public void addTraceListener(/*@Nullable*/ TraceListener trace) { if (trace != null) { traceListener = TraceEventMulticaster.add(traceListener, trace); } }
/** * Removes a listener from this multicaster and returns the * resulting multicast listener. * * @param oldl the listener to be removed */ protected EventListener remove(EventListener oldl) { if (oldl == a) { return b; } if (oldl == b) { return a; } EventListener a2 = removeInternal(a, oldl); EventListener b2 = removeInternal(b, oldl); if (a2 == a && b2 == b) { return this; // it's not here } return addInternal(a2, b2); }
/** * Returns the resulting multicast listener from adding listener-a * and listener-b together. * If listener-a is null, it returns listener-b; * If listener-b is null, it returns listener-a * If neither are null, then it creates and returns * a new EventMulticaster instance which chains a with b. * * @param a event listener-a * @param b event listener-b */ protected static TraceListener addInternal(TraceListener a, TraceListener b) { if (a == null) { return b; } if (b == null) { return a; } return new TraceEventMulticaster(a, b); }
/** * Adds the specified trace listener to receive trace events from * this instance. Note that although TraceListeners can be added * or removed dynamically, this has no effect unless the stylesheet * or query has been compiled with tracing enabled. This is achieved * by calling {@link Configuration#setTraceListener} or by setting * the attribute {@link FeatureKeys#TRACE_LISTENER} on the * TransformerFactory. Conversely, if this property has been set in the * Configuration or TransformerFactory, the TraceListener will automatically * be added to every Controller that uses that Configuration. * * @param trace the trace listener. If null is supplied, the call has no effect. * @since 8.4 */ public void addTraceListener(TraceListener trace) { // e.g. if (trace != null) { traceListener = TraceEventMulticaster.add(traceListener, trace); } }
/** * Removes a listener from this multicaster and returns the * resulting multicast listener. * * @param oldl the listener to be removed */ protected EventListener remove(EventListener oldl) { if (oldl == a) { return b; } if (oldl == b) { return a; } EventListener a2 = removeInternal(a, oldl); EventListener b2 = removeInternal(b, oldl); if (a2 == a && b2 == b) { return this; // it's not here } return addInternal(a2, b2); }
/** * Removes the specified trace listener so that the listener will no longer * receive trace events. * * @param trace the trace listener. * @since 8.4 */ public void removeTraceListener(TraceListener trace) { traceListener = TraceEventMulticaster.remove(traceListener, trace); }
/** * Removes the old trace-listener from trace-listener-l and * returns the resulting multicast listener. * * @param l trace-listener-l * @param oldl the trace-listener being removed */ public static TraceListener remove(TraceListener l, TraceListener oldl) { return (TraceListener) removeInternal(l, oldl); }
/** * Adds trace-listener-a with trace-listener-b and * returns the resulting multicast listener. * * @param a trace-listener-a * @param b trace-listener-b */ public static TraceListener add(TraceListener a, TraceListener b) { return (TraceListener)addInternal(a, b); }
/** * Returns the resulting multicast listener from adding listener-a * and listener-b together. * If listener-a is null, it returns listener-b; * If listener-b is null, it returns listener-a * If neither are null, then it creates and returns * a new EventMulticaster instance which chains a with b. * * @param a event listener-a * @param b event listener-b */ protected static TraceListener addInternal(TraceListener a, TraceListener b) { if (a == null) { return b; } if (b == null) { return a; } return new TraceEventMulticaster(a, b); }
/** * Adds the specified trace listener to receive trace events from * this instance. Note that although TraceListeners can be added * or removed dynamically, this has no effect unless the stylesheet * or query has been compiled with tracing enabled. This is achieved * by calling {@link Configuration#setTraceListener} or by setting * the attribute {@link FeatureKeys#TRACE_LISTENER} on the * TransformerFactory. Conversely, if this property has been set in the * Configuration or TransformerFactory, the TraceListener will automatically * be added to every Controller that uses that Configuration. * * @param trace the trace listener. If null is supplied, the call has no effect. * @since 8.4 */ public void addTraceListener(TraceListener trace) { // e.g. if (trace != null) { traceListener = TraceEventMulticaster.add(traceListener, trace); } }
/** * Removes a listener from this multicaster and returns the * resulting multicast listener. * * @param oldl the listener to be removed */ /*@Nullable*/ protected TraceListener remove(TraceListener oldl) { if (oldl == a) { return b; } if (oldl == b) { return a; } TraceListener a2 = removeInternal(a, oldl); TraceListener b2 = removeInternal(b, oldl); if (a2 == a && b2 == b) { return this; // it's not here } return addInternal(a2, b2); }
/** * Removes the specified trace listener so that the listener will no longer * receive trace events. * * @param trace the trace listener. * @since 8.4 */ public void removeTraceListener(TraceListener trace) { // e.g. traceListener = TraceEventMulticaster.remove(traceListener, trace); }
/** * Removes the old trace-listener from trace-listener-l and * returns the resulting multicast listener. * * @param l trace-listener-l * @param oldl the trace-listener being removed */ public static TraceListener remove(TraceListener l, TraceListener oldl) { return (TraceListener)removeInternal(l, oldl); }
/** * Adds trace-listener-a with trace-listener-b and * returns the resulting multicast listener. * * @param a trace-listener-a * @param b trace-listener-b */ public static TraceListener add(TraceListener a, TraceListener b) { return (TraceListener)addInternal(a, b); }
/** * Returns the resulting multicast listener from adding listener-a * and listener-b together. * If listener-a is null, it returns listener-b; * If listener-b is null, it returns listener-a * If neither are null, then it creates and returns * a new EventMulticaster instance which chains a with b. * * @param a event listener-a * @param b event listener-b */ protected static EventListener addInternal(EventListener a, EventListener b) { if (a == null) { return b; } if (b == null) { return a; } return new TraceEventMulticaster(a, b); }