input
stringlengths 10
828
| output
stringlengths 5
107
|
|---|---|
public string get required class return org apache xerces parsers saxparser
|
retrieve a class that must exist in the classpath for this to work
|
public void ensure capacity int minimum capacity int max capacity value length if minimum capacity max capacity int new capacity max capacity max capacity 2 if minimum capacity new capacity new capacity minimum capacity char new value new char new capacity system arraycopy value 0 new value 0 count value new value shared false
|
ensures that the capacity of the buffer is at least equal to the
|
protected void set up 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 d expresso log catch configuration exception ex ex print stack trace throw new illegal state exception error setting up test case ex get message
|
set up method for test case
|
public void start component expresso component ec if ec instanceof startable if log is debug enabled log debug starting component ec get class get name startable ec start if log is info enabled log info started component ec get class get name else if log is debug enabled log debug object ec get class get name does not implement startable skipping start method
|
starts a component if it implements the code startable code interface
|
public void set length int new length ensure capacity new length if count new length copy when shared for count new length count value count 0 count new length
|
sets the length of this string buffer
|
public char char at int index return value index
|
returns the character at a specific index in this string buffer
|
public void init component expresso component ec if ec instanceof component lifecycle component lifecycle ec initialize
|
initialize the component provided if the component implements the code
|
public void get chars int src begin int src end char dst int dst begin system arraycopy value src begin dst dst begin src end src begin
|
characters are copied from this string buffer into the
|
public domwriter get domwriter return dom writer
|
retrieves the domwriter isntantiated class
|
public void write services file root container interface root container string location throws expresso runtime exception try file f new file location if f null throw new expresso runtime exception unable to open file location for writing f create new file output stream os new buffered output stream new file output stream f this write services file root container os os flush os close catch ioexception ex throw new expresso runtime exception i o error writing config file ex
|
write the services file to a particular file location
|
public void set char at int index char ch copy when shared value index ch
|
the character at the specified index of this string buffer is set
|
public void write services file root container interface root container output stream os throws expresso runtime exception document d build domtree root container get expresso services config this get domwriter save document os d
|
write the services file to a particular output stream
|
public fast string buffer append object obj return append string value of obj
|
appends the string representation of the code object code
|
protected void process component component config config element parent document dom element this component dom create element component this component set attribute name config get name this component set attribute class name config get class name process component properties config this component dom parent append child this component for iterator i config get child components iterator i has next component config one child component config i next process component one child this component dom
|
recursively go through the expresso services
|
public void set indexed value int index string value if index 0 throw new illegal argument exception index must be 0 values put new integer index value
|
set an indexed value
|
public fast string buffer append string str if str null str string value of str int len str length ensure capacity count len copy when shared str get chars 0 len value count count len return this
|
appends the string to this string buffer
|
public string get indexed value int index if index 0 throw new illegal argument exception index must be 0 return string values get new integer index
|
retrieve a value at a certain index
|
public void configure configuration new config throws configuration exception string temp string new config get dom writer class try set dom writer class temp catch expresso runtime exception ex throw new configuration exception invalid paramter service writer class temp ex get nested
|
configure the default service writer
|
public void reconfigure configuration new config throws configuration exception string roll back class this get dom writer class try configure new config catch configuration exception ex try this set dom writer class roll back class catch expresso runtime exception ex1 throw new configuration exception error rolling back configuration ex1 throw new configuration exception error setting configuration ex
|
reconfigure lifecycle event for this component
|
public fast string buffer append char str int len str length ensure capacity count len copy when shared system arraycopy str 0 value count len count len return this
|
appends the string representation of the code char code array
|
public void destroy dom writer null dom writer class null
|
implementation of the destroy lifecycle event
|
public void set version number string version number this version number version number
|
set the version number as a string
|
public string get dom writer class return dom writer class
|
retrieves the previously set classname of the dom writer
|
public void set version number string major string minor string micro try integer parse int major integer parse int minor integer parse int micro catch number format exception ex throw new illegal argument exception component metadata set version number major minor and micro version strings must be parseable integers version number major minor micro
|
set the version number as a batch of strings
|
public fast string buffer append char str int offset int len ensure capacity count len copy when shared system arraycopy str offset value count len count len return this
|
appends the string representation of a subarray of the
|
public void add child component component metadata new component nested add new component
|
add a new component metadata object as a child of this component
|
public list get children return collections unmodifiable list nested
|
retrieve a list of children
|
public void set dom writer class string dom writer class throws expresso runtime exception try domwriter tmp domwriter class locator load class dom writer class new instance this dom writer class dom writer class dom writer tmp catch exception ex throw new expresso runtime exception error setting dom writer class ex
|
sets and loads the specified dom writer class
|
public void add property property new value properties put new value get name new value
|
add a new property to this components metadata
|
public void add method method new value methods put new value get name new value
|
add a new method metadata object
|
public method get method string method name return method methods get method name
|
retrieve the metadata
|
public map get methods return collections unmodifiable map methods
|
retrieve all registered methods
|
public void add valid value string key string value valid value vv new valid value key value valid values add vv
|
add a valid value for the property
|
public fast string buffer append boolean b return append string value of b
|
appends the string representation of the code boolean code
|
public list retrieve valid values return valid values
|
retrieve a list of valid values for this particular property
|
public void set message bundle string message bundle this message bundle message bundle
|
p sets the method metadata available
|
public configuration create config bean default config bean target bean component config config component metadata metadata string new value config get property this get name if new value null new value length 0 new value this get value string type this get type try target bean set this get name convert utils convert new value class locator load class type catch class not found exception ex logger log logger get logger this get class log error error converting value value to class type class not found ex throw new illegal argument exception class not found type return target bean
|
load the config bean with values for this property
|
public string get message bundle return message bundle
|
retrieve the relative resource path to the message bundle
|
public void set schema data schema data new data schema data new data
|
sets the schema data for the component
|
public fast string buffer append char c ensure capacity count 1 copy when shared value count c return this
|
appends the string representation of the code char code
|
public schema data get schema data return schema data
|
retrieve the schema data bean from the metadata object
|
public void add data object dbobject data new obj if dbobjects null dbobjects new array list dbobjects add new obj
|
a data object metadata to this schem
|
public void add report object report data new obj if reports null reports new array list reports add new obj
|
a data object metadata to this schema
|
public fast string buffer append int i return append string value of i
|
appends the string representation of the code int code
|
public void add controller controller data new obj if controllers null controllers new array list controllers add new obj
|
a controller data metadata to this schema
|
public void add job job data new obj if jobs null jobs new array list jobs add new obj
|
a job data metadata to this schema
|
public void set mapped value string key string value if key null key length 0 throw new illegal argument exception key must be non zero length non null string values put key value
|
set the mapped propertys value
|
public list get controllers return collections unmodifiable list controllers
|
retrieve a readonly list of controllers for this schema
|
public string get mapped value string key if key null key length 0 throw new illegal argument exception key must be non zero length non null string return string values get key
|
retrieve the value of the mapped property
|
public list get data objects return collections unmodifiable list dbobjects
|
retrieve a readonly list of dbobjects for this schema
|
public list get jobs return collections unmodifiable list jobs
|
retrieve a readonly list of jobs for this schema
|
public list get reports return collections unmodifiable list reports
|
retrieve a readonly list of reports for this schema
|
public fast string buffer append long l return append string value of l
|
appends the string representation of the code long code
|
public fast string buffer append float f return append string value of f
|
appends the string representation of the code float code
|
public fast string buffer append double d return append string value of d
|
appends the string representation of the code double code
|
public containable get container component return nested
|
return the wrapped container expresso component
|
public fast string buffer reverse copy when shared int n count 1 for int j n 1 1 j 0 j char temp value j value j value n j value n j temp return this
|
the character sequence contained in this string buffer is
|
public void set container component containable new component nested new component
|
sets the nested component
|
public component container get parent container return parent
|
return the parent container
|
public void set parent container component container new parent parent new parent
|
set the parent container of this container
|
public void remove component string component name try container lock write lock acquire catch interrupted exception ex log error interrupted waiting for write lock aborting method ex return try child components remove component name finally container lock write lock release
|
removes a component from this container
|
public void release synchronized fast string buffer class try the pool return object this catch exception ex
|
sends the fast string buffer back to the object pool
|
public map get child components try container lock read lock acquire catch interrupted exception ex log error interrupted waiting for read lock aborting method ex return new hash map try return collections unmodifiable map child components finally container lock read lock release
|
retrieves a list of instances of all contained expresso components
|
public expresso component locate component string component name try container lock read lock acquire catch interrupted exception ex log error interrupted waiting for read lock aborting method ex return null try expresso component return value expresso component child components get component name if return value null get parent container null return value get parent container locate component component name return return value finally container lock read lock release
|
locates an expresso service for use by a client
|
public boolean is component exists string component name try container lock read lock acquire catch interrupted exception ex log error interrupted waiting for read lock aborting method ex return false try return is component exists component name finally container lock read lock release
|
query the container to see if a particular service name is installed
|
protected boolean is component exists string component name boolean return value child components contains key component name if return value false get parent container null return value get parent container is component exists component name return return value
|
version of is component exists without the locking
|
public void finalize if waiter null waiter stop
|
clearing the cron thread if the crontab is killed
|
public component container get parent container try container lock read lock acquire catch interrupted exception ex log error interrupted waiting for read lock aborting method ex return null try return parent finally container lock read lock release
|
return the parent container
|
protected component container get parent container return parent
|
get parent container without the locking
|
public void test constructor1 try create a crontab to execute at this time tomorrow calendar cal calendar get instance cal add calendar date 1 date dt cal get time crontab entry cron id new crontab entry dt listener if log is debug enabled log debug constructor 1 created cron cron id to string now is dt to string assert true cron date should be the exact time we originally set dt equals new date cron id get alarm time catch cron exception ex ex print stack trace fail crontab entry threw an exception
|
tests the quot execute at such and such date quot crontab
|
public void set parent container component container new parent try container lock write lock acquire catch interrupted exception ex log error interrupted waiting for read lock aborting method ex return try parent new parent finally container lock write lock release
|
set the parent container of this container
|
public void test constructor4 final string label test cron try every hour cron test crontab entry cron id new crontab entry 4 1 1 1 1 1 label listener check the label assert true label equals cron id get label if log is info enabled log info constructor 4 created cron cron id to string catch cron exception ex ex print stack trace fail crontab entry threw an exception
|
same as test constructor3 but also checks that the job label is getting
|
protected void finalize throws java lang throwable if child components null child components is empty if log null log warn container getting gc ed and subcomponents have not been destroyed destroy container super finalize
|
just in case
|
public crontab listener i get listener return this listener
|
retrieve the listener for the crontab
|
public boolean can owner administrate throws dbexception return true
|
always returns true
|
public void save blob string field name java io input stream value int file size throws dbexception if lf null lf new lob field lf set criteria this lf save blob field name value file size try lf save blob field name value file size finally lf close this set field field name file name unknown this set field field name mime type application x unknown this set field field name file size file size this update
|
saves a file to the blob field
|
public void release if lf null lf close
|
release the associated data with the blob fields
|
public boolean is fresh throws dbexception return get field permissions length 0
|
indicates that this object is new no permissions have been set
|
public void set data context string new context try set dbname new context catch dbexception e throw new illegal argument exception e get message
|
override of dbobjects set data context to call set dbname
|
public void set dbname string new context throws dbexception super set dbname new context override data context new context
|
ignore the new context parameter if setup values indicate to do this
|
public void set default permissions throws dbexception permissions row permissions default permissions group row permissions default permission group
|
set group group is everybody
|
public int permissions throws dbexception protect against empty perm if get field permissions length 0 return 0 return get field int permissions
|
set permissions not protected by test
|
public int get expected default population return new default mimetypes mime types length
|
useful method for unit testing to make sure that everything got added during
|
public string get icon url try string icon name string util not null this get field fld mimeicon if icon name length 0 icon name document gif fast string buffer fsb fast string buffer get instance string return value null try fsb append config manager get context this get data context get images fsb append mime type icons fsb append icon name return value fsb to string finally fsb release fsb null return return value catch configuration exception ce return catch dbexception dbe return
|
returns the icon url associated with this mime type object
|
public boolean has expired string expire date string date expire date try expire date string string util not null this get field expires if expire date string equals return false expire date this get field date expires catch dbexception e log error groupnest error getting expiration field return false date now new date if now after expire date return true else return false
|
checks to see if the current date is past the expiration date
|
private boolean ok number byte x if x 65 x 90 return true if x 48 x 57 return true if x 97 x 122 return true return false ok number byte
|
check if the given number is in the range of letters and
|
public string get default component code return tests
|
returns the default component code for this schema
|
public string get default description return test schema
|
returns the default description for this schema
|
public void test populated tables try mime types mt new mime types secured dbobject system account mt set data context test system initializer get test context int number mt count assert true should have mt get expected default population entries in the mimetypes table got number instead number mt get expected default population catch dbexception dbe super get log error unable to execute count on mimetypes table dbe fail unable to count mime type entries dbe get dbmessage
|
checks to make sure that the appropriate number of mimetype entries were
|
public void test jaffile mapper mimetypes file type map mftm new mimetypes file type map mftm add mime types application msword doc doc rtf rtf mftm add mime types audio mpeg3 mp3 string content type mftm get content type test doc assert true must have appropriate content type application msword equals content type content type mftm get content type test mp3 assert true must have appropriate content type audio mpeg3 equals content type
|
this is a sanity check
|
public void test file mapper mimetypes file type map m mime types get file map test system initializer get test context assert true must receive a null mimetypes file type map m null string content m get content type test mp3 assert true content type must be audio mpeg3 got content instead audio mpeg3 equals content content m get content type test pdf assert true content type must be application pdf got content instead application pdf equals content
|
checks to make sure that the javax
|
public void test factory method try mime types mt mime types get mime type test pdf test system initializer get test context mt mime types get mime type test xls test system initializer get test context string content mt get field mime types fld mimetype assert true content type must be application vnd ms excel got content instead application vnd ms excel equals content catch dbexception ex ex print stack trace fail error constructing mimetypes object ex get message
|
checks to make sure that the file to mimetype mapping functionality
|
public void test setup cache creation try setup s new setup secured dbobject system account s set data context test system initializer get test context s read setups if cache manager get instance exists cache test system initializer get test context s cache name else fail setup cache was not created correctly assert true setup cache must have at least 10 values in it cache manager get instance get item count test system initializer get test context s cache name 10 catch dbexception ex ex print stack trace fail ex get message
|
create a setup cache and make sure that the values are reading correctly
|
public boolean is expired throws dbexception java util date dt this get field date fld expires at if dt null return false return dt get time system current time millis
|
returns true if the validation queue entry has expired by checking the
|
public int get content count return contents size get content count
|
return the count of contents in this item
|
protected void pad with tabs print writer out int count if count padding length log warn encountered padding length nesting source format will no longer be padded out print new string padding 0 count
|
pad the output with particular nesting tabs supplies in essence source
|
public void set header cell boolean state is header cell state set header cell boolean
|
set the cell to be a header cell
|
public void set report code string new code report code new code
|
the report code
|
public string get report code return report code
|
retrieve the report code
|
public string get code return param code get code
|
return the code of this parameter
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.