//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vBeta 
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2004.05.26 at 03:38:22 CEST 
//


package phex.xml.impl;

public class XJBSWDownloadSegmentImpl implements phex.xml.XJBSWDownloadSegment, com.sun.xml.bind.unmarshaller.UnmarshallableObject, com.sun.xml.bind.serializer.XMLSerializable, com.sun.xml.bind.validator.ValidatableObject
{

    private final static Class PRIMARY_INTERFACE_CLASS = phex.xml.XJBSWDownloadSegment.class;
    protected boolean has_Length;
    protected long _Length;
    protected String _IncompleteFileName;
    protected boolean has_StartPosition;
    protected long _StartPosition;
    protected boolean has_SegmentNumber;
    protected int _SegmentNumber;
    private final static com.sun.msv.grammar.Grammar schemaFragment = com.sun.xml.bind.validator.SchemaDeserializer.deserialize("\u00ac\u00ed\u0000\u0005sr\u0000\u001fcom.sun.msv.grammar.SequenceExp\u0091Ue\u00f1\u0017p\u00f3\u00ad\u0002\u0000\u0000xr\u0000\u001dcom.sun.msv.grammar.BinaryExp\u009f\u008d\u000fi<\u00c1_\u00b7\u0002\u0000\u0002L\u0000\u0004exp1t\u0000 Lcom/sun/msv/grammar/Expression;L\u0000\u0004exp2q\u0000~\u0000\u0002xr\u0000\u001ecom.sun.msv.grammar.Expression\u00f8\u0018\u0082\u00e8N5~O\u0002\u0000\u0003I\u0000\u000ecachedHashCodeL\u0000\u0013epsilonReducibilityt\u0000\u0013Ljava/lang/Boolean;L\u0000\u000bexpandedExpq\u0000~\u0000\u0002xp\u0002\u0088H\u00b5ppsq\u0000~\u0000\u0000\u0001\u00b4E\u00adppsq\u0000~\u0000\u0000\u0000\u00e0B\u00a5ppsr\u0000\u001dcom.sun.msv.grammar.ChoiceExp\u00c6|\u00ec3\u0087\u00b8\u00f9\u00f4\u0002\u0000\u0000xq\u0000~\u0000\u0001\u0000Q\u0005Sppsr\u0000\'com.sun.msv.grammar.trex.ElementPattern\u008b\u0010\u001fsu\u008b\u0091\u00c2\u0002\u0000\u0001L\u0000\tnameClasst\u0000\u001fLcom/sun/msv/grammar/NameClass;xr\u0000\u001ecom.sun.msv.grammar.ElementExp\u00d3\u00c6b\u0095\u0015\rC\u0092\u0002\u0000\u0002Z\u0000\u001aignoreUndeclaredAttributesL\u0000\fcontentModelq\u0000~\u0000\u0002xq\u0000~\u0000\u0003\u0000Q\u0005Hsr\u0000\u0011java.lang.Boolean\u00cd r\u0080\u00d5\u009c\u00fa\u00ee\u0002\u0000\u0001Z\u0000\u0005valuexp\u0000p\u0000sr\u0000\u001bcom.sun.msv.grammar.DataExp8\u00f5\u00f5>{j!\u00cb\u0002\u0000\u0003L\u0000\u0002dtt\u0000\u001fLorg/relaxng/datatype/Datatype;L\u0000\u0006exceptq\u0000~\u0000\u0002L\u0000\u0004namet\u0000\u001dLcom/sun/msv/util/StringPair;xq\u0000~\u0000\u0003\u0000Q\u0005=ppsr\u0000#com.sun.msv.datatype.xsd.StringType\u00c0\t\u00a9y\u00f6\u0011\u009b\u00e6\u0002\u0000\u0000xr\u0000*com.sun.msv.datatype.xsd.BuiltinAtomicType\u0002\u00ff10\u00a8bR\u00ca\u0002\u0000\u0000xr\u0000%com.sun.msv.datatype.xsd.ConcreteType7\u00adsa|\u00d7Z\u001d\u0002\u0000\u0000xr\u0000\'com.sun.msv.datatype.xsd.XSDatatypeImpl4\u00e9\u0099H.\u00872z\u0002\u0000\u0003L\u0000\fnamespaceUrit\u0000\u0012Ljava/lang/String;L\u0000\btypeNameq\u0000~\u0000\u0018L\u0000\nwhiteSpacet\u0000.Lcom/sun/msv/datatype/xsd/WhiteSpaceProcessor;xpt\u0000 http://www.w3.org/2001/XMLSchemat\u0000\u0006stringsr\u0000.com.sun.msv.datatype.xsd.WhiteSpaceProcessor$1\u0013JMoI\u00db\u00a4G\u0002\u0000\u0000xr\u0000,com.sun.msv.datatype.xsd.WhiteSpaceProcessorip\u00ff0C\u00ce\u000eN\u0002\u0000\u0000xpsr\u00000com.sun.msv.grammar.Expression$NullSetExpression s\u0080\u0089\u0096\u00cf\u009a@\u0002\u0000\u0000xq\u0000~\u0000\u0003\u0000\u0000\u0000\nq\u0000~\u0000\u000fpsr\u0000\u001bcom.sun.msv.util.StringPair\u00d0t\u001ejB\u008f\u008d\u00a0\u0002\u0000\u0002L\u0000\tlocalNameq\u0000~\u0000\u0018L\u0000\fnamespaceURIq\u0000~\u0000\u0018xpq\u0000~\u0000\u001cq\u0000~\u0000\u001bsr\u0000#com.sun.msv.grammar.SimpleNameClass\u0091\u00e9\u00f7\u008d\u00ab\u0010\u00aa\u00f5\u0002\u0000\u0002L\u0000\tlocalNameq\u0000~\u0000\u0018L\u0000\fnamespaceURIq\u0000~\u0000\u0018xr\u0000\u001dcom.sun.msv.grammar.NameClass\u009c}\u00d4kB\u00c7\tk\u0002\u0000\u0000xpt\u0000\u0012incompleteFileNamet\u0000\u0000sr\u00000com.sun.msv.grammar.Expression$EpsilonExpression\u0098v\u00e3\u0003Z\u00fex\u00ee\u0002\u0000\u0000xq\u0000~\u0000\u0003\u0000\u0000\u0000\tsq\u0000~\u0000\u000e\u0001psq\u0000~\u0000\b\u0000\u008f=Mppsq\u0000~\u0000\n\u0000\u008f=Bq\u0000~\u0000\u000fp\u0000sq\u0000~\u0000\u0010\u0000\u008f=7ppsr\u0000 com.sun.msv.datatype.xsd.IntType\u00bel\u00b6\u0018\u00b0\u0014\u00e4\u0014\u0002\u0000\u0000xr\u0000+com.sun.msv.datatype.xsd.IntegerDerivedType\u0099\u00f1]\u0090&6k\u00be\u0002\u0000\u0000xq\u0000~\u0000\u0015q\u0000~\u0000\u001bt\u0000\u0003intsr\u0000.com.sun.msv.datatype.xsd.WhiteSpaceProcessor$2\u0087z9\u00ee\u00f8,N\u0005\u0002\u0000\u0000xq\u0000~\u0000\u001eq\u0000~\u0000!sq\u0000~\u0000\"q\u0000~\u00002q\u0000~\u0000\u001bsq\u0000~\u0000$t\u0000\rsegmentNumberq\u0000~\u0000(q\u0000~\u0000*sq\u0000~\u0000\b\u0000\u00d4\u0003\u0003ppsq\u0000~\u0000\n\u0000\u00d4\u0002\u00f8q\u0000~\u0000\u000fp\u0000sq\u0000~\u0000\u0010\u0000\u00d4\u0002\u00edppsr\u0000!com.sun.msv.datatype.xsd.LongType\u00e8A\u00fc\u001d>J\u00a1\u00c1\u0002\u0000\u0000xq\u0000~\u00000q\u0000~\u0000\u001bt\u0000\u0004longq\u0000~\u00004q\u0000~\u0000!sq\u0000~\u0000\"q\u0000~\u0000=q\u0000~\u0000\u001bsq\u0000~\u0000$t\u0000\rstartPositionq\u0000~\u0000(q\u0000~\u0000*sq\u0000~\u0000\b\u0000\u00d4\u0003\u0003ppsq\u0000~\u0000\n\u0000\u00d4\u0002\u00f8q\u0000~\u0000\u000fp\u0000q\u0000~\u0000:sq\u0000~\u0000$t\u0000\u0006lengthq\u0000~\u0000(q\u0000~\u0000*sr\u0000\"com.sun.msv.grammar.ExpressionPool\u00e5\u00f3J;\u00cd]^\u00f8\u0002\u0000\u0001L\u0000\bexpTablet\u0000/Lcom/sun/msv/grammar/ExpressionPool$ClosedHash;xpsr\u0000-com.sun.msv.grammar.ExpressionPool$ClosedHash\u00d7j\u00d0N\u00ef\u00e8\u00ed\u001c\u0002\u0000\u0004I\u0000\u0005countI\u0000\tthresholdL\u0000\u0006parentq\u0000~\u0000F[\u0000\u0005tablet\u0000![Lcom/sun/msv/grammar/Expression;xp\u0000\u0000\u0000\u0007\u0000\u0000\u00009pur\u0000![Lcom.sun.msv.grammar.Expression;\u00d68D\u00c3]\u00ad\u00a7\n\u0002\u0000\u0000xp\u0000\u0000\u0000\u00bfpppppppppppppppppppppppppppppppppppppppppppppppppppppppppq\u0000~\u0000\u0007pppppppppppppppq\u0000~\u0000,ppppppppppppppppppq\u0000~\u0000\u0005pppppppppppppppq\u0000~\u00008q\u0000~\u0000Appppppppppppppppppppppppppppppppppppppppppppppppppppppppppppq\u0000~\u0000\tq\u0000~\u0000\u0006ppppppppppppppppppp");

    public long getLength() {
        return _Length;
    }

    public void setLength(long value) {
        _Length = value;
        has_Length = true;
    }

    public String getIncompleteFileName() {
        return _IncompleteFileName;
    }

    public void setIncompleteFileName(String value) {
        _IncompleteFileName = value;
    }

    public long getStartPosition() {
        return _StartPosition;
    }

    public void setStartPosition(long value) {
        _StartPosition = value;
        has_StartPosition = true;
    }

    public int getSegmentNumber() {
        return _SegmentNumber;
    }

    public void setSegmentNumber(int value) {
        _SegmentNumber = value;
        has_SegmentNumber = true;
    }

    public com.sun.xml.bind.unmarshaller.ContentHandlerEx getUnmarshaller(com.sun.xml.bind.unmarshaller.UnmarshallingContext context) {
        return new phex.xml.impl.XJBSWDownloadSegmentImpl.Unmarshaller(context);
    }

    public Class getPrimaryInterfaceClass() {
        return PRIMARY_INTERFACE_CLASS;
    }

    public void serializeElements(com.sun.xml.bind.serializer.XMLSerializer context)
        throws org.xml.sax.SAXException
    {
        if (_IncompleteFileName!= null) {
            context.startElement("", "incompleteFileName");
            context.endAttributes();
            context.text(((String) _IncompleteFileName));
            context.endElement();
        }
        if (has_SegmentNumber) {
            context.startElement("", "segmentNumber");
            context.endAttributes();
            context.text(com.sun.msv.datatype.xsd.IntType.save(((Integer) new java.lang.Integer(_SegmentNumber))));
            context.endElement();
        }
        if (has_StartPosition) {
            context.startElement("", "startPosition");
            context.endAttributes();
            context.text(com.sun.msv.datatype.xsd.LongType.save(((Long) new java.lang.Long(_StartPosition))));
            context.endElement();
        }
        if (has_Length) {
            context.startElement("", "length");
            context.endAttributes();
            context.text(com.sun.msv.datatype.xsd.LongType.save(((Long) new java.lang.Long(_Length))));
            context.endElement();
        }
    }

    public void serializeAttributes(com.sun.xml.bind.serializer.XMLSerializer context)
        throws org.xml.sax.SAXException
    {
    }

    public void serializeAttributeBodies(com.sun.xml.bind.serializer.XMLSerializer context)
        throws org.xml.sax.SAXException
    {
    }

    public Class getPrimaryInterface() {
        return (phex.xml.XJBSWDownloadSegment.class);
    }

    public com.sun.msv.verifier.DocumentDeclaration createRawValidator() {
        return new com.sun.msv.verifier.regexp.REDocumentDeclaration(schemaFragment);
    }

    public class Unmarshaller
        extends com.sun.xml.bind.unmarshaller.ContentHandlerEx
    {


        public Unmarshaller(com.sun.xml.bind.unmarshaller.UnmarshallingContext context) {
            super(context, "---------");
        }

        protected com.sun.xml.bind.unmarshaller.UnmarshallableObject owner() {
            return phex.xml.impl.XJBSWDownloadSegmentImpl.this;
        }

        public void enterElement(String ___uri, String ___local, org.xml.sax.Attributes __atts)
            throws com.sun.xml.bind.unmarshaller.UnreportedException
        {
            switch (state) {
                case  0 :
                    if ("".equals(___uri)&&"segmentNumber".equals(___local)) {
                        context.pushAttributes(__atts);
                        state = 1;
                        return ;
                    }
                    if ("".equals(___uri)&&"incompleteFileName".equals(___local)) {
                        context.pushAttributes(__atts);
                        state = 3;
                        return ;
                    }
                    if ("".equals(___uri)&&"length".equals(___local)) {
                        context.pushAttributes(__atts);
                        state = 7;
                        return ;
                    }
                    if ("".equals(___uri)&&"startPosition".equals(___local)) {
                        context.pushAttributes(__atts);
                        state = 5;
                        return ;
                    }
                    revertToParentFromEnterElement(___uri, ___local, __atts);
                    return ;
            }
            super.enterElement(___uri, ___local, __atts);
        }

        public void leaveElement(String ___uri, String ___local)
            throws com.sun.xml.bind.unmarshaller.UnreportedException
        {
            switch (state) {
                case  0 :
                    revertToParentFromLeaveElement(___uri, ___local);
                    return ;
                case  2 :
                    if ("".equals(___uri)&&"segmentNumber".equals(___local)) {
                        context.popAttributes();
                        state = 0;
                        return ;
                    }
                    break;
                case  4 :
                    if ("".equals(___uri)&&"incompleteFileName".equals(___local)) {
                        context.popAttributes();
                        state = 0;
                        return ;
                    }
                    break;
                case  8 :
                    if ("".equals(___uri)&&"length".equals(___local)) {
                        context.popAttributes();
                        state = 0;
                        return ;
                    }
                    break;
                case  6 :
                    if ("".equals(___uri)&&"startPosition".equals(___local)) {
                        context.popAttributes();
                        state = 0;
                        return ;
                    }
                    break;
            }
            super.leaveElement(___uri, ___local);
        }

        public void enterAttribute(String ___uri, String ___local)
            throws com.sun.xml.bind.unmarshaller.UnreportedException
        {
            switch (state) {
                case  0 :
                    revertToParentFromEnterAttribute(___uri, ___local);
                    return ;
            }
            super.enterAttribute(___uri, ___local);
        }

        public void leaveAttribute(String ___uri, String ___local)
            throws com.sun.xml.bind.unmarshaller.UnreportedException
        {
            switch (state) {
                case  0 :
                    revertToParentFromLeaveAttribute(___uri, ___local);
                    return ;
            }
            super.leaveAttribute(___uri, ___local);
        }

        public void text(String value)
            throws com.sun.xml.bind.unmarshaller.UnreportedException
        {
            try {
                switch (state) {
                    case  7 :
                        _Length = com.sun.msv.datatype.xsd.LongType.load(com.sun.xml.bind.WhiteSpaceProcessor.collapse(value)).longValue();
                        has_Length = true;
                        state = 8;
                        return ;
                    case  5 :
                        _StartPosition = com.sun.msv.datatype.xsd.LongType.load(com.sun.xml.bind.WhiteSpaceProcessor.collapse(value)).longValue();
                        has_StartPosition = true;
                        state = 6;
                        return ;
                    case  0 :
                        revertToParentFromText(value);
                        return ;
                    case  3 :
                        _IncompleteFileName = value;
                        state = 4;
                        return ;
                    case  1 :
                        _SegmentNumber = com.sun.msv.datatype.xsd.IntType.load(com.sun.xml.bind.WhiteSpaceProcessor.collapse(value)).intValue();
                        has_SegmentNumber = true;
                        state = 2;
                        return ;
                }
            } catch (RuntimeException e) {
                handleUnexpectedTextException(value, e);
            }
        }

    }

}
