use of org.apache.jena.permissions.model.SecuredReifiedStatement 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));
}
Aggregations