| 1 | <!--- |
|---|
| 2 | Copyright 2006-2007 TeraTech, Inc. http://teratech.com/ |
|---|
| 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 | <cfcomponent output="false" hint="I represent a class declaration in the fusebox XML file."> |
|---|
| 17 | |
|---|
| 18 | <cffunction name="init" returntype="fuseboxClassDefinition" access="public" output="false" |
|---|
| 19 | hint="I am the constructor."> |
|---|
| 20 | <cfargument name="type" type="string" required="false" |
|---|
| 21 | hint="I am 'component' or 'java', the type of the declared class." /> |
|---|
| 22 | <cfargument name="classpath" type="string" required="false" |
|---|
| 23 | hint="I am the package-qualified name of the declared class, e.g., java.lang.String or org.corfield.Sean" /> |
|---|
| 24 | <cfargument name="constructor" type="string" required="false" |
|---|
| 25 | hint="I am the name of the method that should be used to construct the declared class." /> |
|---|
| 26 | <cfargument name="customAttribs" type="struct" required="false" |
|---|
| 27 | hint="I am the set of custom attributes specified in the class declaration." /> |
|---|
| 28 | |
|---|
| 29 | <!--- FB41 compatibility means these must be public data ---> |
|---|
| 30 | <cfset this.type = arguments.type /> |
|---|
| 31 | <cfset this.classpath = arguments.classpath /> |
|---|
| 32 | <cfset this.constructor = arguments.constructor /> |
|---|
| 33 | <cfset variables.customAttributes = arguments.customAttribs /> |
|---|
| 34 | |
|---|
| 35 | <cfreturn this /> |
|---|
| 36 | |
|---|
| 37 | </cffunction> |
|---|
| 38 | |
|---|
| 39 | <cffunction name="getCustomAttributes" returntype="struct" access="public" output="false" |
|---|
| 40 | hint="I return the custom (namespace-qualified) attributes for this fuseaction tag."> |
|---|
| 41 | <cfargument name="ns" type="string" required="true" |
|---|
| 42 | hint="I am the namespace prefix whose attributes should be returned." /> |
|---|
| 43 | |
|---|
| 44 | <cfif structKeyExists(variables.customAttributes,arguments.ns)> |
|---|
| 45 | <!--- we structCopy() this so folks can't poke values back into the metadata! ---> |
|---|
| 46 | <cfreturn structCopy(variables.customAttributes[arguments.ns]) /> |
|---|
| 47 | <cfelse> |
|---|
| 48 | <cfreturn structNew() /> |
|---|
| 49 | </cfif> |
|---|
| 50 | |
|---|
| 51 | </cffunction> |
|---|
| 52 | |
|---|
| 53 | </cfcomponent> |
|---|