001    /*
002     * Copyright 2009 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.osedu.org/licenses/ECL-2.0
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.student.contract.model;
017    
018    import java.util.List;
019    
020    /**
021     *
022     * @author nwright
023     */
024    public class OrchestrationObject {
025    
026        public enum Source {
027    
028            MESSAGE_STRUCTURE, ORCH_OBJS;
029        }
030        private List<OrchestrationObjectField> fields;
031        private String name;
032    
033        public void setName(String name) {
034            this.name = name;
035        }
036    
037        public String getName() {
038            return name;
039        }
040    
041        public void setFields(List<OrchestrationObjectField> fields) {
042            this.fields = fields;
043        }
044    
045        public List<OrchestrationObjectField> getFields() {
046            return fields;
047        }
048        private boolean hasOwnCreateUpdate;
049    
050        public boolean hasOwnCreateUpdate() {
051            return hasOwnCreateUpdate;
052        }
053    
054        public void setHasOwnCreateUpdate(boolean hasOwnCreateUpdate) {
055            this.hasOwnCreateUpdate = hasOwnCreateUpdate;
056        }
057        private OrchestrationObjectField inlineField;
058    
059        public OrchestrationObjectField getInlineField() {
060            return inlineField;
061        }
062    
063        public void setInlineField(OrchestrationObjectField inlineField) {
064            this.inlineField = inlineField;
065        }
066        private String orchestrationPackagePath;
067    
068        public String getOrchestrationPackagePath() {
069            return orchestrationPackagePath;
070        }
071    
072        public void setOrchestrationPackagePath(String packagePath) {
073            this.orchestrationPackagePath = packagePath;
074        }
075        private String infoPackagePath;
076    
077        public String getInfoPackagePath() {
078            return infoPackagePath;
079        }
080    
081        public void setInfoPackagePath(String infoPackagePath) {
082            this.infoPackagePath = infoPackagePath;
083        }
084    
085        public String getJavaClassInfoName() {
086            return name.substring(0, 1).toUpperCase() + name.substring(1);
087        }
088    
089        public String getFullyQualifiedJavaClassInfoName() {
090            return this.infoPackagePath + "." + this.getJavaClassInfoName();
091        }
092    
093        public String getJavaClassHelperName() {
094            if (inlineField == null) {
095                return getJavaClassInfoName() + "Helper";
096            }
097            return inlineField.getParent().getJavaClassInfoName()
098                    + getJavaClassInfoName() + "Helper";
099        }
100    
101        public String getFullyQualifiedJavaClassHelperName() {
102            return orchestrationPackagePath + "." + getJavaClassHelperName();
103        }
104    
105        public String getJavaClassConstantsName() {
106            if (inlineField == null) {
107                return getJavaClassInfoName() + "Constants";
108            }
109            return inlineField.getParent().getJavaClassInfoName()
110                    + getJavaClassInfoName() + "Constants";
111        }
112    
113        public String getFullyQualifiedJavaClassConstantsName() {
114            return orchestrationPackagePath + "." + getJavaClassConstantsName();
115        }
116    
117        public String getJavaClassMetadataName() {
118            if (inlineField == null) {
119                return getJavaClassInfoName() + "Metadata";
120            }
121            return inlineField.getParent().getJavaClassInfoName()
122                    + getJavaClassInfoName() + "Metadata";
123        }
124    
125        public String getFullyQualifiedJavaClassMetadataName() {
126            return orchestrationPackagePath + "." + getJavaClassMetadataName();
127        }
128    
129        public String getJavaClassAssemblerName() {
130            if (inlineField == null) {
131                return getJavaClassInfoName() + "Assembler";
132            }
133            return inlineField.getParent().getJavaClassInfoName()
134                    + getJavaClassInfoName() + "Assembler";
135        }
136    
137        public String getFullyQualifiedJavaClassAssemblerName() {
138            return orchestrationPackagePath + ".assembler." + getJavaClassAssemblerName();
139        }
140        private Source source;
141    
142        public Source getSource() {
143            return source;
144        }
145    
146        public void setSource(Source source) {
147            this.source = source;
148        }
149    }