// Path: api/src/main/java/com/geewhiz/pacify/defect/Defect.java
// public interface Defect {
// 
//     String getDefectMessage();
// 
// }
// 
// Path: impl/src/main/java/com/geewhiz/pacify/property/resolver/BasePropertyResolver.java
// public abstract class BasePropertyResolver implements PropertyResolver {
// 
//     @Override
//     public FilterSet createFilterSet() {
//         FilterSet filterset = new FilterSet();
// 
//         filterset.setBeginToken(getBeginToken());
//         filterset.setEndToken(getEndToken());
// 
//         return filterset;
//     }
// 
//     @Override
//     public boolean propertyUsesToken(String property) {
//         return getMatcher(getPropertyValue(property)).find();
//     }
// 
//     protected Matcher getMatcher(String propertyValue) {
//         Pattern pattern = RegExpUtils.getDefaultPattern(getBeginToken(), getEndToken());
// 
//         Matcher matcher = pattern.matcher(propertyValue);
//         return matcher;
//     }
// 
//     public Set<String> getReferencedProperties(String property) {
//         String propertyValue = getPropertyValue(property);
//         Matcher matcher = getMatcher(propertyValue);
// 
//         Set<String> result = new TreeSet<String>();
//         while (matcher.find()) {
//             String propertyId = matcher.group(1);
//             result.add(propertyId);
//         }
// 
//         return result;
//     }
// 
//     @Override
//     public int compareTo(PropertyResolver o) {
//         return getPropertyResolverDescription().compareTo(o.getPropertyResolverDescription());
//     }
// 
// }


import java.util.Enumeration;
import java.util.LinkedHashSet;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
import com.geewhiz.pacify.defect.Defect;
import com.geewhiz.pacify.property.resolver.BasePropertyResolver;
/*-
 * ========================LICENSE_START=================================
 * com.geewhiz.pacify.resolver.cmd-resolver
 * %%
 * Copyright (C) 2011 - 2017 Sven Oppermann
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * =========================LICENSE_END==================================
 */

package com.geewhiz.pacify.property.resolver.cmdresolver;





public class CmdPropertyResolver extends BasePropertyResolver {

    private static final String END_TOKEN      = "endToken";
    private static final String BEGIN_TOKEN    = "beginToken";
    private static final String ENCODING_TOKEN = "encoding";
    private Properties          properties;

    public CmdPropertyResolver(Properties properties) {
        this.properties = properties;
    }

    @Override
    public boolean containsProperty(String key) {
        return properties.containsKey(key);
    }

    @Override
    public boolean isProtectedProperty(String key) {
        return false;
    }

    @Override
    public String getPropertyValue(String key) {
        return properties.getProperty(key);
    }

    @Override
    public LinkedHashSet<Defect> checkForDuplicateEntry() {
        return new LinkedHashSet<Defect>();
    }

    @Override
    public Set<String> getPropertyKeys() {
        Set<String> result = new TreeSet<String>();

        for (Enumeration<Object> enumerator = properties.keys(); enumerator.hasMoreElements();) {
// Path: api/src/main/java/com/geewhiz/pacify/defect/Defect.java
// public interface Defect {
// 
//     String getDefectMessage();
// 
// }
// 
// Path: impl/src/main/java/com/geewhiz/pacify/property/resolver/BasePropertyResolver.java
// public abstract class BasePropertyResolver implements PropertyResolver {
// 
//     @Override
//     public FilterSet createFilterSet() {
//         FilterSet filterset = new FilterSet();
// 
//         filterset.setBeginToken(getBeginToken());
//         filterset.setEndToken(getEndToken());
// 
//         return filterset;
//     }
// 
//     @Override
//     public boolean propertyUsesToken(String property) {
//         return getMatcher(getPropertyValue(property)).find();
//     }
// 
//     protected Matcher getMatcher(String propertyValue) {
//         Pattern pattern = RegExpUtils.getDefaultPattern(getBeginToken(), getEndToken());
// 
//         Matcher matcher = pattern.matcher(propertyValue);
//         return matcher;
//     }
// 
//     public Set<String> getReferencedProperties(String property) {
//         String propertyValue = getPropertyValue(property);
//         Matcher matcher = getMatcher(propertyValue);
// 
//         Set<String> result = new TreeSet<String>();
//         while (matcher.find()) {
//             String propertyId = matcher.group(1);
//             result.add(propertyId);
//         }
// 
//         return result;
//     }
// 
//     @Override
//     public int compareTo(PropertyResolver o) {
//         return getPropertyResolverDescription().compareTo(o.getPropertyResolverDescription());
//     }
// 
// }


// Path: resolver/cmd-resolver/src/main/java/com/geewhiz/pacify/property/resolver/cmdresolver/CmdPropertyResolver.java
import java.util.Enumeration;
import java.util.LinkedHashSet;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
import com.geewhiz.pacify.defect.Defect;
import com.geewhiz.pacify.property.resolver.BasePropertyResolver;

/*-
 * ========================LICENSE_START=================================
 * com.geewhiz.pacify.resolver.cmd-resolver
 * %%
 * Copyright (C) 2011 - 2017 Sven Oppermann
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * =========================LICENSE_END==================================
 */

package com.geewhiz.pacify.property.resolver.cmdresolver;





public class CmdPropertyResolver extends BasePropertyResolver {

    private static final String END_TOKEN      = "endToken";
    private static final String BEGIN_TOKEN    = "beginToken";
    private static final String ENCODING_TOKEN = "encoding";
    private Properties          properties;

    public CmdPropertyResolver(Properties properties) {
        this.properties = properties;
    }

    @Override
    public boolean containsProperty(String key) {
        return properties.containsKey(key);
    }

    @Override
    public boolean isProtectedProperty(String key) {
        return false;
    }

    @Override
    public String getPropertyValue(String key) {
        return properties.getProperty(key);
    }

    @Override
    public LinkedHashSet<Defect> checkForDuplicateEntry() {
        return new LinkedHashSet<Defect>();
    }

    @Override
    public Set<String> getPropertyKeys() {
        Set<String> result = new TreeSet<String>();

        for (Enumeration<Object> enumerator = properties.keys(); enumerator.hasMoreElements();) {
            String property = (String) enumerator.nextElement();