
net.customware.license.support.simple.SimpleRestriction Maven / Gradle / Ivy
The newest version!
package net.customware.license.support.simple;
import net.customware.license.support.Restriction;
import de.schlichtherle.license.LicenseContent;
import de.schlichtherle.license.LicenseContentException;
public abstract class SimpleRestriction implements Restriction {
public void checkRestriction( Object context, LicenseContent content ) throws LicenseContentException {
if ( content instanceof SimpleLicenseContent ) {
SimpleLicenseContent slc = ( SimpleLicenseContent ) content;
checkRestriction( context, slc, slc.getAttribute( getClass() ) );
} else {
throw new LicenseContentException( "error.unsupportedLicenseContent" );
}
}
protected abstract void checkRestriction( Object context, SimpleLicenseContent content, Object attributeValue )
throws SimpleRestrictionException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy