Package org.foray.fotree.value

Examples of org.foray.fotree.value.PropertyValue


     * @return The parsed, storable property value.
     * @throws PropertyException For an invalid property value.
     */
    private PropertyValue createPropertyValue(final FObj fobj,
            final String value) throws PropertyException {
        PropertyValue pv = standardParse(fobj, value);
        if (pv.canEvalKeyword()) {
            return pv;
        }
        pv = DtURI.makeUriDT(value);
        if (pv != null) {
            return pv;
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;
        }

        /* There should be one or more border-width instances. If there is only
         * one, it will not be returned above as a valid property value, because
         * we only test for "inherit" there. Therefore we need to tokenize
         * and parse each item, even if there is only one token. */
        final ValueCollection collection = new ValueCollection();
        final StringTokenizer st = new StringTokenizer(value);
        if (st.countTokens() < 1
                || st.countTokens() > PdBorderWidth.MAX_TOKENS) {
            throw this.unexpectedValue(value, fobj);
        }
        while (st.hasMoreTokens()) {
            final String token = st.nextToken();
            final PropertyValue parsedToken = this.standardParse(fobj, token,
                    DtBorderWidth.VALID_KEYWORDS);
            if (DtBorderWidth.isBorderWidth(parsedToken)) {
                collection.addItem(parsedToken);
            } else {
                throw this.unexpectedValue(token, fobj);
View Full Code Here

    private int getCollectionValue(final FoContext context,
            final RelativeCompass direction, final FObj fobj) {
        final ValueCollection collection = (ValueCollection) value();
        final int whichElement = PropertyCollection.whichElementForDirectional(
                direction, collection.getCount());
        final PropertyValue value = collection.getItem(whichElement);
        if (value.canEvalLength()) {
            return this.convertValueToLength(value, fobj, context);
        }
        if (value.canEvalKeyword()) {
            final FoPropertyKeyword keyword = (FoPropertyKeyword) value;
            final FoValue keywordValue = keyword.getValue();
            switch (keywordValue) {
            case THIN: {
                return DtBorderWidth.BORDER_WIDTH_THIN;
View Full Code Here

     */
    private PdBorderSeparation createPropertyValue(final FObj fobj,
            final String value) throws PropertyException {
        /* BorderSpacing is a shorthand for BorderSeparation, so we will create
         * and wrap an actual BorderSeparation instance. */
        final PropertyValue pv = this.standardParse(fobj, value);
        if (pv.canEvalKeyword()) {
            return new PdBorderSeparation(pv);
        }
        if (pv.canEvalLength()) {
            /* There is only one length. */
            final DtLengthBPIPDirection bpip = new DtLengthBPIPDirection(pv,
                    pv);
            return new PdBorderSeparation(bpip);
        }

        /* The only other valid option is that there are two lengths. */
        final StringTokenizer st = new StringTokenizer(value);
        if (st.countTokens() != 2) {
            throw unexpectedValue(value, fobj);
        }

        final PropertyValue token1 = standardParse(fobj, st.nextToken());
        final PropertyValue token2 = standardParse(fobj, st.nextToken());
        if (token1.canEvalLength()
                && token2.canEvalLength()) {
            final DtLengthBPIPDirection bpip = new DtLengthBPIPDirection(token1,
                    token2);
            return new PdBorderSeparation(bpip);
        }
        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 = checkKeywords(this.getValidKeywords(), value);
        if (pv != null) {
            return pv;
        }
        final List<String> tokenizedList = DtURI.tokenizeURIList(value);
        if (tokenizedList.size() > 0) {
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.canEvalPercentage()) {
            return pv;
        }
        if (pv.canEvalLength()) {
            return pv;
        }
        if (pv instanceof FnProportionalColWidth) {
            // Used to store proportional column width
            return pv;
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.canEvalNumeric()) {
            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.canEvalNumeric()) {
            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;
        }
        final DtCountry dtCountry = DtCountry.makeCountryDT(value);
        if (dtCountry != null
                && dtCountry.getValue() != Country.NULL) {
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

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.