Package org.foray.fotree.value

Examples of org.foray.fotree.value.PropertyValue


     * @return The PropertyValue instance created by the parser.
     * @throws PropertyException If the input is inconsistent.
     */
    protected PropertyValue standardParse(final FObj fobj,
            final String rawPropertyValue) throws PropertyException {
        PropertyValue pv = checkKeywords(getValidKeywords(), rawPropertyValue);
        if (pv != null) {
            return pv;
        }
        pv = PropertyParser.parse(fobj, rawPropertyValue,
                this.getPropertyType());
View Full Code Here


     */
    private PropertyValue createPropertyValue(final FObj fobj,
            final String propertyFullName, final String value)
            throws PropertyException {
        final PropertyCollection collection = new PropertyCollection();
        final PropertyValue pv = checkKeywords(this.getValidKeywords(), value);
        if (pv != null) {
            collection.addItem(new PdCountry(pv));
            collection.addItem(new PdLanguage(pv));
            return collection;
        }
View Full Code Here

    public static PropertyValue parse(final FObj fobj,
            final String expr, final PropertyType propertyType)
            throws PropertyException {
        final PropertyParser parser = new PropertyParser(fobj, expr,
                propertyType);
        PropertyValue pv = parser.parseProperty();
        if (pv == null) {
            pv = new DtString(expr);
        }
        return pv;
    }
View Full Code Here

        if (getCurrentToken() == TOK_EOF) {
            // if prop value is empty string, force to StringProperty
            return new DtString("");
        }
        while (true) {
            final PropertyValue prop = parseAdditiveExpr();
            if (getCurrentToken() == TOK_EOF) {
                return prop;
            }
            /* If what is parsed so far is not numeric, it cannot be a part of
             * an additive expression. Therefore, as far as this parser is
             * concerned, the expression is an error. */
            if (! prop.canEvalNumeric()) {
                return null;
            }
        }
    }
View Full Code Here

     * @throws PropertyException If the number of arguments found isn't equal
     * to the number expected.
     */
    Expr[] parseArgs() throws PropertyException {
        final List<PropertyValue> args = new ArrayList<PropertyValue>();
        PropertyValue prop;
        if (getCurrentToken() == TOK_RPAR) {
            // No args: func()
            next();
        } else {
            while (true) {
View Full Code Here

     * @return The parsed, storable property value.
     * @throws PropertyException For an invalid property value.
     */
    private PropertyValue createPropertyValue(final FObj fobj,
            final String value) throws PropertyException {
        final PropertyValue pv = standardParse(fobj, value);
        if (pv.canEvalKeyword()) {
            return pv;
        }
        if (pv.canEvalPercentage()) {
            return pv;
        }
        if (pv.canEvalLength()) {
            return pv;
        }
        throw unexpectedValue(value, fobj);
    }
View Full Code Here

     * @return The parsed, storable property value.
     * @throws PropertyException For an invalid property value.
     */
    private PropertyValue createPropertyValue(final FObj fobj,
            final String value) throws PropertyException {
        final PropertyValue pv = this.standardParse(fobj, value);
        if (pv.canEvalKeyword()) {
            return pv;
        }

        /* The remaining case is a comma-delimited list of font-families. */
        final StringTokenizer tokenizer = new StringTokenizer(value, ",");
        if (tokenizer.countTokens() < 1) {
            throw this.unexpectedValue(value, fobj);
        }
        final ValueCollection collection = new ValueCollection();
        while (tokenizer.hasMoreTokens()) {
            final String token = tokenizer.nextToken().trim();
            final PropertyValue parsedToken = this.standardParse(fobj, token,
                    PdFontFamily.VALID_TOKEN_KEYWORDS);
            if (parsedToken.canEvalKeyword()
                    || parsedToken instanceof DtName
                    || parsedToken instanceof DtString) {
                collection.addItem(parsedToken);
            } else {
                throw this.unexpectedValue(token, fobj);
View Full Code Here

        if (value() instanceof ValueCollection) {
            final ValueCollection collection = (ValueCollection) value();
            final String[] returnArray = new String[collection.getCount()];
            for (int i = 0; i < collection.getCount(); i++) {
                final PropertyValue pv = collection.getItem(i);
                if (pv.canEvalKeyword()) {
                    final FoValue foValue = this.convertValueToFoValue(pv);
                    returnArray[i] = foValue.toXslFo();
                } else if (pv instanceof DtName) {
                    final DtName dtName = (DtName) pv;
                    returnArray[i] = dtName.getValue();
View Full Code Here

     * @return The parsed, storable property value.
     * @throws PropertyException For an invalid property value.
     */
    private PropertyValue createPropertyValue(final FObj fobj,
            final String value) throws PropertyException {
        final PropertyValue pv = standardParse(fobj, value);
        if (pv.canEvalKeyword()) {
            return pv;
        }
        if (pv.canEvalPercentage()) {
            return pv;
        }
        if (pv.canEvalLength()) {
            return pv;
        }
        throw unexpectedValue(value, fobj);
    }
View Full Code Here

     * @return The parsed, storable property value.
     * @throws PropertyException For an invalid property value.
     */
    private PropertyValue createPropertyValue(final FObj fobj,
            final String value) throws PropertyException {
        final PropertyValue pv = standardParse(fobj, value);
        if (pv.canEvalKeyword()) {
            return pv;
        }
        if (pv instanceof DtURI) {
            return pv;
        }
View Full Code Here

TOP

Related Classes of org.foray.fotree.value.PropertyValue

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.