com.sun.jersey.api.uri.UriTemplate Java Examples

The following examples show how to use com.sun.jersey.api.uri.UriTemplate. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TemplateImpl.java    From Processor with Apache License 2.0 6 votes vote down vote up
@Override
public UriTemplate getMatch()
{
    Statement path = getProperty(LDT.match);
    if (path != null)
    {
        if (!path.getObject().isLiteral() ||
                path.getObject().asLiteral().getDatatype() == null ||
                !path.getObject().asLiteral().getDatatype().equals(XSDDatatype.XSDstring))
        {
            if (log.isErrorEnabled()) log.error("Class {} property {} is not an xsd:string literal", getURI(), LDT.match);
            throw new OntologyException("Class '" + getURI() + "' property '" + LDT.match + "' is not an xsd:string literal");
        }
        
        return new UriTemplate(path.getString());
    }
    
    return null;
}
 
Example #2
Source File: Template.java    From Processor with Apache License 2.0 5 votes vote down vote up
@Override
public int compare(Template template1, Template template2)
{
    // Template always has default priority
    double diff = template2.getPriority() - template1.getPriority();
    if (diff > 0) return 1;
    if (diff < 0) return -1;
    
    return UriTemplate.COMPARATOR.compare(template1.getMatch(), template2.getMatch());
}
 
Example #3
Source File: Template.java    From Processor with Apache License 2.0 votes vote down vote up
UriTemplate getMatch();