input
stringlengths
10
828
output
stringlengths
5
107
public double get double string name return get double name 0 0
return a double for the given name
public long get size if store location null return store location length else if byte stream null return byte stream size else return content length
returns the size of the file
public string get string return new string get
returns the contents of the file as a string using default
public float get float string name float default value float value default value try object object parameters get convert name if object null value float value of string object 0 float value catch number format exception exception return value
return a float for the given name
public float get float string name return get float name 0 0f
return a float for the given name
public int get file size return new long get size int value
get the size of this file
public void set file size int filesize ignore this
set the file size
public big decimal get big decimal string name big decimal default value big decimal value default value try object object parameters get convert name if object null value new big decimal string object 0 catch number format exception exception return value
return a big decimal for the given name
public void destroy file the file new file get file name the file delete
destroy all content for this form file
public string get name return this file name
returns the name of the file item
public big decimal get big decimal string name return get big decimal name new big decimal 0 0
return a big decimal for the given name
public int get int string name int default value int value default value try object object parameters get convert name if object null value integer value of string object 0 int value catch number format exception exception return value
return an int for the given name
public int get int string name return get int name 0
return an int for the given name
public integer get integer string name int default value return new integer get int name default value
return an integer for the given name
public integer get integer string name integer def return new integer get int name def int value
return an integer for the given name
public integer get integer string name return new integer get int name 0
return an integer for the given name
public long get long string name long default value long value default value try object object parameters get convert name if object null value long value of string object 0 long value catch number format exception exception return value
return a long for the given name
public long get long string name return get long name 0
return a long for the given name
public byte get byte string name byte default value byte value default value try object object parameters get convert name if object null value byte value of string object 0 byte value catch number format exception exception return value
return a byte for the given name
public void dispose this request null this upload data null super dispose
disposes the parser
public byte get byte string name return get byte name byte 0
return a byte for the given name
public void append string name file item value file item items this get file items name if items null items new file item 1 items 0 value parameters put convert name items else file item new items new file item items length 1 system arraycopy items 0 new items 0 items length new items items length value parameters put convert name new items if file items null file items new vector file items add element name
add a file item object as a parameters
public file item get file item string name try file item value null object object parameters get convert name if object null value file item object 0 return value catch class cast exception e return null
return a file item object for the given name
public string get string string name try string value null object object parameters get convert name if object null value string object 0 if value null value equals null return null return value catch class cast exception e return null
return a string for the given name
public string get string name return get string name
return a string for the given name
public string get string string name string default value string value get string name if value null value length 0 value equals null return default value else return value
return a string for the given name
public void set string string name string value if value null parameters put convert name new string value
set a parameter to a specific value
public void set strings string name string values if values null parameters put convert name values
set a parameter to a specific value
public object get object string name try object value null object object parameters get convert name if object null value object object 0 return value catch class cast exception e return null
return an object for the given name
public string to string string buffer sb new string buffer for enumeration e parameters keys e has more elements string name string e next element try sb append sb append name sb append string params this get strings name if params length 1 sb append params 0 else for int i 0 i params length i if i 0 sb append sb append append params i append sb append n catch exception ee try sb append sb append name sb append sb append error sb append n catch exception eee return sb to string
simple method that attempts to get a to string representation
public schema next context if next null throw new java lang array index out of bounds exception no more contexts schema return value next find next return return value
retrieve the next schema in the sequence
private void init iterator current child context get container implementation get child components values iterator
initialize the current child iterator with children elements of the
private void find next next null while current child has next object one obj current child next if one obj instanceof schema next schema one obj break return
find and load the next values
public string get url return config manager expand value url
gets the jdbc url
public void add jndi config jndi new jndi my jndi new jndi
add jndi info to jdbc
public config jndi get my jndi return my jndi
retrieve the jndi configuration information
protected vector get my updates if my updates null return new vector return new vector my updates get my updates
return the vector of updates see the inner class that specify what changes
public void test file extensions string result file util get extension abc assert true equals result result file util get extension abc d assert true d equals result result file util get extension abc d efg assert true efg equals result
tests the file extension parser to make sure its grabbing the right
public void test get path string test tmp usr abcd abcdefg jkh string result file util get path test assert true tmp usr abcd equals result test c windows test krnl386 exe result file util get path test assert true c windows test equals result
tests to make sure path parsing is correct
public void test get base string test tmp usr abcd abcdefg jkh string result file util get base test assert true abcdefg equals result test c windows test krnl386 exe result file util get base test assert true krnl386 equals result
tests the get base
public void test fast string buffer final string test value abcdefghijklmnop try fast string buffer test buffer new fast string buffer 256 for int j 0 j 100 j assert true fresh fast string buffer should have zero length test buffer length 0 assert true fresh fast string buffer should have empty string equals test buffer to string test buffer append test value assert true must have proper value in test buffer test value equals test buffer to string test buffer clear catch exception ex ex print stack trace fail error performaing test fast string buffer pool ex get message
tests basic append and clear to make sure its working
public int get start record number if end record number start record number return start record number else return end record number
modified code based upon xin lee
public void set end record number int new end record number end record number new end record number
sets the ending record number
public int get end record number return end record number
returns the end record number for a particular page
public void set count records boolean new count records count records new count records
sets whether or not the total record count should be used or not
public boolean is count records return count records
returns true if the system is expected to get the total record count
public long get total record count return total record count
returns the total record count retrieved for this database search
public int get page count if page limit 0 return 1 else return int this get total record count page limit 1
get the number of pages using recorg pagination that exist for this record
public string form char c if fmt c throw new java lang illegal argument exception string r c return pad r form char
formats a character into a string like sprintf in c
public string form double x string r if precision 0 precision 6 int s 1 if x 0 x x s 1 if fmt f r fixed format x else if fmt e fmt e fmt g fmt g r exp format x else throw new java lang illegal argument exception return pad sign s r form double
formats a double into a string like sprintf in c
public string form long x string r int s 0 if fmt d fmt i if x 0 r x substring 1 s 1 else r x s 1 else if fmt o r convert x 3 7 01234567 else if fmt x r convert x 4 15 0123456789abcdef else if fmt x r convert x 4 15 0123456789 abcdef else throw new java lang illegal argument exception return pad sign s r form long
formats a long integer into a string like sprintf in c
public string form string s if fmt s throw new java lang illegal argument exception if precision 0 precision s length s s substring 0 precision return pad s form string
formats a string into a larger string like sprintf in c
public void warn string message out println p align center font color orange warn message font p
log a warning message
public void warn string message throwable error out println p align center font color orange warn message font p write exception error
log a warning exception
public void error string message throwable error out println p align center font color red warn message font p write exception error
log an error exception
protected void write exception throwable error out println p align center error get message p out println blockquote byte array output stream bos new byte array output stream error print stack trace new print stream bos out println bos to string out println blockquote
adds the exceptions as nested outputs to the original log message
public string get original dbname return get mapped data context
return the name of the db context originally requested
protected string get dbname http servlet request request string db name null try db name generic session get attribute string request db catch servlet exception se log error se db name if db name equals return default return db name get dbname http servlet request
return the alternate database name if one is set
public void destroy super destroy config manager get instance destroy
called when the context is destroyed for either reload or application
protected string get server name http servlet request request return request get server name get server name http servlet request
return the name of the current web server system
public int get server port http servlet request request return request get server port get server port http servlet request
return the port number the servlet runtime engine is running on
protected void set schema string schema class string util assert not blank schema class schema cannot be set to blank or null my schema schema class set schema string
tell this std servlet object what schema it belongs to
protected string get schema return my schema get schema
return the name of the schema class that this servlet is registered
public vector get record set if record set null return new vector return new vector record set get record set
return the set of records found by the last search and retrieve
public void destroy try security remove provider the provider get name key map clear iv map clear mode map clear key map null iv map null mode map null catch security exception e e print stack trace system err println e get message
unregisters the cryptographic handler
public void set delay int num seconds if num seconds 0 seconds delay num seconds
sets the number of seconds to delay when run
public int get delay return seconds delay
return the current setting for number of seconds to delay
public void run debugging functions java util date start time null java util date end time null if log is debug enabled start time new java util date log debug entering delay thread time start time get time try synchronized lock object if this is interrupted return if seconds delay 0 sleep seconds delay 1000 catch interrupted exception e do nothing if interrupted if log is debug enabled end time new java util date log debug exiting delay thread time end time get time time delta end time get time start time get time ms
execution path simply pause for seconds delay number of seconds
public void add notify user info uif throws dbexception this my user info uif any classes that implement the user listener interface and then call user add listener to register will be called back when a new user is added if listeners null array list the listeners null synchronized listeners the listeners new array list listeners values for iterator iterator the listeners iterator iterator has next user listener listener user listener iterator next listener added user this
used when a user info object adds itself outside of the user class
public void tear down throws exception user new user new user new user set login name test new user set data context test system initializer get test context if new user find system out println deleting user in the tear down new user delete
the teardown method for junit
public void delete notify user info uif throws dbexception this must be kept since it is possible that it was getting modified outside the user object this my user info uif any classes that implement the user listener interface and then call user add listener to register will be called back right before a user is deleted if listeners null array list the listeners null synchronized listeners the listeners new array list listeners values for iterator iterator the listeners iterator iterator has next user listener listener user listener iterator next listener deleted user this
used for when a user info implementation deletes itself outside of the
public string raw filter string data return data raw filter string
this filter just returns input string
public string standard filter string data return data standard filter string
this filter just returns input string
public string strip filter string data return data strip filter string
this filter just returns input string
public string standard filter string data string result super standard filter data return insert href tags result standard filter string
this filter html encodes all special characters defined by the replacement
public string standard filter string data return parse tree replace filter data to char array standard filter string
this filter html encodes all special characters defined by the replacement
public string strip filter string data return strip tree replace filter data to char array strip filter string
this filter strips out all special characters defined by the replacement
public void dump node category log if log is debug enabled fast string buffer fsb fast string buffer get instance try dump node fsb 0 log debug fsb to string finally fsb release fsb null
dumps the contents of the tree to the log
public void dump node fast string buffer fsb fast string buffer get instance try dump node fsb 0 system out println fsb to string finally fsb release fsb null
dumps a printout of the node and subnodes to system
public void dump node fast string buffer string buffer int depth if replacement string null this pad with tabs string buffer depth string buffer append node s replacement string replacement string n if subnodes null for iterator i subnodes key set iterator i has next character c character i next filter tree node ftn filter tree node subnodes get c if ftn null this pad with tabs string buffer depth string buffer append dump for subnode c n ftn dump node string buffer depth 1
dumps the contents of the tree to the log
private void pad with tabs fast string buffer string buffer int num tabs for int i 0 i num tabs i string buffer append t
formatter helping function to pad in for each node
synchronized static public filter manager get instance if the manager null the manager new filter manager return the manager get instance
the singleton implementation
public string get data context return db name get dbname
returns the currently set db context
private string prepare filter class name string character set name char c int length character set name length fast string buffer result fast string buffer get instance string return value null try result append com jcorporate expresso core security filters for int i 0 i length i c character set name char at i result append c c return value result to string finally result release result null return return value prepare filter class name string
adds class com
public void set status string new status if new status equals ignore case data object status new new status equals ignore case data object status current new status equals ignore case data object status updated new status equals ignore case data object status deleted current status new status else throw new illegal argument exception unknown status new status set status string
set the current status of a record
public string get status return current status get status
get the status of this record
protected void copy attributes dbobject return obj throws dbexception if local connection null return obj set connection local connection else return obj set data context get data context
called by new instance this method should make sure that the newly created
public array list search and retrieve list string sort order throws dbexception return new array list target search and retrieve list sort order
performs a datasource search so that the criteria set in the data object
public array list search and retrieve list throws dbexception return new array list target search and retrieve list
performs a datasource search so that the criteria set in the data object
public void write external java io object output oos throws ioexception oos write object table fields if data context null oos write utf empty string else oos write utf data context if object class name null oos write utf empty string else oos write utf object class name
optimized serialization implementation that does not utilize any
public void set table fields map table fields if table fields instanceof hash map this table fields hash map table fields else this table fields new hash map table fields
sets the data fields in bulk
protected void set up system macros get instance set web app dir system get property junit argv web app dir try global container system factory build expresso component system this get class get resource test1 expresso services xml this get class get resource test log4j config xml system get property junit argv log dir d expresso log catch exception e e print stack trace fail caught exception setting up test case
set up method for test case
protected void tear down global container destroy
tear down method for test case
public void test get data context try locator utils lc new locator utils global container persistence manager manager persistence manager lc locate component default persistence manager assert true persistence manager should exist manager null assert true default equals manager get data context catch exception ex ex print stack trace fail caught exception constructing global container
test for method get data context
public void test get config name try locator utils lc new locator utils global container persistence manager manager persistence manager lc locate component default persistence manager assert true persistence manager should exist manager null assert true hypersonic xml equals manager get config name catch exception ex ex print stack trace fail caught exception constructing global container
test for method get config name
public void test get password try locator utils lc new locator utils global container persistence manager manager persistence manager lc locate component default persistence manager assert true persistence manager should exist manager null assert true equals manager get password assert true equals manager get dbconfig get current config get password catch exception ex ex print stack trace fail caught exception constructing global container
test for method get password
public void load join data url location digester d build digester digest d location
loads the join data by constructing the digester object and then merging
public void set permissions boolean create boolean read boolean update boolean delete permissions put secured dbobject add create permissions put secured dbobject search read permissions put secured dbobject update update permissions put secured dbobject delete delete
set the permissions of the join
public map get permissions return permissions
retrieve the permissions
private void setup resolvers digester digester url url this get class get resource com jcorporate expresso core dataobjects jdbc jdbc join 5 1 dtd if url null digester register jcorporate ltd dtd expresso data object join 5 1 en url to string else throw new illegal argument exception unable to locate jdbc join 5 1 dtd in package
sets up the appropriate locations to resolve the doctypes