Examples of XRIReference


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

Examples of org.openxri.XRIReference

    */
    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

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

Examples of org.openxri.XRIReference

    */
    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

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

Examples of org.openxri.XRIReference

    */
    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

Examples of org.openxri.xri3.XRIReference

    return(iri.toString());
  }

  public boolean isValidXRIReference() {

    XRIReference xriReference;

    try {

      xriReference = this.toXRIReference();
    } catch (Exception ex) {
View Full Code Here

Examples of org.openxri.xri3.XRIReference

    return(iri.toString());
  }

  public boolean isValidXRIReference() {

    XRIReference xriReference;

    try {

      xriReference = this.toXRIReference();
    } catch (Exception ex) {
View Full Code Here

Examples of org.openxri.xri3.XRIReference

    return(iri.toString());
  }

  public boolean isValidXRIReference() {

    XRIReference xriReference;

    try {

      xriReference = this.toXRIReference();
    } catch (Exception ex) {
View Full Code Here

Examples of org.openxri.xri3.XRIReference

    // The library can also construct new XRIs or XRI components.
    // For example, if we have an XRI +name, and a relative XRI reference +first,
    // we can construct a new XRI +name+first

    XRI xri = new XRI3("+name");
    XRIReference xriReference = new XRI3Reference("+first");

    System.out.println("Got XRI " + xri.toString());
    System.out.println("Got XRI reference " + xriReference.toString());

    XRI xriNew = new XRI3(xri, xriReference);
   
    System.out.println("Constructed new XRI " + xriNew.toString());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.