<cfcomponent hint="I am the base validator object for the object. I am generated. DO NOT EDIT ME (but feel free to delete me)."
extends="reactor.base.abstractValidator" >
<cfset variables.signature = "" />
<!--- validate --->
<cffunction name="validate" access="public" hint="I validate an record" output="false" returntype="any" _returntype="reactor.util.ErrorCollection">
<cfargument name="Record" hint="I am the Record to validate." required="no" type="any" _type="reactor.project..Record.Record" />
<cfargument name="ErrorCollection" hint="I am the error collection to populate. If not provided a new collection is created." required="no" type="any" _type="reactor.util.ErrorCollection" default="#createErrorCollection(arguments.Record._getDictionary())#" />
<cfset validate(arguments.Record, arguments.ErrorCollection) />
<cfreturn arguments.ErrorCollection />
</cffunction>
<!--- validate --->
<cffunction name="validate" access="public" hint="I validate the field" output="false" returntype="any" _returntype="reactor.util.ErrorCollection">
<cfargument name="Record" hint="I am the Record to validate." required="no" type="any" _type="reactor.project..Record.Record"/>
<cfargument name="ErrorCollection" hint="I am the error collection to populate. If not provided a new collection is created." required="no" type="any" _type="reactor.util.ErrorCollection" default="#createErrorCollection(arguments.Record._getDictionary())#" />
<!--- validate is provided --->
<cfset validateProvided(arguments.Record, arguments.ErrorCollection)>
<!--- validate is --->
<cfset validateDatatype(arguments.Record, arguments.ErrorCollection)>
<!--- validate length --->
<cfset validateLength(arguments.Record, arguments.ErrorCollection)>
<cfreturn arguments.ErrorCollection />
</cffunction>
<!--- validateProvided --->
<cffunction name="validateProvided" access="public" hint="I validate that the field was provided" output="false" returntype="any" _returntype="reactor.util.ErrorCollection">
<cfargument name="Record" hint="I am the Record to validate." required="no" type="any" _type="reactor.project..Record.Record" />
<cfargument name="ErrorCollection" hint="I am the error collection to populate. If not provided a new collection is created." required="no" type="any" _type="reactor.util.ErrorCollection" default="#createErrorCollection(arguments.Record._getDictionary())#" />
<!--- validate is provided --->
<cfif NOT Len(Trim(arguments.Record.get()))>
<cfset arguments.ErrorCollection.addError("..notProvided") />
</cfif>
<cfreturn arguments.ErrorCollection />
</cffunction>
<!--- validateDatatype --->
<cffunction name="validateDatatype" access="public" hint="I validate that the field is ." output="false" returntype="any" _returntype="reactor.util.ErrorCollection">
<cfargument name="Record" hint="I am the Record to validate." required="no" type="any" _type="reactor.project..Record.Record" />
<cfargument name="ErrorCollection" hint="I am the error collection to populate. If not provided a new collection is created." required="no" type="any" _type="reactor.util.ErrorCollection" default="#createErrorCollection(arguments.Record._getDictionary())#" />
<!--- validate is --->
<cfif Len(arguments.Record.get()) AND NOT IsBinary(arguments.Record.get())>
<cfset arguments.ErrorCollection.addError("..invalidType") />
</cfif>
<!--- validate is --->
<cfif NOT IsBoolean(arguments.Record.get())>
<cfset arguments.ErrorCollection.addError("..invalidType") />
</cfif>
<!--- validate is --->
<cfif NOT IsDate(arguments.Record.get()) AND Len(Trim(arguments.Record.get()))>
<cfset arguments.ErrorCollection.addError("..invalidType") />
</cfif>
<!--- validate is --->
<cfif Len(Trim(arguments.Record.get())) AND NOT IsNumeric(arguments.Record.get())>
<cfset arguments.ErrorCollection.addError("..invalidType") />
</cfif>
<!--- validate is a Microsoft GUID --->
<cfif NOT ReFindNoCase("[A-F0-9]{8,8}-[A-F0-9]{4,4}-[A-F0-9]{4,4}-[A-F0-9]{4,4}-[A-F0-9]{12,12}", arguments.Record.get()) OR ReFindNoCase("[A-F0-9]{8,8}-[A-F0-9]{4,4}-[A-F0-9]{4,4}-[A-F0-9]{4,4}-[A-F0-9]{8,8}", arguments.Record.get()) )>
<cfset arguments.ErrorCollection.addError("..invalidType") />
</cfif>
<!--- validate is a CF uuid --->
<cfif NOT ReFindNoCase("[A-F0-9]{8,8}-[A-F0-9]{4,4}-[A-F0-9]{4,4}-[A-F0-9]{16,16}", arguments.Record.get())>
<cfset arguments.ErrorCollection.addError("..invalidType") />
</cfif>
<!--- validate is a CF uuid --->
<cfif NOT ReFindNoCase("[A-F0-9]{8,8}-[A-F0-9]{4,4}-[A-F0-9]{4,4}-[A-F0-9]{16,16}", arguments.Record.get())>
<cfset arguments.ErrorCollection.addError("..invalidType") />
</cfif>
<!--- validate is --->
<cfif NOT IsSimpleValue(arguments.Record.get())>
<cfset arguments.ErrorCollection.addError("..invalidType") />
</cfif>
<!--- not sure how to validate data type --->
<cfreturn arguments.ErrorCollection />
</cffunction>
<!--- validateLength --->
<cffunction name="validateLength" access="public" hint="I validate that the field length." output="false" returntype="any" _returntype="reactor.util.ErrorCollection">
<cfargument name="Record" hint="I am the Record to validate." required="no" type="any" _type="reactor.project..Record.Record" />
<cfargument name="ErrorCollection" hint="I am the error collection to populate. If not provided a new collection is created." required="no" type="any" _type="reactor.util.ErrorCollection" default="#createErrorCollection(arguments.Record._getDictionary())#" />
<!--- validate length --->
<cfif Len(arguments.Record.get()) GT >
<cfset arguments.ErrorCollection.addError("..invalidLength") />
</cfif>
<!--- validate length --->
<cfif Len(arguments.Record.get()) GT AND IS NOT -1 >
<cfset arguments.ErrorCollection.addError("..invalidLength") />
</cfif>
<cfreturn arguments.ErrorCollection />
</cffunction>
</cfcomponent>