Package com.hp.hpl.jena.shared.uuid.JenaUUID

Examples of com.hp.hpl.jena.shared.uuid.JenaUUID.FormatException


    public JenaUUID parse(String s) throws FormatException
    {
        s = s.toLowerCase() ;

        if ( s.length() != 36 )
            throw new FormatException("UUID string is not 36 chars long: it's "+s.length()+" ["+s+"]") ;

        if ( s.charAt(8!= '-' && s.charAt(13) != '-' && s.charAt(18) != '-' && s.charAt(23) != '-' )
            throw new FormatException("String does not have dashes in the right places: "+s) ;

        UUID_V1 u = parse$(s) ;
        if ( u.getVersion() != versionHere )
            throw new FormatException("Wrong version (Expected: "+versionHere+"Got: "+u.getVersion()+"): "+s) ;
        if ( u.getVariant() != variantHere )
            throw new FormatException("Wrong version (Expected: "+variantHere+"Got: "+u.getVariant()+"): "+s) ;
        return u ;
    }
View Full Code Here


    public JenaUUID parse(String s) throws FormatException
    {
        s = s.toLowerCase(Locale.ENGLISH) ;

        if ( s.length() != 36 )
            throw new FormatException("UUID string is not 36 chars long: it's "+s.length()+" ["+s+"]") ;

        if ( s.charAt(8!= '-' && s.charAt(13) != '-' && s.charAt(18) != '-' && s.charAt(23) != '-' )
            throw new FormatException("String does not have dashes in the right places: "+s) ;

        UUID_V1 u = parse$(s) ;
        if ( u.getVersion() != versionHere )
            throw new FormatException("Wrong version (Expected: "+versionHere+"Got: "+u.getVersion()+"): "+s) ;
        if ( u.getVariant() != variantHere )
            throw new FormatException("Wrong version (Expected: "+variantHere+"Got: "+u.getVariant()+"): "+s) ;
        return u ;
    }
View Full Code Here

    public UUID_V4 parseV4(String s)
    {
        s = s.toLowerCase(Locale.ENGLISH) ;

        if ( s.length() != 36 )
            throw new FormatException("UUID string is not 36 chars long: it's "+s.length()+" ["+s+"]") ;

        if ( s.charAt(8!= '-' && s.charAt(13) != '-' && s.charAt(18) != '-' && s.charAt(23) != '-' )
            throw new FormatException("String does not have dashes in the right places: "+s) ;

        UUID_V4 u = parse$(s) ;
        if ( u.getVersion() != versionHere )
            throw new FormatException("Wrong version (Expected: "+versionHere+"Got: "+u.getVersion()+"): "+s) ;
        if ( u.getVariant() != variantHere )
            throw new FormatException("Wrong version (Expected: "+variantHere+"Got: "+u.getVariant()+"): "+s) ;
        return u ;
    }
View Full Code Here

    public UUID_V4 parseV4(String s)
    {
        s = s.toLowerCase() ;

        if ( s.length() != 36 )
            throw new FormatException("UUID string is not 36 chars long: it's "+s.length()+" ["+s+"]") ;

        if ( s.charAt(8!= '-' && s.charAt(13) != '-' && s.charAt(18) != '-' && s.charAt(23) != '-' )
            throw new FormatException("String does not have dashes in the right places: "+s) ;

        UUID_V4 u = parse$(s) ;
        if ( u.getVersion() != versionHere )
            throw new FormatException("Wrong version (Expected: "+versionHere+"Got: "+u.getVersion()+"): "+s) ;
        if ( u.getVariant() != variantHere )
            throw new FormatException("Wrong version (Expected: "+variantHere+"Got: "+u.getVariant()+"): "+s) ;
        return u ;
    }
View Full Code Here

    public JenaUUID parse(String s) throws FormatException
    {
        s = s.toLowerCase() ;

        if ( s.length() != 36 )
            throw new FormatException("UUID string is not 36 chars long: it's "+s.length()+" ["+s+"]") ;

        if ( s.charAt(8!= '-' && s.charAt(13) != '-' && s.charAt(18) != '-' && s.charAt(23) != '-' )
            throw new FormatException("String does not have dashes in the right places: "+s) ;

        UUID_V1 u = parse$(s) ;
        if ( u.getVersion() != versionHere )
            throw new FormatException("Wrong version (Expected: "+versionHere+"Got: "+u.getVersion()+"): "+s) ;
        if ( u.getVariant() != variantHere )
            throw new FormatException("Wrong version (Expected: "+variantHere+"Got: "+u.getVariant()+"): "+s) ;
        return u ;
    }
View Full Code Here

    public JenaUUID parse(String s) throws FormatException
    {
        s = s.toLowerCase() ;

        if ( s.length() != 36 )
            throw new FormatException("UUID string is not 36 chars long: it's "+s.length()+" ["+s+"]") ;

        if ( s.charAt(8!= '-' && s.charAt(13) != '-' && s.charAt(18) != '-' && s.charAt(23) != '-' )
            throw new FormatException("String does not have dashes in the right places: "+s) ;

        UUID_V1 u = parse$(s) ;
        if ( u.getVersion() != versionHere )
            throw new FormatException("Wrong version (Expected: "+versionHere+"Got: "+u.getVersion()+"): "+s) ;
        if ( u.getVariant() != variantHere )
            throw new FormatException("Wrong version (Expected: "+variantHere+"Got: "+u.getVariant()+"): "+s) ;
        return u ;
    }
View Full Code Here

    public UUID_V4 parseV4(String s)
    {
        s = s.toLowerCase() ;

        if ( s.length() != 36 )
            throw new FormatException("UUID string is not 36 chars long: it's "+s.length()+" ["+s+"]") ;

        if ( s.charAt(8!= '-' && s.charAt(13) != '-' && s.charAt(18) != '-' && s.charAt(23) != '-' )
            throw new FormatException("String does not have dashes in the right places: "+s) ;

        UUID_V4 u = parse$(s) ;
        if ( u.getVersion() != versionHere )
            throw new FormatException("Wrong version (Expected: "+versionHere+"Got: "+u.getVersion()+"): "+s) ;
        if ( u.getVariant() != variantHere )
            throw new FormatException("Wrong version (Expected: "+variantHere+"Got: "+u.getVariant()+"): "+s) ;
        return u ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.shared.uuid.JenaUUID.FormatException

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.