use of org.apache.jena.rdf.model.ReifiedStatement in project jena by apache.
the class SecuredReifiedStatementImpl method getInstance.
/**
* Get an instance of SecuredReifiedStatement
*
* @param securedModel
* the Secured Model to use.
* @param stmt
* The ReifiedStatement to secure.
* @return SecuredReifiedStatement
*/
public static SecuredReifiedStatement getInstance(final SecuredModel securedModel, final ReifiedStatement stmt) {
if (securedModel == null) {
throw new IllegalArgumentException("Secured securedModel may not be null");
}
if (stmt == null) {
throw new IllegalArgumentException("Statement may not be null");
}
final ItemHolder<ReifiedStatement, SecuredReifiedStatement> holder = new ItemHolder<>(stmt);
final SecuredReifiedStatementImpl checker = new SecuredReifiedStatementImpl(securedModel, holder);
// one.
if (stmt instanceof SecuredReifiedStatement) {
if (checker.isEquivalent((SecuredReifiedStatement) stmt)) {
return (SecuredReifiedStatement) stmt;
}
}
return holder.setSecuredItem(new SecuredItemInvoker(stmt.getClass(), checker));
}
use of org.apache.jena.rdf.model.ReifiedStatement in project jena by apache.
the class SecuredReifiedStatementTest method setup.
@Override
@Before
public void setup() {
super.setup();
final ReifiedStatement stmt = baseModel.listStatements().next().createReifiedStatement();
setSecuredRDFNode(SecuredReifiedStatementImpl.getInstance(securedModel, stmt), stmt);
}
Aggregations