Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.GDate


    protected String compute_text(NamespaceManager nsm)
        { return _value == null ? "" : _value.toString(); }

    protected void set_text(String s)
    {
        GDate newVal;
        if (_validateOnSet())
            newVal = validateLexical(s, _schemaType, _voorVc);
        else
            newVal = lex(s, _schemaType, _voorVc);
View Full Code Here


        _value = newVal;
    }

    public static GDate lex(String v, SchemaType sType, ValidationContext context)
    {
        GDate date = null;

        try
        {
            date = new GDate(v);
        }
        catch (Exception e)
        {
            context.invalid(XmlErrorCodes.DATE, new Object[] { v });
        }

        if (date != null)
        {
            if (date.getBuiltinTypeCode() != sType.getPrimitiveType().getBuiltinTypeCode())
            {
                context.invalid(XmlErrorCodes.DATE, new Object[] { "wrong type: " + v });
                date = null;
            }
            else if (!date.isValid())
            {
                context.invalid(XmlErrorCodes.DATE, new Object[] { v });
                date = null;
            }
        }
View Full Code Here

    }

    public static GDate validateLexical(String v, SchemaType sType, ValidationContext context)
    {

        GDate date = lex(v, sType, context);

        if (date != null && sType.hasPatternFacet())
            if (!sType.matchPatternFacet(v))
                context.invalid(XmlErrorCodes.DATATYPE_VALID$PATTERN_VALID,
                    new Object[] { "date", v, QNameHelper.readable(sType) });
View Full Code Here

    }

    public static void validateValue(GDateSpecification v, SchemaType sType, ValidationContext context)
    {
        XmlObject x;
        GDate g;

        if (v.getBuiltinTypeCode() != sType.getPrimitiveType().getBuiltinTypeCode())
            context.invalid(XmlErrorCodes.DATE, new Object[] { "Date (" + v + ") does not have the set of fields required for " + QNameHelper.readable(sType) });

        if ((x = sType.getFacet(SchemaType.FACET_MIN_EXCLUSIVE)) != null)
View Full Code Here

    protected void set_GDate(GDateSpecification v)
    {
        int code = schemaType().getPrimitiveType().getBuiltinTypeCode();

        GDate candidate;

        if (v.isImmutable() && (v instanceof GDate) && v.getBuiltinTypeCode() == code)
            candidate = (GDate)v;
        else
        {
            // truncate extra fields from the date if necessary.
            if (v.getBuiltinTypeCode() != code)
            {
                GDateBuilder gDateBuilder = new GDateBuilder(v);
                gDateBuilder.setBuiltinTypeCode(code);
                v = gDateBuilder;
            }
            candidate = new GDate(v);
        }

        if (_validateOnSet())
            validateValue(candidate, _schemaType, _voorVc);
View Full Code Here

    {
        int code = schemaType().getPrimitiveType().getBuiltinTypeCode();

        GDateBuilder gDateBuilder = new GDateBuilder(c);
        gDateBuilder.setBuiltinTypeCode(code);
        GDate value = gDateBuilder.toGDate();
        if (_validateOnSet())
            validateValue(value, _schemaType, _voorVc);

        _value = value;
View Full Code Here

            v == null)
            throw new XmlValueOutOfRangeException();

        GDateBuilder gDateBuilder = new GDateBuilder(v);
        gDateBuilder.setBuiltinTypeCode(code);
        GDate value = gDateBuilder.toGDate();
        if (_validateOnSet())
            validateValue(value, _schemaType, _voorVc);

        _value = value;
View Full Code Here

    }

    // ======================== GDate ========================
    public static GDate lexGDate(CharSequence charSeq)
    {
        return new GDate(charSeq);
    }
View Full Code Here

    public static GDateSpecification getGDateValue(Date d,
                                                   int builtin_type_code)
    {
        GDateBuilder gDateBuilder = new GDateBuilder(d);
        gDateBuilder.setBuiltinTypeCode(builtin_type_code);
        GDate value = gDateBuilder.toGDate();
        return value;
    }
View Full Code Here

    public static GDateSpecification getGDateValue(Calendar c,
                                                   int builtin_type_code)
    {
        GDateBuilder gDateBuilder = new GDateBuilder(c);
        gDateBuilder.setBuiltinTypeCode(builtin_type_code);
        GDate value = gDateBuilder.toGDate();
        return value;
    }
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.GDate

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.