[New] Added PolicyDef.getJavaPolicy(), .getKeyPolicy()

This commit is contained in:
Robert von Burg 2021-08-17 11:20:51 +02:00
parent ececf60e39
commit 189c040149
1 changed files with 12 additions and 0 deletions

View File

@ -160,4 +160,16 @@ public abstract class PolicyDef {
throw new StrolchPolicyException("Unhandled PolicyDef from xml value " + xmlValue);
}
}
public static PolicyDef getJavaPolicy(Class<?> type, Class<?> impl) {
return valueOf(type, JavaPolicyDef.XML_PREFIX + impl.getName());
}
public static PolicyDef getJavaPolicy(Class<?> type, String xmlValue) {
return valueOf(type, JavaPolicyDef.XML_PREFIX + xmlValue);
}
public static PolicyDef getKeyPolicy(Class<?> type, String xmlValue) {
return valueOf(type, KeyPolicyDef.XML_PREFIX + xmlValue);
}
}