public OriginalFunction(Component component) { this.component = component; this.userFunction = (UserFunction)component.getActor(); }
/** * Get the actor (in this case a Mode) that is executed * when this component is called * * @return the code forming the implementation of this component */ @Override public Mode getActor() { return (Mode)super.getActor(); }
public void setTarget(Component target) { binding = (GlobalVariable) target.getActor(); }
public OriginalFunction(Component component) { this.component = component; this.userFunction = (UserFunction)component.getActor(); }
/** * Get the actor (in this case a Mode) that is executed * when this component is called * * @return the code forming the implementation of this component */ @Override public Mode getActor() { return (Mode)super.getActor(); }
private UserFunction establishTargetFunction(TailCallInfo tail, XPathContextMajor cm) { if (tail instanceof TailCallFunction) { return ((TailCallFunction) tail).function; } else if (tail instanceof TailCallComponent) { Component targetComponent = ((TailCallComponent) tail).component; cm.setCurrentComponent(targetComponent); return (UserFunction) targetComponent.getActor(); } else { throw new AssertionError(); } }
private UserFunction establishTargetFunction(TailCallInfo tail, XPathContextMajor cm) { if (tail instanceof TailCallFunction) { return ((TailCallFunction) tail).function; } else if (tail instanceof TailCallComponent) { Component targetComponent = ((TailCallComponent) tail).component; cm.setCurrentComponent(targetComponent); return (UserFunction) targetComponent.getActor(); } else { throw new AssertionError(); } }
public void addOverriddenComponent(Component comp) { overriddenComponents.put(comp.getActor().getSymbolicName(), comp); }
public void addOverriddenComponent(Component comp) { overriddenComponents.put(comp.getActor().getSymbolicName(), comp); }
/** * Add a component to the package * @param component the component to be added */ public void addComponent(Component component) { SymbolicName name = component.getActor().getSymbolicName(); componentIndex.put(name, component); if (component.getVisibility() == Visibility.ABSTRACT && component.getContainingPackage() == this) { abstractComponents.put(component.getActor().getSymbolicName(), component); } }
/** * Get the named template with a given name * * @param name the name of the required template * @return the template with the given name, if there is one, or null otherwise. If there * are several templates with the same name, the one with highest import precedence * is returned. Note that this template may subsequently be overridden in another package, * but only by another template with a compatible signature. */ public NamedTemplate getNamedTemplate(StructuredQName name) { HashMap<SymbolicName, Component> componentIndex = stylesheetPackage.getComponentIndex(); Component component = componentIndex.get(new SymbolicName(StandardNames.XSL_TEMPLATE, name)); return component == null ? null : (NamedTemplate) component.getActor(); }
/** * Add a component to the package * @param component the component to be added */ public void addComponent(Component component) { SymbolicName name = component.getActor().getSymbolicName(); componentIndex.put(name, component); if (component.getVisibility() == Visibility.ABSTRACT && component.getContainingPackage() == this) { abstractComponents.put(component.getActor().getSymbolicName(), component); } }
/** * Get the named template with a given name * * @param name the name of the required template * @return the template with the given name, if there is one, or null otherwise. If there * are several templates with the same name, the one with highest import precedence * is returned. Note that this template may subsequently be overridden in another package, * but only by another template with a compatible signature. */ public NamedTemplate getNamedTemplate(StructuredQName name) { HashMap<SymbolicName, Component> componentIndex = stylesheetPackage.getComponentIndex(); Component component = componentIndex.get(new SymbolicName(StandardNames.XSL_TEMPLATE, name)); return component == null ? null : (NamedTemplate) component.getActor(); }
/** * Check the compatibility of this component with another component that it is overriding * * @param component the overridden component * @throws XPathException if the components are not compatible (differing signatures) */ public void checkCompatibility(Component component) throws XPathException { if (((AttributeSet)component.getActor()).isDeclaredStreamable() && !isDeclaredStreamable()) { compileError("The overridden attribute set is declared streamable, " + "so the overriding attribute set must also be declared streamable"); } }
/** * Check the compatibility of this component with another component that it is overriding * * @param component the overridden component * @throws XPathException if the components are not compatible (differing signatures) */ public void checkCompatibility(Component component) throws XPathException { if (((AttributeSet)component.getActor()).isDeclaredStreamable() && !isDeclaredStreamable()) { compileError("The overridden attribute set is declared streamable, " + "so the overriding attribute set must also be declared streamable"); } }
/** * Get the corresponding Procedure object that results from the compilation of this * StylesheetProcedure */ public AttributeSet getActor() { return (AttributeSet)getPrincipalStylesheetModule().getStylesheetPackage().getComponent( new SymbolicName(StandardNames.XSL_ATTRIBUTE_SET, getObjectName())).getActor(); }
private void requestTailCall(XPathContext context, Sequence<?>[] actualArgs) { if (bindingSlot >= 0) { TailCallLoop.TailCallComponent info = new TailCallLoop.TailCallComponent(); Component target = getTargetComponent(context); info.component = target; info.function = (UserFunction) target.getActor(); ((XPathContextMajor) context).requestTailCall(info, actualArgs); } else { TailCallLoop.TailCallFunction info = new TailCallLoop.TailCallFunction(); info.function = function; ((XPathContextMajor) context).requestTailCall(info, actualArgs); } }
/** * Get the corresponding Procedure object that results from the compilation of this * StylesheetProcedure */ public AttributeSet getActor() { return (AttributeSet)getPrincipalStylesheetModule().getStylesheetPackage().getComponent( new SymbolicName(StandardNames.XSL_ATTRIBUTE_SET, getObjectName())).getActor(); }
private void requestTailCall(XPathContext context, Sequence<?>[] actualArgs) { if (bindingSlot >= 0) { TailCallLoop.TailCallComponent info = new TailCallLoop.TailCallComponent(); Component target = getTargetComponent(context); info.component = target; info.function = (UserFunction) target.getActor(); ((XPathContextMajor) context).requestTailCall(info, actualArgs); } else { TailCallLoop.TailCallFunction info = new TailCallLoop.TailCallFunction(); info.function = function; ((XPathContextMajor) context).requestTailCall(info, actualArgs); } }
public void checkCompatibility(Component component) { SequenceType st1 = getSourceBinding().getDeclaredType(); if (st1 == null) { st1 = SequenceType.ANY_SEQUENCE; } GlobalVariable other = (GlobalVariable) component.getActor(); TypeHierarchy th = component.getDeclaringPackage().getConfiguration().getTypeHierarchy(); int relation = th.sequenceTypeRelationship(st1, other.getRequiredType()); if (relation != TypeHierarchy.SAME_TYPE) { compileError( "The declared type of the overriding variable $" + getVariableQName().getDisplayName() + " is different from that of the overridden variable", "XTSE3070"); } }