1 /* 2 Licensed to the Apache Software Foundation (ASF) under one 3 or more contributor license agreements. See the NOTICE file 4 distributed with this work for additional information 5 regarding copyright ownership. The ASF licenses this file 6 to you under the Apache License, Version 2.0 (the 7 "License"); you may not use this file except in compliance 8 with the License. You may obtain a copy of the License at 9 10 http://www.apache.org/licenses/LICENSE-2.0 11 12 Unless required by applicable law or agreed to in writing, 13 software distributed under the License is distributed on an 14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 KIND, either express or implied. See the License for the 16 specific language governing permissions and limitations 17 under the License. 18 =================== DO NOT EDIT THIS FILE ==================== 19 Generated by Modello 2.5.1, 20 any modifications will be overwritten. 21 ============================================================== 22 */ 23 24 package org.apache.maven.doxia.site.skin; 25 26 /** 27 * Describes the condition for including a specific Skin resource. 28 * If multiple conditions are defined for a single resource only 29 * the first matching condition determines the outcome. Resources 30 * not matching a condition will always be included. 31 * 32 * @version $Revision$ $Date$ 33 */ 34 @SuppressWarnings( "all" ) 35 public class ResourceCondition 36 implements java.io.Serializable, java.lang.Cloneable 37 { 38 39 //--------------------------/ 40 //- Class/Member Variables -/ 41 //--------------------------/ 42 43 /** 44 * Field resourceNames. 45 */ 46 private java.util.List<String> resourceNames; 47 48 /** 49 * 50 * The Velocity (VTL) expression to be evaluated to 51 * decide if the resource should be included. Only if the 52 * condition evaluates to true, the resource will be included. 53 * 54 * 55 */ 56 private String vtlCondition; 57 58 59 //-----------/ 60 //- Methods -/ 61 //-----------/ 62 63 /** 64 * Method addResourceName. 65 * 66 * @param string a string object. 67 */ 68 public void addResourceName( String string ) 69 { 70 getResourceNames().add( string ); 71 } //-- void addResourceName( String ) 72 73 /** 74 * Method clone. 75 * 76 * @return ResourceCondition 77 */ 78 public ResourceCondition clone() 79 { 80 try 81 { 82 ResourceCondition copy = (ResourceCondition) super.clone(); 83 84 if ( this.resourceNames != null ) 85 { 86 copy.resourceNames = new java.util.ArrayList<String>(); 87 copy.resourceNames.addAll( this.resourceNames ); 88 } 89 90 return copy; 91 } 92 catch ( java.lang.Exception ex ) 93 { 94 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName() 95 + " does not support clone()" ).initCause( ex ); 96 } 97 } //-- ResourceCondition clone() 98 99 /** 100 * Method getResourceNames. 101 * 102 * @return List 103 */ 104 public java.util.List<String> getResourceNames() 105 { 106 if ( this.resourceNames == null ) 107 { 108 this.resourceNames = new java.util.ArrayList<String>(); 109 } 110 111 return this.resourceNames; 112 } //-- java.util.List<String> getResourceNames() 113 114 /** 115 * Get the Velocity (VTL) expression to be evaluated to decide 116 * if the resource should be included. Only if the condition 117 * evaluates to true, the resource will be included. 118 * 119 * @return String 120 */ 121 public String getVtlCondition() 122 { 123 return this.vtlCondition; 124 } //-- String getVtlCondition() 125 126 /** 127 * Method removeResourceName. 128 * 129 * @param string a string object. 130 */ 131 public void removeResourceName( String string ) 132 { 133 getResourceNames().remove( string ); 134 } //-- void removeResourceName( String ) 135 136 /** 137 * Set a resource name to which this condition applies. Refers 138 * to the relative path within the JAR (i.e. must always use 139 * "/" as separator and must not start with a slash). Multiple 140 * resource names can be specified sharing the same condition. 141 * 142 * @param resourceNames a resourceNames object. 143 */ 144 public void setResourceNames( java.util.List<String> resourceNames ) 145 { 146 this.resourceNames = resourceNames; 147 } //-- void setResourceNames( java.util.List ) 148 149 /** 150 * Set the Velocity (VTL) expression to be evaluated to decide 151 * if the resource should be included. Only if the condition 152 * evaluates to true, the resource will be included. 153 * 154 * @param vtlCondition a vtlCondition object. 155 */ 156 public void setVtlCondition( String vtlCondition ) 157 { 158 this.vtlCondition = vtlCondition; 159 } //-- void setVtlCondition( String ) 160 161 }