View Javadoc

1   /*
2    * Copyright 2008 FatWire Corporation. All Rights Reserved.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *    http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package com.fatwire.gst.foundation.facade.runtag.asset;
18  
19  import com.fatwire.gst.foundation.facade.runtag.AbstractTagRunner;
20  
21  /**
22   * Wrapper around the ASSET.LOAD xml tag
23   * 
24   * @author Mike Field
25   * @since August 15, 2008
26   */
27  public final class Load extends AbstractTagRunner {
28      // Default Constructor
29      public Load() {
30          super("ASSET.LOAD");
31      }
32  
33      /**
34       * Sets name to the value of <code>s</code>
35       * 
36       * @param s The name of the asset to return
37       */
38      public void setName(String s) {
39          // validate first
40          if (s == null || s.length() == 0) {
41              throw new IllegalArgumentException("Invalid name string: " + s);
42          }
43          this.set("NAME", s);
44      }
45  
46      /**
47       * Sets type to the value of <code>s</code>
48       * 
49       * @param s The type of the asset
50       */
51      public void setType(String s) {
52          // validate first
53          if (s == null || s.length() == 0) {
54              throw new IllegalArgumentException("Invalid type string: " + s);
55          }
56          this.set("TYPE", s);
57      }
58  
59      /**
60       * Sets objectid to the value of <code>s</code>
61       * 
62       * @param s The object id of the asset
63       */
64      public void setObjectId(String s) {
65          // validate first
66          if (s == null || s.length() == 0) {
67              throw new IllegalArgumentException("Invalid objectid string: " + s);
68          }
69          this.set("OBJECTID", s);
70      }
71  
72      /**
73       * Sets field to the value of <code>s</code>
74       * 
75       * @param s The field of the asset
76       */
77      public void setField(String s) {
78          // validate first
79          if (s == null || s.length() == 0) {
80              throw new IllegalArgumentException("Invalid field string: " + s);
81          }
82          this.set("FIELD", s);
83      }
84  
85      /**
86       * Sets "value" to the value of <code>s</code>
87       * 
88       * @param s The value of the asset
89       */
90      public void setValue(String s) {
91          // validate first
92          if (s == null || s.length() == 0) {
93              throw new IllegalArgumentException("Invalid value string: " + s);
94          }
95          this.set("VALUE", s);
96      }
97  
98      /**
99       * Sets site to the value of <code>s</code>
100      * 
101      * @param s The site of the asset
102      */
103     public void setSite(String s) {
104         // validate first
105         if (s == null || s.length() == 0) {
106             throw new IllegalArgumentException("Invalid site string: " + s);
107         }
108         this.set("SITE", s);
109     }
110 
111     /**
112      * Sets deptype to the value of <code>s</code>
113      * 
114      * @param s exact, exists, greater or none (case sensitive)
115      */
116     public void setDepType(String s) {
117         // validate first
118         if (s == null || s.length() == 0 || !s.equals("exact") && !s.equals("exists") && !s.equals("greater")
119                 && !s.equals("none")) {
120             throw new IllegalArgumentException("Invalid escape string: " + s);
121         }
122         this.set("DEPTYPE", s);
123     }
124 
125     /**
126      * Sets editable to the value of <code>s</code>
127      * 
128      * @param s true or false (case sensitive)
129      */
130     public void setEditable(String s) {
131         // validate first
132         if (s == null || s.length() == 0 || !s.equals("true") && !s.equals("false")) {
133             throw new IllegalArgumentException("Invalid editable string: " + s);
134         }
135         this.set("EDITABLE", s);
136     }
137 
138     /**
139      * Sets option to the value of <code>s</code>
140      * 
141      * @param s editable, readonly, readonly_complete (case sensitive)
142      */
143     public void setOption(String s) {
144         // validate first
145         if (s == null || s.length() == 0 || !s.equals("editable") && !s.equals("readonly")
146                 && !s.equals("readonly_complete")) {
147             throw new IllegalArgumentException("Invalid option string: " + s);
148         }
149         this.set("OPTION", s);
150     }
151 
152     /**
153      * Sets flushonvoid to the value of <code>s</code>
154      * 
155      * @param s true or false (case sensitive)
156      */
157     public void setFlushOnVoid(String s) {
158         // validate first
159         if (s == null || s.length() == 0 || !s.equals("true") && !s.equals("false")) {
160             throw new IllegalArgumentException("Invalid flushonvoid string: " + s);
161         }
162         this.set("FLUSHONVOID", s);
163     }
164 }