Package org.apache.torque.generator.control

Examples of org.apache.torque.generator.control.TokenReplacer


    }

    public String getContent(ControllerState controllerState)
            throws ConfigurationException
    {
        TokenReplacer tokenReplacer = new TokenReplacer(controllerState);
        String detokenizedPath = tokenReplacer.process(path);

        String result = contentMap.get(detokenizedPath);
        if (result == null)
        {
            InputStream templateInputStream = null;
View Full Code Here


     *         source element can be found or the attribute is not set.
     */
    public OutletResult execute(ControllerState controllerState)
        throws GeneratorException
    {
        TokenReplacer tokenReplacer = new TokenReplacer(controllerState);
        String detonizedElementPath = tokenReplacer.process(elementPath);

        SourceElement sourceElement = SourcePath.getElement(
                controllerState.getSourceElement(),
                detonizedElementPath,
                acceptNotSet);
        if (sourceElement == null)
        {
            if (acceptNotSet)
            {
                return new OutletResult("");
            }
            else
            {
                throw new GeneratorException("SourceElementAttributeAction: "
                        + "No element "
                        + elementPath
                        + "can be found.");
            }
        }
        String detokenizedAttributeName = tokenReplacer.process(attributeName);
        Object result = sourceElement.getAttribute(detokenizedAttributeName);
        if (result == null)
        {
            if (acceptNotSet)
            {
View Full Code Here

     * elementsToTraverseName.
     */
    public OutletResult execute(ControllerState controllerState)
        throws GeneratorException
    {
        TokenReplacer tokenReplacer = new TokenReplacer(controllerState);

        Outlet outlet;
        {
            OutletConfiguration outletConfiguration
                    = controllerState.getUnitConfiguration()
                        .getOutletConfiguration();
            String detokenizedOutletName
                    = tokenReplacer.process(outletName);
            QualifiedName outletQName = new QualifiedName(
                    detokenizedOutletName,
                    Namespace.ROOT_NAMESPACE);

            outlet = outletConfiguration.getOutlet(outletQName);
            if (outlet == null)
            {
                throw new GeneratorException("TraverseAllAction : The outlet "
                        + outletName
                        + " does not exist");
            }
        }

        SourceElement currentElement = controllerState.getSourceElement();
        String detokenizedElementToTraverseName
                = tokenReplacer.process(elementsToTraverseName);

        List<SourceElement> selectedElements
                = SourcePath.getElements(
                        currentElement,
                        detokenizedElementToTraverseName);
View Full Code Here

     * ${...} Tokens are replaced within outletName and path.
     */
    public OutletResult execute(ControllerState controllerState)
        throws GeneratorException
    {
        TokenReplacer tokenReplacer = new TokenReplacer(controllerState);
        String detokenizedOutletName = tokenReplacer.process(outletName);
        QualifiedName qualifiedOutletName = new QualifiedName(
                detokenizedOutletName,
                Namespace.ROOT_NAMESPACE);
        Outlet outlet = controllerState.getUnitConfiguration()
                .getOutletConfiguration()
                .getOutlet(qualifiedOutletName);
        if (outlet == null)
        {
            throw new GeneratorException("ApplyAction : The outlet "
                    + outletName
                    + " does not exist");
        }

        SourceElement currentElement = controllerState.getSourceElement();
        String detokenizedPath = tokenReplacer.process(path);

        List<SourceElement> selectedElements
                = SourcePath.getElements(currentElement, detokenizedPath);
        if (selectedElements.isEmpty())
        {
View Full Code Here

     *         is not set.
     */
    public OutletResult execute(ControllerState controllerState)
        throws GeneratorException
    {
        TokenReplacer tokenReplacer = new TokenReplacer(controllerState);
        String detokenizedValue = tokenReplacer.process(value);
        return new OutletResult(detokenizedValue);
    }
View Full Code Here

        UnitConfiguration unitConfiguration = new UnitConfiguration();
        unitConfiguration.setOptions(options);
        ControllerState controllerState = new ControllerState();
        controllerState.setUnitConfiguration(unitConfiguration);
        tokenReplacer = new TokenReplacer(controllerState);
    }
View Full Code Here

TOP

Related Classes of org.apache.torque.generator.control.TokenReplacer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.