class SystemPropertyProfileActivator extends DetectedProfileActivator implements Contextualizable {
    private Properties properties;

    public void contextualize(Context context) throws ContextException {
        properties = (Properties) context.get("SystemProperties");
    }

    protected boolean canDetectActivation(Profile profile) {
        return profile.getActivation() != null && profile.getActivation().getProperty() != null;
    }

    public boolean isActive(Profile profile) throws ProfileActivationException {<FILL_FUNCTION_BODY>}
}

        Activation activation = profile.getActivation();

        ActivationProperty property = activation.getProperty();

        if (property != null) {
            String name = property.getName();
            boolean reverseName = false;

            if (name == null) {
                throw new ProfileActivationException(
                        "The property name is required to activate the profile '" + profile.getId() + "'");
            }

            if (name.startsWith("!")) {
                reverseName = true;
                name = name.substring(1);
            }

            String sysValue = properties.getProperty(name);

            String propValue = property.getValue();
            if (propValue != null && !propValue.isEmpty()) {
                boolean reverseValue = false;
                if (propValue.startsWith("!")) {
                    reverseValue = true;
                    propValue = propValue.substring(1);
                }

                // we have a value, so it has to match the system value...
                boolean result = propValue.equals(sysValue);

                if (reverseValue) {
                    return !result;
                } else {
                    return result;
                }
            } else {
                boolean result = sysValue != null && !sysValue.isEmpty();

                if (reverseName) {
                    return !result;
                } else {
                    return result;
                }
            }
        }

        return false;
    
<methods>public non-sealed void <init>() ,public boolean canDetermineActivation(Profile) <variables>