Package org.apache.torque.generator.qname

Examples of org.apache.torque.generator.qname.QualifiedName


    {
        if (name == null)
        {
            throw new IllegalArgumentException("name must not be null");
        }
        this.name = new QualifiedName(name, Namespace.ROOT_NAMESPACE);
        namespace = this.name.getNamespace();
    }


                throw new SAXException("The attribute "
                        + NAME_ATTRIBUTE
                        + " must be set for the tag "
                        + INPUT_TAG);
            }
            this.output = new Output(new QualifiedName(name));

            if (attributes.getValue(FILE_ATTRIBUTE) != null)
            {
                output.setFilename(attributes.getValue(FILE_ATTRIBUTE));
            }

        Options options = unitConfiguration.getOptions();
        Options inheritedOptions = inheritedConfiguration.getOptions();
        for (Map.Entry<QualifiedName, Option> entry
            : inheritedOptions.getGlobalScope().entrySet())
        {
            QualifiedName optionName = entry.getKey();
            Option option = entry.getValue();
            if (!options.getGlobalScope().containsKey(optionName))
            {
                options.setGlobalOption(option);
            }

                && optionName == null
                && presetValue == null)
        {
            Namespace namespace
                    = controllerState.getOutlet().getName().getNamespace();
            QualifiedName variableQualifiedName = new QualifiedName(
                    variableName,
                    namespace);
            Variable variable
                    = controllerState.getVariableStore().getInHierarchy(
                            variableQualifiedName);

            // Only consider options visible from the current namespace.
            Options visibleOptions
                    = controllerState.getVisibleOptions();
            for (Option option : visibleOptions.values())
            {
                QualifiedName qualifiedName = option.getQualifiedName();
                context.put(qualifiedName.getName(), option.getValue());
            }
            log.debug("Put options in context " + visibleOptions.keySet());
        }
        else
        {
            log.debug("options in context are disabled");
        }

        SourceElement sourceElement = controllerState.getSourceElement();
        if (sourceAttributesInContext)
        {
            Set<String> attributes = sourceElement.getAttributeNames();
            for (String key : attributes)
            {
                Object value = sourceElement.getAttribute(key);
                if (key == null)
                {
                    // The null key cannot be accessed in the context.
                    // So if the attribute NULL_KEY_CONTEXT_NAME does not
                    // exist, use this as attribute name.
                    if (sourceElement.getAttributeNames().contains(
                            NULL_KEY_CONTEXT_NAME))
                    {
                        continue;
                    }
                    key = NULL_KEY_CONTEXT_NAME;
                }
                context.put(key, value);
            }
            log.debug("Put attributes in context " + attributes);
        }
        else
        {
            log.debug("source attributes in context are disabled");
        }

        if (variablesInContext)
        {
            // Only consider variables visible from the namespace
            // of this outlet. If a name exists in different
            // namespaces visible from this namespace,
            // only consider the most significant name.
            Namespace namespace = getName().getNamespace();
            VariableStore variableStore
                    = controllerState.getVariableStore();
            QualifiedNameMap<Variable> visibleVariables
                    = variableStore
                        .getContent()
                        .getInHierarchy(namespace);
            for (Variable variable : visibleVariables.values())
            {
                QualifiedName qualifiedName = variable.getName();
                context.put(
                        qualifiedName.getName(),
                        variable.getValue());
            }
            log.debug("Put variables in context "
                    + visibleVariables.keySet());
        }

            String key,
            Object value,
            Variable.Scope scope,
            ControllerState controllerState)
    {
        QualifiedName qualifiedName
                = controllerState.getQualifiedName(key);
        Variable variable
                = new Variable(
                        qualifiedName,
                        value,

     * @return the variable for the given key, or null if the variable is not
     *         set or explicitly set to null.
     */
    public Object getVariable(String key, ControllerState controllerState)
    {
        QualifiedName qualifiedName
                = controllerState.getQualifiedName(key);
        VariableStore variableStore = controllerState.getVariableStore();
        Variable variable = variableStore.getInHierarchy(qualifiedName);

        Object value = null;

     *         is visible from the given namespace.
     */
    public Object getOption(String name)
    {
        Options options = unitConfiguration.getOptions();
        QualifiedName qualifiedName = getQualifiedName(name);
        Option option = options.getInHierarchy(qualifiedName);
        Object result = null;
        if (option != null)
        {
            result = option.getValue();

     * @throws NullPointerException if name is null
     * @throws IllegalArgumentException if name is no valid qualifiedName.
     */
    public QualifiedName getQualifiedName(String name)
    {
        QualifiedName qualifiedName = new QualifiedName(
                name,
                outletNamespace);
        return qualifiedName;
    }

            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)

TOP

Related Classes of org.apache.torque.generator.qname.QualifiedName

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.