001    /**
002     * Copyright 2010-2013 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.common.util;
017    
018    import java.util.Arrays;
019    import java.util.Collections;
020    import java.util.List;
021    
022    public class DefaultProjectContext implements ProjectContext {
023    
024            public static final List<String> DEFAULT_PROPERTY_LOCATIONS = Collections.emptyList();
025            public static final String DEFAULT_GROUP_ID = ProjectUtils.KUALI_COMMON_GROUP_ID;
026    
027            String groupId = DEFAULT_GROUP_ID;
028            String artifactId;
029            List<String> propertyLocations = DEFAULT_PROPERTY_LOCATIONS;
030    
031            public DefaultProjectContext() {
032                    this(null);
033            }
034    
035            public DefaultProjectContext(String artifactId) {
036                    this(DEFAULT_GROUP_ID, artifactId, DEFAULT_PROPERTY_LOCATIONS);
037            }
038    
039            public DefaultProjectContext(String groupId, String artifactId) {
040                    this(groupId, artifactId, DEFAULT_PROPERTY_LOCATIONS);
041            }
042    
043            public DefaultProjectContext(String groupId, String artifactId, String propertyLocation) {
044                    this(groupId, artifactId, Arrays.asList(propertyLocation));
045            }
046    
047            public DefaultProjectContext(String artifactId, List<String> propertyLocations) {
048                    this(DEFAULT_GROUP_ID, artifactId, propertyLocations);
049            }
050    
051            public DefaultProjectContext(String groupId, String artifactId, List<String> propertyLocations) {
052                    super();
053                    this.groupId = groupId;
054                    this.artifactId = artifactId;
055                    this.propertyLocations = propertyLocations;
056            }
057    
058            @Override
059            public String getGroupId() {
060                    return groupId;
061            }
062    
063            @Override
064            public String getArtifactId() {
065                    return artifactId;
066            }
067    
068            @Override
069            public List<String> getPropertyLocations() {
070                    return propertyLocations;
071            }
072    
073            public void setGroupId(String groupId) {
074                    this.groupId = groupId;
075            }
076    
077            public void setArtifactId(String artifactId) {
078                    this.artifactId = artifactId;
079            }
080    
081            public void setPropertyLocations(List<String> propertyLocations) {
082                    this.propertyLocations = propertyLocations;
083            }
084    }