//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v1.0.5-20051113-fcs 
// 	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: 2005.11.16 um 11:03:34 CET 
//


package phex.xml.impl;

public class XJBIPAccessRuleImpl
    extends phex.xml.impl.XJBSecurityRuleImpl
    implements phex.xml.XJBIPAccessRule, com.sun.xml.bind.JAXBObject, phex.xml.impl.runtime.UnmarshallableObject, phex.xml.impl.runtime.XMLSerializable
{

    protected byte[] _CompareIP;
    protected byte[] _Ip;
    protected boolean has_AddressType;
    protected byte _AddressType;
    public final static java.lang.Class version = (phex.xml.impl.JAXBVersion.class);

    private final static java.lang.Class PRIMARY_INTERFACE_CLASS() {
        return (phex.xml.XJBIPAccessRule.class);
    }

    public byte[] getCompareIP() {
        return _CompareIP;
    }

    public void setCompareIP(byte[] value) {
        _CompareIP = value;
    }

    public byte[] getIp() {
        return _Ip;
    }

    public void setIp(byte[] value) {
        _Ip = value;
    }

    public byte getAddressType() {
        return _AddressType;
    }

    public void setAddressType(byte value) {
        _AddressType = value;
        has_AddressType = true;
    }

    public phex.xml.impl.runtime.UnmarshallingEventHandler createUnmarshaller(phex.xml.impl.runtime.UnmarshallingContext context) {
        return new phex.xml.impl.XJBIPAccessRuleImpl.Unmarshaller(context);
    }

    public void serializeBody(phex.xml.impl.runtime.XMLSerializer context)
        throws org.xml.sax.SAXException
    {
        super.serializeBody(context);
        if (has_AddressType) {
            context.startElement("", "addressType");
            context.endNamespaceDecls();
            context.endAttributes();
            try {
                context.text(javax.xml.bind.DatatypeConverter.printByte(((byte) _AddressType)), "AddressType");
            } catch (java.lang.Exception e) {
                phex.xml.impl.runtime.Util.handlePrintConversionException(this, e, context);
            }
            context.endElement();
        }
        if (_Ip!= null) {
            context.startElement("", "ip");
            context.endNamespaceDecls();
            context.endAttributes();
            try {
                context.text(com.sun.msv.datatype.xsd.HexBinaryType.save(((byte[]) _Ip)), "Ip");
            } catch (java.lang.Exception e) {
                phex.xml.impl.runtime.Util.handlePrintConversionException(this, e, context);
            }
            context.endElement();
        }
        if (_CompareIP!= null) {
            context.startElement("", "compareIP");
            context.endNamespaceDecls();
            context.endAttributes();
            try {
                context.text(com.sun.msv.datatype.xsd.HexBinaryType.save(((byte[]) _CompareIP)), "CompareIP");
            } catch (java.lang.Exception e) {
                phex.xml.impl.runtime.Util.handlePrintConversionException(this, e, context);
            }
            context.endElement();
        }
    }

    public void serializeAttributes(phex.xml.impl.runtime.XMLSerializer context)
        throws org.xml.sax.SAXException
    {
        super.serializeAttributes(context);
    }

    public void serializeURIs(phex.xml.impl.runtime.XMLSerializer context)
        throws org.xml.sax.SAXException
    {
        super.serializeURIs(context);
    }

    public class Unmarshaller
        extends phex.xml.impl.runtime.AbstractUnmarshallingEventHandlerImpl
    {


        public Unmarshaller(phex.xml.impl.runtime.UnmarshallingContext context) {
            super(context, "-----------");
        }

        protected Unmarshaller(phex.xml.impl.runtime.UnmarshallingContext context, int startState) {
            this(context);
            state = startState;
        }

        public java.lang.Object owner() {
            return phex.xml.impl.XJBIPAccessRuleImpl.this;
        }

        public void enterElement(java.lang.String ___uri, java.lang.String ___local, java.lang.String ___qname, org.xml.sax.Attributes __atts)
            throws org.xml.sax.SAXException
        {
            int attIdx;
            outer:
            while (true) {
                switch (state) {
                    case  0 :
                        if (("description" == ___local)&&("" == ___uri)) {
                            spawnHandlerFromEnterElement((((phex.xml.impl.XJBSecurityRuleImpl)phex.xml.impl.XJBIPAccessRuleImpl.this).new Unmarshaller(context)), 1, ___uri, ___local, ___qname, __atts);
                            return ;
                        }
                        if (("isDenyingRule" == ___local)&&("" == ___uri)) {
                            spawnHandlerFromEnterElement((((phex.xml.impl.XJBSecurityRuleImpl)phex.xml.impl.XJBIPAccessRuleImpl.this).new Unmarshaller(context)), 1, ___uri, ___local, ___qname, __atts);
                            return ;
                        }
                        if (("isDisabled" == ___local)&&("" == ___uri)) {
                            spawnHandlerFromEnterElement((((phex.xml.impl.XJBSecurityRuleImpl)phex.xml.impl.XJBIPAccessRuleImpl.this).new Unmarshaller(context)), 1, ___uri, ___local, ___qname, __atts);
                            return ;
                        }
                        if (("isSystemRule" == ___local)&&("" == ___uri)) {
                            spawnHandlerFromEnterElement((((phex.xml.impl.XJBSecurityRuleImpl)phex.xml.impl.XJBIPAccessRuleImpl.this).new Unmarshaller(context)), 1, ___uri, ___local, ___qname, __atts);
                            return ;
                        }
                        if (("triggerCount" == ___local)&&("" == ___uri)) {
                            spawnHandlerFromEnterElement((((phex.xml.impl.XJBSecurityRuleImpl)phex.xml.impl.XJBIPAccessRuleImpl.this).new Unmarshaller(context)), 1, ___uri, ___local, ___qname, __atts);
                            return ;
                        }
                        if (("expiryDate" == ___local)&&("" == ___uri)) {
                            spawnHandlerFromEnterElement((((phex.xml.impl.XJBSecurityRuleImpl)phex.xml.impl.XJBIPAccessRuleImpl.this).new Unmarshaller(context)), 1, ___uri, ___local, ___qname, __atts);
                            return ;
                        }
                        if (("isDeletedOnExpiry" == ___local)&&("" == ___uri)) {
                            spawnHandlerFromEnterElement((((phex.xml.impl.XJBSecurityRuleImpl)phex.xml.impl.XJBIPAccessRuleImpl.this).new Unmarshaller(context)), 1, ___uri, ___local, ___qname, __atts);
                            return ;
                        }
                        spawnHandlerFromEnterElement((((phex.xml.impl.XJBSecurityRuleImpl)phex.xml.impl.XJBIPAccessRuleImpl.this).new Unmarshaller(context)), 1, ___uri, ___local, ___qname, __atts);
                        return ;
                    case  4 :
                        if (("ip" == ___local)&&("" == ___uri)) {
                            context.pushAttributes(__atts, true);
                            state = 5;
                            return ;
                        }
                        state = 7;
                        continue outer;
                    case  1 :
                        if (("addressType" == ___local)&&("" == ___uri)) {
                            context.pushAttributes(__atts, true);
                            state = 2;
                            return ;
                        }
                        state = 4;
                        continue outer;
                    case  7 :
                        if (("compareIP" == ___local)&&("" == ___uri)) {
                            context.pushAttributes(__atts, true);
                            state = 8;
                            return ;
                        }
                        state = 10;
                        continue outer;
                    case  10 :
                        revertToParentFromEnterElement(___uri, ___local, ___qname, __atts);
                        return ;
                }
                super.enterElement(___uri, ___local, ___qname, __atts);
                break;
            }
        }

        public void leaveElement(java.lang.String ___uri, java.lang.String ___local, java.lang.String ___qname)
            throws org.xml.sax.SAXException
        {
            int attIdx;
            outer:
            while (true) {
                switch (state) {
                    case  0 :
                        spawnHandlerFromLeaveElement((((phex.xml.impl.XJBSecurityRuleImpl)phex.xml.impl.XJBIPAccessRuleImpl.this).new Unmarshaller(context)), 1, ___uri, ___local, ___qname);
                        return ;
                    case  3 :
                        if (("addressType" == ___local)&&("" == ___uri)) {
                            context.popAttributes();
                            state = 4;
                            return ;
                        }
                        break;
                    case  6 :
                        if (("ip" == ___local)&&("" == ___uri)) {
                            context.popAttributes();
                            state = 7;
                            return ;
                        }
                        break;
                    case  4 :
                        state = 7;
                        continue outer;
                    case  1 :
                        state = 4;
                        continue outer;
                    case  7 :
                        state = 10;
                        continue outer;
                    case  10 :
                        revertToParentFromLeaveElement(___uri, ___local, ___qname);
                        return ;
                    case  9 :
                        if (("compareIP" == ___local)&&("" == ___uri)) {
                            context.popAttributes();
                            state = 10;
                            return ;
                        }
                        break;
                }
                super.leaveElement(___uri, ___local, ___qname);
                break;
            }
        }

        public void enterAttribute(java.lang.String ___uri, java.lang.String ___local, java.lang.String ___qname)
            throws org.xml.sax.SAXException
        {
            int attIdx;
            outer:
            while (true) {
                switch (state) {
                    case  0 :
                        spawnHandlerFromEnterAttribute((((phex.xml.impl.XJBSecurityRuleImpl)phex.xml.impl.XJBIPAccessRuleImpl.this).new Unmarshaller(context)), 1, ___uri, ___local, ___qname);
                        return ;
                    case  4 :
                        state = 7;
                        continue outer;
                    case  1 :
                        state = 4;
                        continue outer;
                    case  7 :
                        state = 10;
                        continue outer;
                    case  10 :
                        revertToParentFromEnterAttribute(___uri, ___local, ___qname);
                        return ;
                }
                super.enterAttribute(___uri, ___local, ___qname);
                break;
            }
        }

        public void leaveAttribute(java.lang.String ___uri, java.lang.String ___local, java.lang.String ___qname)
            throws org.xml.sax.SAXException
        {
            int attIdx;
            outer:
            while (true) {
                switch (state) {
                    case  0 :
                        spawnHandlerFromLeaveAttribute((((phex.xml.impl.XJBSecurityRuleImpl)phex.xml.impl.XJBIPAccessRuleImpl.this).new Unmarshaller(context)), 1, ___uri, ___local, ___qname);
                        return ;
                    case  4 :
                        state = 7;
                        continue outer;
                    case  1 :
                        state = 4;
                        continue outer;
                    case  7 :
                        state = 10;
                        continue outer;
                    case  10 :
                        revertToParentFromLeaveAttribute(___uri, ___local, ___qname);
                        return ;
                }
                super.leaveAttribute(___uri, ___local, ___qname);
                break;
            }
        }

        public void handleText(final java.lang.String value)
            throws org.xml.sax.SAXException
        {
            int attIdx;
            outer:
            while (true) {
                try {
                    switch (state) {
                        case  0 :
                            spawnHandlerFromText((((phex.xml.impl.XJBSecurityRuleImpl)phex.xml.impl.XJBIPAccessRuleImpl.this).new Unmarshaller(context)), 1, value);
                            return ;
                        case  8 :
                            state = 9;
                            eatText1(value);
                            return ;
                        case  2 :
                            state = 3;
                            eatText2(value);
                            return ;
                        case  4 :
                            state = 7;
                            continue outer;
                        case  5 :
                            state = 6;
                            eatText3(value);
                            return ;
                        case  1 :
                            state = 4;
                            continue outer;
                        case  7 :
                            state = 10;
                            continue outer;
                        case  10 :
                            revertToParentFromText(value);
                            return ;
                    }
                } catch (java.lang.RuntimeException e) {
                    handleUnexpectedTextException(value, e);
                }
                break;
            }
        }

        private void eatText1(final java.lang.String value)
            throws org.xml.sax.SAXException
        {
            try {
                _CompareIP = com.sun.msv.datatype.xsd.HexBinaryType.load(com.sun.xml.bind.WhiteSpaceProcessor.collapse(value));
            } catch (java.lang.Exception e) {
                handleParseConversionException(e);
            }
        }

        private void eatText2(final java.lang.String value)
            throws org.xml.sax.SAXException
        {
            try {
                _AddressType = javax.xml.bind.DatatypeConverter.parseByte(com.sun.xml.bind.WhiteSpaceProcessor.collapse(value));
                has_AddressType = true;
            } catch (java.lang.Exception e) {
                handleParseConversionException(e);
            }
        }

        private void eatText3(final java.lang.String value)
            throws org.xml.sax.SAXException
        {
            try {
                _Ip = com.sun.msv.datatype.xsd.HexBinaryType.load(com.sun.xml.bind.WhiteSpaceProcessor.collapse(value));
            } catch (java.lang.Exception e) {
                handleParseConversionException(e);
            }
        }

    }

}
