use of org.apache.jena.rdf.model.SeqIndexBoundsException in project jena by apache.
the class SecuredSeqImpl method getLanguage.
/**
* @sec.graph Read if {@link SecurityEvaluator#isHardReadError()} is true and
* the user does not have read access then SeqIndexBoundsException is
* thrown
* @sec.triple Read SecTriple( this, RDF.li(1), o )
* @throws ReadDeniedException
* @throws AuthenticationRequiredException if user is not authenticated and is
* required to be.
*/
@Override
public String getLanguage(final int index) throws ReadDeniedException, AuthenticationRequiredException {
if (checkSoftRead()) {
final Literal literal = holder.getBaseItem().getLiteral(index);
checkRead(new Triple(holder.getBaseItem().asNode(), RDF.li(index).asNode(), literal.asNode()));
return literal.getLanguage();
}
throw new SeqIndexBoundsException(index, 0);
}
use of org.apache.jena.rdf.model.SeqIndexBoundsException in project jena by apache.
the class SecuredSeqImpl method getLiteral.
/**
* @sec.graph Read if {@link SecurityEvaluator#isHardReadError()} is true and
* the user does not have read access then SeqIndexBoundsException is
* thrown
* @sec.triple Read SecTriple( this, RDF.li(1), o )
* @throws ReadDeniedException
* @throws AuthenticationRequiredException if user is not authenticated and is
* required to be.
*/
@Override
public SecuredLiteral getLiteral(final int index) throws ReadDeniedException, AuthenticationRequiredException {
if (checkSoftRead()) {
final Literal literal = holder.getBaseItem().getLiteral(index);
checkRead(new Triple(holder.getBaseItem().asNode(), RDF.li(index).asNode(), literal.asNode()));
return SecuredLiteralImpl.getInstance(getModel(), literal);
}
throw new SeqIndexBoundsException(index, 0);
}
use of org.apache.jena.rdf.model.SeqIndexBoundsException in project jena by apache.
the class SecuredSeqImpl method getShort.
/**
* @sec.graph Read if {@link SecurityEvaluator#isHardReadError()} is true and
* the user does not have read access then SeqIndexBoundsException is
* thrown
* @sec.triple Read SecTriple( this, RDF.li(1), o )
* @throws ReadDeniedException
* @throws AuthenticationRequiredException if user is not authenticated and is
* required to be.
*/
@Override
public short getShort(final int index) throws ReadDeniedException, AuthenticationRequiredException {
if (checkSoftRead()) {
final short retval = holder.getBaseItem().getShort(index);
checkRead(new Triple(holder.getBaseItem().asNode(), RDF.li(index).asNode(), ResourceFactory.createTypedLiteral(retval).asNode()));
return retval;
}
throw new SeqIndexBoundsException(index, 0);
}
use of org.apache.jena.rdf.model.SeqIndexBoundsException in project jena by apache.
the class SecuredSeqImpl method getSeq.
/**
* @sec.graph Read if {@link SecurityEvaluator#isHardReadError()} is true and
* the user does not have read access then SeqIndexBoundsException is
* thrown
* @sec.triple Read SecTriple( this, RDF.li(1), o )
* @throws ReadDeniedException
* @throws AuthenticationRequiredException if user is not authenticated and is
* required to be.
*/
@Override
public SecuredSeq getSeq(final int index) throws ReadDeniedException, AuthenticationRequiredException {
if (checkSoftRead()) {
final Seq retval = holder.getBaseItem().getSeq(index);
checkRead(new Triple(holder.getBaseItem().asNode(), RDF.li(index).asNode(), retval.asNode()));
return SecuredSeqImpl.getInstance(getModel(), retval);
}
throw new SeqIndexBoundsException(index, 0);
}
use of org.apache.jena.rdf.model.SeqIndexBoundsException in project jena by apache.
the class SecuredSeqImpl method getChar.
/**
* @sec.graph Read if {@link SecurityEvaluator#isHardReadError()} is true and
* the user does not have read access then SeqIndexBoundsException is
* thrown
* @sec.triple Read SecTriple( this, RDF.li(1), o )
* @throws ReadDeniedException
* @throws AuthenticationRequiredException if user is not authenticated and is
* required to be.
*/
@Override
public char getChar(final int index) throws ReadDeniedException, AuthenticationRequiredException {
if (checkSoftRead()) {
final char retval = holder.getBaseItem().getChar(index);
checkRead(new Triple(holder.getBaseItem().asNode(), RDF.li(index).asNode(), asObject(retval).asNode()));
return retval;
}
throw new SeqIndexBoundsException(index, 0);
}
Aggregations