Package com.volantis.xml.expression

Examples of com.volantis.xml.expression.ExpressionFactory


            throws ExpressionException {

        Expression result = null;

        if (expressionContext != null) {
            ExpressionFactory expressionFactory =
                expressionContext.getFactory();

            ExpressionParser parser =
                expressionFactory.createExpressionParser();

            result = parser.parse(expression);
        } else {
            logger.warn("missing-expression-context");
        }
View Full Code Here


        pageContextMock.expects.getBaseURL().returns(null).any();

        protocol.setMarinerPageContext(pageContextMock);
        protocol.initialiseCanvas();

        final ExpressionFactory expressionFactory =
            ExpressionFactory.getDefaultInstance();
        final NamespacePrefixTracker prefixTracker =
            NamespaceFactory.getDefaultInstance().createPrefixTracker();
        prefixTracker.startPrefixMapping("meta-property",
            XDIMESchemata.XDIME2_MCS_NAMESPACE);
        final ExpressionContext expressionContext =
            expressionFactory.createExpressionContext(null, prefixTracker);

        final EnvironmentContextMock environmentContextMock =
            new EnvironmentContextMock("environmentContextMock", expectations);
        environmentContextMock.expects.getExpressionContext()
                .returns(expressionContext).any();
View Full Code Here

    protected Value calculateValue(ExpressionContext expressionContext,
             DevicePolicyValueAccessor accessor, Value defaultValue,
             AspectRatioOutputFormat outputFormat) {

        Value value = null;
        ExpressionFactory factory = expressionContext.getFactory();

         // calculate the device's display aspect ratio from the repository
        String heightInPixels = accessor.getDependentPolicyValue(
                 DevicePolicyConstants.ACTUAL_HEIGHT_IN_PIXELS);
        String widthInPixels = accessor.getDependentPolicyValue(
View Full Code Here

    // Javadoc inherited.
    protected Value execute(ExpressionContext expressionContext,
            DevicePolicyValueAccessor accessor, Value defaultValue) {

        Value value = null;
        ExpressionFactory factory = expressionContext.getFactory();

        // this function is currently not supported, so log it and return the
        // default or unknown value
        LOGGER.info("function-unsupported", getFunctionName());
View Full Code Here

    protected Value execute(
            ExpressionContext expressionContext,
            MarinerRequestContext requestContext, String name,
            Value defaultValue) {

        ExpressionFactory factory = expressionContext.getFactory();                                 
        Value value = defaultValue;

        EnvironmentContext environmentContext =
            ContextInternals.getEnvironmentContext(requestContext);

        // See if the header can be found
        String header = environmentContext.getHeader(name);

        if (header != null) {
            value = factory.createStringValue(header);
        }

        // Add dependency information if necessary.
        DependencyContext context = expressionContext.getDependencyContext();
        if (context.isTrackingDependencies()) {
View Full Code Here

    protected Value execute(
            ExpressionContext expressionContext,
            MarinerRequestContext requestContext, String name,
            Value defaultValue) {
        ExpressionFactory factory = expressionContext.getFactory();
        Value value = defaultValue;

        EnvironmentContext environmentContext =
            ContextInternals.getEnvironmentContext(requestContext);


        // See if the header can be found
        Enumeration enumeration = environmentContext.getHeaders(name);

        // The number of headers isn't known until the enumeration has
        // been traversed so build up a dynamic array of the header
        // values
        List headers;
        if (enumeration == null || !enumeration.hasMoreElements()) {
            headers = Collections.EMPTY_LIST;
        } else {
            headers = new ArrayList();

            // Add each header, as a string value, to an array
            while (enumeration.hasMoreElements()) {
                headers.add(enumeration.nextElement());
            }

            int count = headers.size();
            // One or more header values were found so put them in
            // a sequence
            Item[] items = new Item[count];

            for (int i = 0; i < count; i++) {
                String string = (String) headers.get(i);
                items[i] = factory.createStringValue(string);
            }

            value = factory.createSequence(items);
        }

        // Add dependency information if necessary.
        DependencyContext context = expressionContext.getDependencyContext();
        if (context.isTrackingDependencies()) {
View Full Code Here

        applicationContext.setDissectionSupported(true);
        applicationContext.setFragmentationSupported(true);
        applicationContext.setCanvasTagSupported(true);
        applicationContext.setWMLCSupported(false);

        ExpressionFactory expressionFactory = ExpressionFactory.getDefaultInstance();

        ExpressionContext expressionContext =
            expressionFactory.createExpressionContext(null,
                                                      NamespaceFactory.getDefaultInstance()
                                                      .createPrefixTracker());

        expressionContext.setProperty(MarinerRequestContext.class,
                                      requestContextMock, false);
View Full Code Here

    protected Value execute(
            ExpressionContext expressionContext,
            MarinerRequestContext requestContext, String name,
            Value defaultValue) {

        ExpressionFactory factory = expressionContext.getFactory();
                               
        Value value = defaultValue;

        String param = requestContext.getParameter(name);
        if (param != null) {
            value = factory.createStringValue(param);
        }

        // Add dependency information if necessary.
        DependencyContext context = expressionContext.getDependencyContext();
        if (context.isTrackingDependencies()) {
View Full Code Here

    // Javadoc inherited.
    protected Value execute(ExpressionContext expressionContext,
            DevicePolicyValueAccessor accessor, Value defaultValue) {
        Value value = null;
        ExpressionFactory factory = expressionContext.getFactory();

        // determine if the display is monochrome
        String renderMode = accessor.getDependentPolicyValue(
                DevicePolicyConstants.RENDER_MODE);
View Full Code Here

    // Javadoc inherited.
    protected Value execute(ExpressionContext expressionContext,
            DevicePolicyValueAccessor accessor, Value defaultValue) {
       
        Value value = null;
        ExpressionFactory factory = expressionContext.getFactory();

         // retrieve the pixel depth of the display from the repository
        String pixelDepth = accessor.getDependentPolicyValue(
                DevicePolicyConstants.PIXEL_DEPTH);
View Full Code Here

TOP

Related Classes of com.volantis.xml.expression.ExpressionFactory

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.