/** * Get the current mode. * * @return the current mode */ public Component.M getCurrentMode() { return getCaller().getCurrentMode(); }
/** * Get the current mode. * @return the current mode */ public Mode getCurrentMode() { return getCaller().getCurrentMode(); }
/** * Get the current mode. * @return the current mode */ public Mode getCurrentMode() { return getCaller().getCurrentMode(); }
/** * Get the current mode. * * @return the current mode */ public Component.M getCurrentMode() { return getCaller().getCurrentMode(); }
/** * Get the current mode. * @return the current mode */ public Mode getCurrentMode() { return getCaller().getCurrentMode(); }
/** * Establish the target mode, at run-time. This (a) resolves overrides across packages, * and (b) handles mode="#current". * @param context the dynamic context * @return the mode to be used, as a Component */ public Component.M getTargetMode(XPathContext context) { Component.M targetMode; if (useCurrentMode) { targetMode = context.getCurrentMode(); } else { if (bindingSlot >= 0) { targetMode = (Component.M)context.getTargetComponent(bindingSlot); if (targetMode.getVisibility() == Visibility.ABSTRACT) { throw new AssertionError("Modes cannot be abstract"); } } else { // fallback targetMode = mode.getDeclaringComponent(); } } return targetMode; }
/** * Establish the target mode, at run-time. This (a) resolves overrides across packages, * and (b) handles mode="#current". * @param context the dynamic context * @return the mode to be used, as a Component */ public Component.M getTargetMode(XPathContext context) { Component.M targetMode; if (useCurrentMode) { targetMode = context.getCurrentMode(); } else { if (bindingSlot >= 0) { targetMode = (Component.M)context.getTargetComponent(bindingSlot); if (targetMode.getVisibility() == Visibility.ABSTRACT) { throw new AssertionError("Modes cannot be abstract"); } } else { // fallback targetMode = mode.getDeclaringComponent(); } } return targetMode; }
public void print(Logger out) { Item contextItem = context.getContextItem(); String diag; if (contextItem instanceof NodeInfo) { diag = Navigator.getPath((NodeInfo)contextItem); } else if (contextItem instanceof AtomicValue) { diag = "value " + contextItem.toString(); } else if (contextItem instanceof MapItem) { diag = "map"; } else if (contextItem instanceof ArrayItem) { diag = "array"; } else if (contextItem instanceof Function) { diag = "function"; } else { diag = "item"; } out.error(" in built-in template rule for " + diag + " in " + context.getCurrentMode().getActor().getModeTitle().toLowerCase()); } }
public void print(Logger out) { Item contextItem = context.getContextItem(); String diag; if (contextItem instanceof NodeInfo) { diag = Navigator.getPath((NodeInfo)contextItem); } else if (contextItem instanceof AtomicValue) { diag = "value " + contextItem.toString(); } else if (contextItem instanceof MapItem) { diag = "map"; } else if (contextItem instanceof ArrayItem) { diag = "array"; } else if (contextItem instanceof Function) { diag = "function"; } else { diag = "item"; } out.error(" in built-in template rule for " + diag + " in " + context.getCurrentMode().getActor().getModeTitle().toLowerCase()); } }
/** * Make a new XPath context for evaluating patterns if there is any possibility that the * pattern uses local variables * * @param context The existing XPath context * @return a new XPath context */ public XPathContext makeNewContext(XPathContext context) { XPathContextMajor c2 = context.newContext(); c2.setOrigin(context.getController()); // WHY? c2.openStackFrame(getStackFrameSlotsNeeded()); if (!(context.getCurrentComponent().getActor() instanceof Accumulator)) { c2.setCurrentComponent(context.getCurrentMode()); // bug 3706 } return c2; }
/** * Make a new XPath context for evaluating patterns if there is any possibility that the * pattern uses local variables * * @param context The existing XPath context * @return a new XPath context */ public XPathContext makeNewContext(XPathContext context) { XPathContextMajor c2 = context.newContext(); c2.setOrigin(context.getController()); // WHY? c2.openStackFrame(getStackFrameSlotsNeeded()); if (!(context.getCurrentComponent().getActor() instanceof Accumulator)) { c2.setCurrentComponent(context.getCurrentMode()); // bug 3706 } return c2; }
/** * Create a new "major" context (one that is capable of holding a stack frame with local variables * @param prev the previous context (the one causing the new context to be created) * @return the new major context */ public static XPathContextMajor newContext(XPathContextMinor prev) { XPathContextMajor c = new XPathContextMajor(); XPathContext p = prev; while (!(p instanceof XPathContextMajor)) { p = p.getCaller(); } c.controller = p.getController(); c.currentIterator = prev.getCurrentIterator(); c.stackFrame = prev.getStackFrame(); c.localParameters = p.getLocalParameters(); c.tunnelParameters = p.getTunnelParameters(); c.last = prev.last; c.currentReceiver = prev.currentReceiver; c.isTemporaryDestination = prev.isTemporaryDestination; c.currentMode = p.getCurrentMode(); c.currentTemplate = p.getCurrentTemplateRule(); c.currentRegexIterator = p.getCurrentRegexIterator(); c.currentGroupIterator = p.getCurrentGroupIterator(); c.caller = prev; c.tailCallFunction = null; return c; }
c2.setOrigin(builtInDetails); TailCall tc = applyTemplates( iter, context.getCurrentMode(), parameters, tunnelParams, c2, backwardsCompatible, locationId); while (tc != null) { tc = tc.processLeavingTail();
c.currentReceiver = prev.currentReceiver; c.currentDestination = prev.currentDestination; c.currentMode = p.getCurrentMode(); c.currentTemplate = p.getCurrentTemplateRule(); c.currentRegexIterator = p.getCurrentRegexIterator();
/** * Create a new "major" context (one that is capable of holding a stack frame with local variables * @param prev the previous context (the one causing the new context to be created) * @return the new major context */ public static XPathContextMajor newContext(XPathContextMinor prev) { XPathContextMajor c = new XPathContextMajor(); XPathContext p = prev; while (!(p instanceof XPathContextMajor)) { p = p.getCaller(); } c.controller = p.getController(); c.currentIterator = prev.getCurrentIterator(); c.stackFrame = prev.getStackFrame(); c.localParameters = p.getLocalParameters(); c.tunnelParameters = p.getTunnelParameters(); c.last = prev.last; c.currentReceiver = prev.currentReceiver; c.isTemporaryDestination = prev.isTemporaryDestination; c.currentMode = p.getCurrentMode(); c.currentTemplate = p.getCurrentTemplateRule(); c.currentRegexIterator = p.getCurrentRegexIterator(); c.currentGroupIterator = p.getCurrentGroupIterator(); c.caller = prev; c.tailCallFunction = null; return c; }
/** * Create a new "major" context (one that is capable of holding a stack frame with local variables * @param prev the previous context (the one causing the new context to be created) * @return the new major context */ public static XPathContextMajor newContext(XPathContextMinor prev) { XPathContextMajor c = new XPathContextMajor(); XPathContext p = prev; while (!(p instanceof XPathContextMajor)) { p = p.getCaller(); } c.controller = p.getController(); c.currentIterator = prev.getCurrentIterator(); c.stackFrame = prev.getStackFrame(); c.localParameters = p.getLocalParameters(); c.tunnelParameters = p.getTunnelParameters(); c.last = prev.last; c.currentReceiver = prev.currentReceiver; c.isTemporaryDestination = prev.isTemporaryDestination; c.currentMode = p.getCurrentMode(); c.currentTemplate = p.getCurrentTemplateRule(); c.currentRegexIterator = p.getCurrentRegexIterator(); c.currentGroupIterator = p.getCurrentGroupIterator(); c.caller = prev; c.tailCallFunction = null; return c; }
private TailCall apply(XPathContext context, boolean returnTailCall) throws XPathException { Mode thisMode = mode; if (useCurrentMode) { thisMode = context.getCurrentMode();
Component.M modeComponent = context.getCurrentMode(); if (modeComponent == null) { throw new AssertionError("Current mode is null");
Component.M modeComponent = context.getCurrentMode(); if (modeComponent == null) { throw new AssertionError("Current mode is null");
throw e; Mode mode = context.getCurrentMode(); if (mode == null) { mode = controller.getRuleManager().getDefaultMode();