Package org.openxri

Examples of org.openxri.XRIReference


    */ /**
    *
    */
    private void checkXRI(String sXRI, boolean bAbsolute)
    {
        XRIReference oXRI = null;
        if (bAbsolute)
        {
            oXRI = new XRI(sXRI);
        }
        else
        {
            oXRI = new RelativeXRI(sXRI);
        }

        if (!oXRI.toString().equals(sXRI))
        {
            throw new RuntimeException(
                "Parsed xri \"" + oXRI.toString() +
                "\" did not match expected serialization \"" + sXRI);
        }

    } // checkXRI()
View Full Code Here


    */
    private void checkXRI(
        String sXRI, int nNumAuthSub, int nNumRelativeSegments,
        boolean bAbsolute)
    {
        XRIReference oXRI = null;
        if (bAbsolute)
        {
            oXRI = new XRI(sXRI);
        }
        else
        {
            oXRI = new RelativeXRI(sXRI);
        }

        if (!oXRI.toString().equals(sXRI))
        {
            throw new RuntimeException(
                "Parsed xri \"" + oXRI.toString() +
                "\" did not match original xri \"" + sXRI);
        }

        int nNum = 0;
        if (oXRI.getAuthorityPath() instanceof XRIAuthority)
        {
            nNum = ((XRIAuthority) oXRI.getAuthorityPath()).getNumSubSegments();
        }

        if (nNum != nNumAuthSub)
        {
            throw new RuntimeException(
                "Parsed xri \"" + oXRI.toString() +
                "\" did not parse into correct number of subsegments.  " +
                "Expected " + nNumAuthSub + ", Got " + nNum);
        }

        nNum = 0;
        if (oXRI.getXRIPath() != null)
        {
            nNum = oXRI.getXRIPath().getNumSegments();
        }

        if (nNum != nNumRelativeSegments)
        {
            throw new RuntimeException(
                "Parsed xri \"" + oXRI.toString() +
                "\" did not parse into correct number of xrisegments.  " +
                "Expected " + nNumRelativeSegments + ", Got " + nNum);
        }

    } // checkXRI()
View Full Code Here

    */ /**
    *
    */
    private void checkXRI(String sXRI, boolean bAbsolute)
    {
        XRIReference oXRI = null;
        if (bAbsolute)
        {
            oXRI = new XRI(sXRI);
        }
        else
        {
            oXRI = new RelativeXRI(sXRI);
        }

        if (!oXRI.toString().equals(sXRI))
        {
            throw new RuntimeException(
                "Parsed xri \"" + oXRI.toString() +
                "\" did not match expected serialization \"" + sXRI);
        }

    } // checkXRI()
View Full Code Here

    */
    private void checkXRI(
        String sXRI, int nNumAuthSub, int nNumRelativeSegments,
        boolean bAbsolute)
    {
        XRIReference oXRI = null;
        if (bAbsolute)
        {
            oXRI = new XRI(sXRI);
        }
        else
        {
            oXRI = new RelativeXRI(sXRI);
        }

        if (!oXRI.toString().equals(sXRI))
        {
            throw new RuntimeException(
                "Parsed xri \"" + oXRI.toString() +
                "\" did not match original xri \"" + sXRI);
        }

        int nNum = 0;
        if (oXRI.getAuthorityPath() instanceof XRIAuthority)
        {
            nNum = ((XRIAuthority) oXRI.getAuthorityPath()).getNumSubSegments();
        }

        if (nNum != nNumAuthSub)
        {
            throw new RuntimeException(
                "Parsed xri \"" + oXRI.toString() +
                "\" did not parse into correct number of subsegments.  " +
                "Expected " + nNumAuthSub + ", Got " + nNum);
        }

        nNum = 0;
        if (oXRI.getXRIPath() != null)
        {
            nNum = oXRI.getXRIPath().getNumSegments();
        }

        if (nNum != nNumRelativeSegments)
        {
            throw new RuntimeException(
                "Parsed xri \"" + oXRI.toString() +
                "\" did not parse into correct number of xrisegments.  " +
                "Expected " + nNumRelativeSegments + ", Got " + nNum);
        }

    } // checkXRI()
View Full Code Here

    */ /**
    *
    */
    private void checkXRI(String sXRI, boolean bAbsolute)
    {
        XRIReference oXRI = null;
        if (bAbsolute)
        {
            oXRI = new XRI(sXRI);
        }
        else
        {
            oXRI = new RelativeXRI(sXRI);
        }

        if (!oXRI.toString().equals(sXRI))
        {
            throw new RuntimeException(
                "Parsed xri \"" + oXRI.toString() +
                "\" did not match expected serialization \"" + sXRI);
        }

    } // checkXRI()
View Full Code Here

    */
    private void checkXRI(
        String sXRI, int nNumAuthSub, int nNumRelativeSegments,
        boolean bAbsolute)
    {
        XRIReference oXRI = null;
        if (bAbsolute)
        {
            oXRI = new XRI(sXRI);
        }
        else
        {
            oXRI = new RelativeXRI(sXRI);
        }

        if (!oXRI.toString().equals(sXRI))
        {
            throw new RuntimeException(
                "Parsed xri \"" + oXRI.toString() +
                "\" did not match original xri \"" + sXRI);
        }

        int nNum = 0;
        if (oXRI.getAuthorityPath() instanceof XRIAuthority)
        {
            nNum = ((XRIAuthority) oXRI.getAuthorityPath()).getNumSubSegments();
        }

        if (nNum != nNumAuthSub)
        {
            throw new RuntimeException(
                "Parsed xri \"" + oXRI.toString() +
                "\" did not parse into correct number of subsegments.  " +
                "Expected " + nNumAuthSub + ", Got " + nNum);
        }

        nNum = 0;
        if (oXRI.getXRIPath() != null)
        {
            nNum = oXRI.getXRIPath().getNumSegments();
        }

        if (nNum != nNumRelativeSegments)
        {
            throw new RuntimeException(
                "Parsed xri \"" + oXRI.toString() +
                "\" did not parse into correct number of xrisegments.  " +
                "Expected " + nNumRelativeSegments + ", Got " + nNum);
        }

    } // checkXRI()
View Full Code Here

TOP

Related Classes of org.openxri.XRIReference

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.