Input:
Helper method for mutable transaction execution . [CODESPLIT] private Object executeMutableTransaction ( ManagedMethodSPI managedMethod , Object [ ] args ) throws Throwable { // store transaction session on current thread via transactional resource utility
 // it may happen to have multiple nested transaction on current thread
 // since all are created by the same transactional resource, all are part of the same session
 // and there is no harm if storeSession is invoked multiple times
 // also performance penalty is comparable with the effort to prevent this multiple write
 Transaction transaction = transactionalResource . createTransaction ( ) ; transactionalResource . storeSession ( transaction . getSession ( ) ) ; try { Object result = managedMethod . invoke ( managedInstance , args ) ; transaction . commit ( ) ; if ( transaction . unused ( ) ) { log . debug ( "Method |%s| superfluously declared transactional." , managedMethod ) ; } return result ; } catch ( Throwable throwable ) { transaction . rollback ( ) ; throw throwable ( throwable , "Mutable transactional method |%s| invocation fail." , managedMethod ) ; } finally { if ( transaction . close ( ) ) { // it may happen to have multiple nested transaction on this thread
 // if this is the case, remove session from current thread only if outermost transaction is closed
 // of course if not nested transactions, remove at once
 transactionalResource . releaseSession ( ) ; } } }


Input:
Helper method for immutable transaction execution . [CODESPLIT] private Object executeImmutableTransaction ( ManagedMethodSPI managedMethod , Object [ ] args ) throws Throwable { Transaction transaction = transactionalResource . createReadOnlyTransaction ( ) ; // see mutable transaction comment
 transactionalResource . storeSession ( transaction . getSession ( ) ) ; try { Object result = managedMethod . invoke ( managedInstance , args ) ; if ( transaction . unused ( ) ) { log . debug ( "Method |%s| superfluously declared transactional." , managedMethod ) ; } return result ; } catch ( Throwable throwable ) { throw throwable ( throwable , "Immutable transactional method |%s| invocation fail." , managedMethod ) ; } finally { if ( transaction . close ( ) ) { // see mutable transaction comment
 transactionalResource . releaseSession ( ) ; } } }


Input: Prepare given throwable and dump it to logger with formatted message . Return prepared throwable . If throwable is { @link InvocationTargetException } or its unchecked related version { @link InvocationException } replace it with root cause . [CODESPLIT] private static Throwable throwable ( Throwable throwable , String message , Object ... args ) { Throwable t = throwable ; if ( t instanceof InvocationException && t . getCause ( ) != null ) { t = t . getCause ( ) ; } if ( t instanceof InvocationTargetException && ( ( InvocationTargetException ) t ) . getTargetException ( ) != null ) { t = ( ( InvocationTargetException ) t ) . getTargetException ( ) ; } message = String . format ( message , args ) ; log . dump ( message , t ) ; return t ; }


Input: Returns the only file that matches the pattern . If no file matches a <code > null< / code > . If more than one file matches a { @link FilenameNotUniqueException } is thrown . [CODESPLIT] public File getUniqueFile ( ) throws FilenameNotUniqueException , FileNotFoundException { File [ ] files = directory . listFiles ( filter ) ; if ( files == null || files . length == 0 ) { throw new FileNotFoundException ( ) ; } if ( files . length > 1 ) { throw new FilenameNotUniqueException ( filter . getPattern ( ) ) ; } return files [ 0 ] ; }


Input: Returns a list of all matching files . [CODESPLIT] public File [ ] getFiles ( ) { final File [ ] files = directory . listFiles ( filter ) ; if ( files == null ) { return new File [ 0 ] ; } else { return files ; } }


Input: Returns the last matching file . [CODESPLIT] public File getLastFile ( ) throws FileNotFoundException { File [ ] files = directory . listFiles ( filter ) ; if ( files == null || files . length == 0 ) { throw new FileNotFoundException ( ) ; } return files [ files . length - 1 ] ; }


Input: Processes the table row { @code cells } . [CODESPLIT] @ Override protected void doCells ( List < FitCell > cells ) { this . cells = cells ; this . appender = getAppender ( ) ; if ( appender != null ) { try { executeCommand ( ) ; } catch ( final IllegalArgumentException e ) { cells . get ( COMMAND_COLUMN ) . exception ( "Illegal Format" ) ; } } }


Input:
Retrieve instance from current thread bound to given managed class or null if none found . Uses provided managed instance key to get instance from { @link #instancesPool } . Instance key argument should be not null . [CODESPLIT] @ Override public Object getInstance ( InstanceKey instanceKey ) { // at this point managed class is guaranteed to be non null
 ThreadLocal < Object > tls = instancesPool . get ( instanceKey ) ; if ( tls == null ) { synchronized ( instancesPool ) { tls = instancesPool . get ( instanceKey ) ; if ( tls == null ) { tls = new ThreadLocal <> ( ) ; instancesPool . put ( instanceKey , tls ) ; } } return null ; } return tls . get ( ) ; }


Input:
Persist instance on current thread bound to given managed class . This method simply uses provided instance key argument to add instance to { @link #instancesPool } . Both arguments should to be not null . [CODESPLIT] @ Override public void persistInstance ( InstanceKey instanceKey , Object instance ) { // at this point managed class and instance are guaranteed to be non null
 ThreadLocal < Object > tls = instancesPool . get ( instanceKey ) ; if ( tls == null ) { throw new BugError ( "Invalid methods invocation sequence. Ensure getInstance() is invoked before and is executed in the same thread." ) ; } tls . set ( instance ) ; }


Input: Clear all threads local storage and { [CODESPLIT] @ Override public void clear ( ) { for ( ThreadLocal < Object > threadLocal : instancesPool . values ( ) ) { threadLocal . remove ( ) ; } instancesPool . clear ( ) ; }


Input: Beside initialization inherited from { @link AppServlet#init ( ServletConfig ) } this method takes care to initialize event stream manager reference . [CODESPLIT] @ Override public void init ( ServletConfig config ) throws UnavailableException { super . init ( config ) ; log . trace ( "init(ServletConfig)" ) ; eventStreamManager = container . getInstance ( EventStreamManager . class ) ; }


Input:
Create { @link EventStream } for session ID from request URI and run { @link EventStream#loop () } as far it returns true . This method takes also care to handle connections errors due to network or client failure . At event stream loop exit graceful or due to error unbind event stream from manager . <p > If event stream cannot be created due to bad session ID responds with bad request error code 400 . <p > Note that this method does not return as long client requesting for event stream is connected keeping HTTP request thread and servlet allocated even there is no event to send for this particular client . [CODESPLIT] @ Override protected void handleRequest ( RequestContext context ) throws IOException { log . trace ( "handleRequest(RequestContext)" ) ; final HttpServletResponse httpResponse = context . getResponse ( ) ; final String sessionID = getEventStreamSessionID ( context . getRequestPath ( ) ) ; EventStream eventStream = eventStreamManager . createEventStream ( sessionID ) ; if ( eventStream == null ) { // a bad or heavy loaded client may send this request after session expiration or attempt to reuse old session ID
 sendBadRequest ( context ) ; return ; } // 1. headers and content type should be initialized before response commit
 // 2. it seems that ServletResponse#getWriter() updates character set
 // excerpt from apidoc:
 // If the response's character encoding has not been specified as described in getCharacterEncoding (i.e., the method
 // just returns the default value ISO-8859-1), getWriter updates it to ISO-8859-1.
 // so need to be sure headers are updated before writer opened
 httpResponse . setContentType ( "text/event-stream;charset=UTF-8" ) ; // no need to explicitly set character encoding since is already set by content type
 // httpResponse.setCharacterEncoding("UTF-8");
 httpResponse . setHeader ( HttpHeader . CACHE_CONTROL , HttpHeader . NO_CACHE ) ; httpResponse . addHeader ( HttpHeader . CACHE_CONTROL , HttpHeader . NO_STORE ) ; httpResponse . setHeader ( HttpHeader . PRAGMA , HttpHeader . NO_CACHE ) ; httpResponse . setDateHeader ( HttpHeader . EXPIRES , 0 ) ; httpResponse . setHeader ( HttpHeader . CONNECTION , HttpHeader . KEEP_ALIVE ) ; eventStream . setRemoteHost ( context . getRemoteHost ( ) ) ; eventStream . setWriter ( httpResponse . getWriter ( ) ) ; try { eventStream . onOpen ( ) ; log . debug ( "Event stream |%s| opened." , eventStream ) ; while ( eventStream . loop ( ) ) { } } finally { eventStream . onClose ( ) ; eventStreamManager . destroyEventStream ( eventStream ) ; log . debug ( "Event stream |%s| closed." , sessionID ) ; } }


Input:
Extract event stream session ID from request path . This method extracts last path component from request path with extension removed if present . It is a sort of <code > basename< / code > from file path . All next request paths with return the same session ID <code > 1234< / code > : <ul > <li > / 1234 . event <li > / event / 1234 <li > / 1234 <li > / admin / 1234 . event <li > / admin / event / 1234 < / ul > This allows for flexible event stream servlet mapping on deployment descriptor . Both mapping by path and extension can be used . Also extension can be anything . Anyway this flexibility comes with a constraint : session ID cannot contain slash ( / ) or dot ( . ) . <p > Session ID is generated by event stream manager when client subscribes see { @link EventStreamManager#subscribe ( EventStreamConfig ) } then client sends session ID back to this servlet as a HTTP request . [CODESPLIT] private static String getEventStreamSessionID ( String requestPath ) { int extensionSeparator = requestPath . lastIndexOf ( ' ' ) ; if ( extensionSeparator == - 1 ) { extensionSeparator = requestPath . length ( ) ; } // request URI is guaranteed to start with path separator
 // anyway, if missing below pathSeparator will be -1 + 1 = 0, pointing to entire request URI
 int pathSeparator = requestPath . lastIndexOf ( ' ' , extensionSeparator ) + 1 ; return requestPath . substring ( pathSeparator , extensionSeparator ) ; }


Input: Saves the input and closes the { [CODESPLIT] public void save ( ) { try { onSave ( ) ; close ( ) ; } catch ( IOException | IllegalArgumentException | IllegalAccessException | Validator . InvalidValueException ex ) { onError ( ex ) ; } catch ( IllegalStateException ex ) { // This usually inidicates a "lost update" ConfirmDialog . show ( getUI ( ) , ex . getLocalizedMessage ( ) + "\nDo you want to refresh this page loosing any changes you have made?" , ( ConfirmDialog cd ) -> { if ( cd . isConfirmed ( ) ) { refresh ( ) ; } } ) ; } }


Input: Sets the database driver . { @code driverName } must be a fully qualified class name and the class must be in java s class path . Unless the driver is already registered { @code setProvider } registers it at the { @code java . sql . DriverManager } . [CODESPLIT] public static void setProvider ( final String driverName ) throws Exception { Driver driver = ( Driver ) Class . forName ( driverName ) . newInstance ( ) ; Enumeration < Driver > drivers = DriverManager . getDrivers ( ) ; while ( drivers . hasMoreElements ( ) ) { if ( drivers . nextElement ( ) . getClass ( ) . equals ( driver . getClass ( ) ) ) { return ; } } DriverManager . registerDriver ( driver ) ; }


Input: Returns the parser configuration . [CODESPLIT] @ SuppressWarnings ( "unchecked" ) protected final CONFIG_TYPE getConcreteConfig ( final ParserConfig config ) { final Config < ParserConfig > cfg = config . getConfig ( ) ; if ( cfg == null ) { throw new IllegalStateException ( "The configuration is expected to be of type '" + concreteConfigClass . getName ( ) + "', but was: null" ) ; } else { if ( ! ( concreteConfigClass . isAssignableFrom ( cfg . getConfig ( ) . getClass ( ) ) ) ) { throw new IllegalStateException ( "The configuration is expected to be of type '" + concreteConfigClass . getName ( ) + "', but was: " + cfg . getConfig ( ) . getClass ( ) . getName ( ) + " - Did you add the configuration class to the JXB context?" ) ; } } return ( CONFIG_TYPE ) cfg . getConfig ( ) ; }


Input:
Load locale codes and security domains lists from filter parameters . Filter parameter is a list of command separated items . If related filter parameter is not declared field is initialized to empty list . <p > This filter loads tiny container reference from servlet context attribute { @link TinyContainer#ATTR_INSTANCE } . If there is no servlet context attribute with the that name this initialization fails with filter permanently unavailable . [CODESPLIT] @ Override public void init ( FilterConfig config ) throws UnavailableException { log . trace ( "init(FilterConfig)" ) ; // is safe to store container reference on filter instance since container has application life span
 container = ( ContainerSPI ) config . getServletContext ( ) . getAttribute ( TinyContainer . ATTR_INSTANCE ) ; if ( container == null ) { log . fatal ( "Tiny container instance not properly created, probably misconfigured. Request preprocessor permanently unvailable." ) ; throw new UnavailableException ( "Tiny container instance not properly created, probably misconfigured." ) ; } String localeParameter = config . getInitParameter ( PARAM_LOCALE ) ; if ( localeParameter != null ) { locales = Strings . split ( localeParameter , ' ' ) ; for ( String locale : locales ) { log . debug ( "Register locale |%s| for request pre-processing." , locale ) ; } } String securityDomainParameter = config . getInitParameter ( PARAM_SECURITY_DOMAIN ) ; if ( securityDomainParameter != null ) { securityDomains = Strings . split ( securityDomainParameter , ' ' ) ; for ( String securityDomain : securityDomains ) { log . debug ( "Register security domain |%s| for request pre-processing." , securityDomain ) ; } } }


Input:
Search request URI for locale and security domain by comparing with internal lists and remove found values . Update locale security domain and request path on context request from current thread see { @link RequestContext#setLocale ( Locale ) } { @link RequestContext#setSecurityDomain ( String ) } and { @link RequestContext#setRequestPath ( String ) } . <p > Remove locale and security context from current request URI and forward it . If current request URI is for a static resource that is an existing file this filter does nothing . <p > It is considered a resource not found and rejected with 404 if a request URI contains a locale code that is not listed into filter parameter . If <code > locale< / code > filter parameter is not declared all locale code that may be present into request URI are passed unprocessed . If request URI contains a security domain that is not listed into <code > security - domain< / code > filter parameter it is forwarded unprocessed . [CODESPLIT] @ Override public void doFilter ( ServletRequest request , ServletResponse response , FilterChain chain ) throws IOException , ServletException { HttpServletRequest httpRequest = ( HttpServletRequest ) request ; String requestURI = httpRequest . getRequestURI ( ) ; String contextPath = httpRequest . getContextPath ( ) ; String requestPath = requestURI . substring ( contextPath . length ( ) ) ; // request-uri = context-path request-path
 // context-path = "/" path-component
 // request-path = 1*("/" path-component)
 File file = new File ( request . getServletContext ( ) . getRealPath ( requestPath ) ) ; if ( file . exists ( ) ) { chain . doFilter ( request , response ) ; return ; } // request-path = ["/" locale] ["/" security-domain] 1*("/" path-component)
 RequestContext context = container . getInstance ( RequestContext . class ) ; String queryString = httpRequest . getQueryString ( ) ; context . setRequestURL ( queryString != null ? Strings . concat ( requestURI , ' ' , queryString ) : requestURI ) ; if ( ! locales . isEmpty ( ) ) { for ( String locale : locales ) { if ( startsWith ( requestPath , locale ) ) { requestPath = requestPath . substring ( locale . length ( ) + 1 ) ; context . setLocale ( new Locale ( locale ) ) ; break ; } } } for ( String securityDomain : securityDomains ) { if ( startsWith ( requestPath , securityDomain ) ) { requestPath = requestPath . substring ( securityDomain . length ( ) + 1 ) ; context . setSecurityDomain ( securityDomain ) ; break ; } } context . setRequestPath ( requestPath ) ; request . getRequestDispatcher ( requestPath ) . forward ( request , response ) ; }


Input: Test if request path starts with path component . This predicate returns true if first path component from given request path equals requested path component . Comparison is not case sensitive . Request path should start with path separator otherwise this predicate returns false . [CODESPLIT] private static boolean startsWith ( String requestPath , String pathComponent ) { if ( requestPath . charAt ( 0 ) != ' ' ) { return false ; } int i = 1 ; for ( int j = 0 ; i < requestPath . length ( ) ; ++ i , ++ j ) { if ( requestPath . charAt ( i ) == ' ' ) { return j == pathComponent . length ( ) ; } if ( j == pathComponent . length ( ) ) { return false ; } if ( Character . toLowerCase ( requestPath . charAt ( i ) ) != Character . toLowerCase ( pathComponent . charAt ( j ) ) ) { return false ; } } return false ; }


Input: Returns a list of factories for the given model type . [CODESPLIT] @ SuppressWarnings ( "unchecked" ) @ NotNull public final < MODEL > List < ArtifactFactory < MODEL > > getFactories ( final Class < MODEL > modelType ) { final List < ArtifactFactory < MODEL > > list = new ArrayList < ArtifactFactory < MODEL > > ( ) ; if ( factories == null ) { factories = new ArrayList < ArtifactFactory < ? > > ( ) ; if ( factoryConfigs != null ) { for ( final ArtifactFactoryConfig factoryConfig : factoryConfigs ) { factories . add ( factoryConfig . getFactory ( ) ) ; } } } for ( final ArtifactFactory < ? > factory : factories ) { if ( modelType . isAssignableFrom ( factory . getModelType ( ) ) ) { list . add ( ( ArtifactFactory < MODEL > ) factory ) ; } } return list ; }


Input: Parses { @code string } and returns a valid Date object . For parsing a { @link SimpleDateFormat } object is used . [CODESPLIT] public Date getDate ( final String string ) throws ParseException { return getDateFormat ( format , locale ) . parse ( string ) ; }


Input: Parses { @code string } and returns a valid Date object . For parsing a { @link SimpleDateFormat } object is used . [CODESPLIT] public Date getDate ( final String string , final String formatString , final String localeName ) throws ParseException { return getDateFormat ( formatString , parseLocale ( localeName ) ) . parse ( string ) ; }


Input: Wraps the control in a { @link Window } . [CODESPLIT] protected Window asWindow ( ) { if ( containingWindow == null ) { containingWindow = new Window ( getCaption ( ) , this ) ; containingWindow . setWidth ( 80 , Unit . PERCENTAGE ) ; containingWindow . setHeight ( 80 , Unit . PERCENTAGE ) ; containingWindow . center ( ) ; } return containingWindow ; }


Input:
Retrieve instance from current HTTP session bound to given instance key or null if none found . Uses provided instance key argument as HTTP session attribute name . Managed instance key argument should be not null . <p > Access to HTTP session is obtained from HTTP request ; therefore it is considered a bug if attempt to use this method outside a HTTP request thread . <p > Implementation note : this method could have side effect . It <b > creates the HTTP session< / b > if there is none on current HTTP request . [CODESPLIT] @ Override public Object getInstance ( InstanceKey instanceKey ) { // at this point managed instance key is guaranteed to be non null
 // SESSION instances are stored on current HTTP session as named attribute value, using provided instance key
 // HTTP session is created on the fly if necessary
 // if HTTP session exists and possesses an attribute with instance key, simply returns stored instance
 // when HTTP session expires attribute values are removed and SESSION instances are garbage collected
 HttpSession httpSession = getSession ( instanceKey ) ; return httpSession . getAttribute ( instanceKey . getValue ( ) ) ; }


Input:
Persist instance on current HTTP session bound to given managed instance key . This method simply uses <code > instanceKey< / code > to add instance as HTTP session attribute . Both arguments should to be not null . <p > Access to HTTP session is obtained from HTTP request ; therefore it is considered a bug if attempt to use this method outside a HTTP request thread . <p > Implementation note : this method could have side effect . It <b > creates the HTTP session< / b > if there is none on current HTTP request . [CODESPLIT] @ Override public void persistInstance ( InstanceKey instanceKey , Object instance ) { // at this point key and instance arguments are guaranteed to be non null
 HttpSession httpSession = getSession ( instanceKey ) ; httpSession . setAttribute ( instanceKey . getValue ( ) , instance ) ; }


Input:
Get HTTP session from current request creating it if necessary . This method should be call inside a request context otherwise bug error is thrown . [CODESPLIT] private HttpSession getSession ( InstanceKey instanceKey ) { RequestContext requestContext = appFactory . getInstance ( RequestContext . class ) ; HttpServletRequest httpRequest = requestContext . getRequest ( ) ; if ( httpRequest == null ) { throw new BugError ( "Invalid web context due to null HTTP request. Cannot create managed instance for |%s| with scope SESSION." , instanceKey ) ; } // create HTTP session if missing; accordingly API httpSession is never null if 'create' flag is true
 return httpRequest . getSession ( true ) ; }


Input: Serialize this file resource to HTTP response . Disable cache and set content type and content length . [CODESPLIT] @ Override public void serialize ( HttpServletResponse httpResponse ) throws IOException { httpResponse . setHeader ( HttpHeader . CACHE_CONTROL , HttpHeader . NO_CACHE ) ; httpResponse . addHeader ( HttpHeader . CACHE_CONTROL , HttpHeader . NO_STORE ) ; httpResponse . setHeader ( HttpHeader . PRAGMA , HttpHeader . NO_CACHE ) ; httpResponse . setDateHeader ( HttpHeader . EXPIRES , 0 ) ; httpResponse . setContentType ( contentType ) ; httpResponse . setHeader ( HttpHeader . CONTENT_LENGTH , Long . toString ( file . length ( ) ) ) ; Files . copy ( file , httpResponse . getOutputStream ( ) ) ; }


Input: Replacement of { @code doRows ( Parse ) } which resolves question marks in the first row and calls fit . ColumnFixture . doRows ( Parse ) . <p > Question marks represent method calls so getValue () and getValue? are equivalent . [CODESPLIT] @ Override protected void doRows ( final List < FitRow > rows ) throws Exception { FitRow headerRow = rows . get ( 0 ) ; columnParameters = extractColumnParameters ( headerRow ) ; bind ( headerRow ) ; super . doRows ( rows . subList ( 1 , rows . size ( ) ) ) ; }


Input: Replacement of { @code doCell } which resolves cross - references before calling the original { @code doCell } method of fit . [CODESPLIT] @ Override protected void doCell ( final FitCell cell , final int column ) { ValueReceiver receiver = columnBindings [ column ] ; String currentCellParameter = saveGet ( column , columnParameters ) ; if ( receiver != null && ! cell . getFitValue ( ) . trim ( ) . isEmpty ( ) && receiver . canSet ( ) ) { setValue ( cell , receiver , currentCellParameter ) ; } else { check ( cell , receiver , currentCellParameter ) ; } }


Input: Utility ////////////////////////////////// [CODESPLIT] protected void bind ( FitRow heads ) { columnBindings = new ValueReceiver [ heads . size ( ) ] ; for ( int i = 0 ; i < columnBindings . length ; i ++ ) { FitCell cell = heads . cells ( ) . get ( i ) ; String name = cell . getFitValue ( ) ; try { columnBindings [ i ] = createReceiver ( this , name ) ; } catch ( Exception e ) { cell . exception ( e ) ; } } }


Input: Fetches meta data such as links from the server . [CODESPLIT] public void readMeta ( ) throws IOException , IllegalArgumentException , IllegalAccessException , FileNotFoundException , IllegalStateException { executeAndHandle ( Request . Get ( uri ) ) ; }


Input: Implements Serializable [CODESPLIT] private void writeObject ( ObjectOutputStream out ) throws IOException { out . writeInt ( this . blockSize ) ; out . writeLong ( this . count ) ; out . writeInt ( this . lastLen ) ; out . writeInt ( getNodeCount ( ) ) ; Node n = this . nodeList . first ; while ( n != null ) { out . writeObject ( n . buf ) ; n = n . next ; } }


Input: Beside initialization performed by { @link AppServlet#init ( ServletConfig ) } this method takes care to load resource methods cache . A resource method is a remotely accessible method that returns a { @link Resource } . Map storage key is generated by { @link #key ( ManagedMethodSPI ) } based on controller and resource method request paths and is paired with retrieval key - { @link #key ( String ) } generated from request path when method invocation occurs . [CODESPLIT] @ Override public void init ( ServletConfig config ) throws UnavailableException { super . init ( config ) ; for ( ManagedMethodSPI method : container . getManagedMethods ( ) ) { if ( Types . isKindOf ( method . getReturnType ( ) , Resource . class ) ) { resourceMethods . put ( key ( method ) , method ) ; } } }


Input:
Handle request for a resource . Locate resource method based on request path from request context execute method and serialize back to client returned resource . See class description for general behavior . [CODESPLIT] @ Override protected void handleRequest ( RequestContext context ) throws ServletException , IOException { // for exceptions generated before response commit uses HttpServletResponse.sendError
 // on send error, servlet container prepares error response using container internal HTML for response body
 // if <error-page> is configured into deployment descriptor servlet container uses that HTML for response body
 final HttpServletRequest httpRequest = context . getRequest ( ) ; final HttpServletResponse httpResponse = context . getResponse ( ) ; ArgumentsReader argumentsReader = null ; Resource resource = null ; try { ManagedMethodSPI method = resourceMethods . get ( key ( context . getRequestPath ( ) ) ) ; if ( method == null ) { throw new NoSuchMethodException ( httpRequest . getRequestURI ( ) ) ; } final Type [ ] formalParameters = method . getParameterTypes ( ) ; argumentsReader = argumentsReaderFactory . getArgumentsReader ( httpRequest , formalParameters ) ; Object [ ] arguments = argumentsReader . read ( httpRequest , formalParameters ) ; Object controller = container . getInstance ( method . getDeclaringClass ( ) ) ; resource = method . invoke ( controller , arguments ) ; if ( resource == null ) { throw new BugError ( "Null resource |%s|." , httpRequest . getRequestURI ( ) ) ; } } catch ( AuthorizationException e ) { // at this point, resource is private and need to redirect to a login page
 // if application provides one, tiny container is configured with, and use it
 // otherwise servlet container should have one
 // if no login page found send back servlet container error - that could be custom error page, if declared
 String loginPage = container . getLoginPage ( ) ; if ( loginPage != null ) { httpResponse . sendRedirect ( loginPage ) ; } else { // expected servlet container behavior:
 // if <login-config> section exist into web.xml do what is configured there
 // else send back internal page with message about SC_UNAUTHORIZED
 // authenticate can throw ServletException if fails, perhaps because is not configured
 // let servlet container handle this error, that could be custom error page is configured
 httpRequest . authenticate ( httpResponse ) ; } return ; } catch ( NoSuchMethodException | IllegalArgumentException e ) { // do not use AppServlet#sendError since it is encoded JSON and for resources need HTML
 dumpError ( context , e ) ; httpResponse . sendError ( HttpServletResponse . SC_NOT_FOUND , httpRequest . getRequestURI ( ) ) ; return ; } catch ( InvocationException e ) { // do not use AppServlet#sendError since it is encoded JSON and for resources need HTML
 dumpError ( context , e ) ; if ( e . getCause ( ) instanceof NoSuchResourceException ) { httpResponse . sendError ( HttpServletResponse . SC_NOT_FOUND , httpRequest . getRequestURI ( ) ) ; } else { httpResponse . sendError ( HttpServletResponse . SC_INTERNAL_SERVER_ERROR , e . getCause ( ) . getMessage ( ) ) ; } return ; } finally { if ( argumentsReader != null ) { argumentsReader . clean ( ) ; } } // once serialization process started response becomes committed
 // and is not longer possible to use HttpServletResponse#sendError
 // let servlet container handle IO exceptions but since client already start rendering
 // there is no so much to do beside closing or reseting connection
 httpResponse . setStatus ( HttpServletResponse . SC_OK ) ; resource . serialize ( httpResponse ) ; }


Input: Generate storage key for resource methods cache . This key is create from controller and resource method request paths and is used on cache initialization . It is paired with { @link #key ( String ) } created from request path on actual method invocation . <p > Here is storage key syntax that should be identical with retrieval key . Key has optional controller path - missing if use default controller and resource method path . Controller path is the declaring class request path { @link ManagedClassSPI#getRequestPath () } and resource path is managed method request path { @link ManagedMethodSPI#getRequestPath () } . [CODESPLIT] private static String key ( ManagedMethodSPI resourceMethod ) { StringBuilder key = new StringBuilder ( ) ; if ( resourceMethod . getDeclaringClass ( ) . getRequestPath ( ) != null ) { key . append ( ' ' ) ; key . append ( resourceMethod . getDeclaringClass ( ) . getRequestPath ( ) ) ; } key . append ( ' ' ) ; key . append ( resourceMethod . getRequestPath ( ) ) ; return key . toString ( ) ; }


Input: Performs an HTTP GET request on the { @link Endpoint#getUri () } and caches the response if the server sends an ETag header . [CODESPLIT] protected HttpEntity getContent ( ) throws IOException , IllegalArgumentException , IllegalAccessException , FileNotFoundException , IllegalStateException { Request request = Request . Get ( uri ) ; if ( last != null ) { request = request . addHeader ( IF_NONE_MATCH , last . etag ) ; } HttpResponse response = execute ( request ) ; if ( response . getStatusLine ( ) . getStatusCode ( ) == SC_NOT_MODIFIED && last != null ) { return last . content ; } handleResponse ( response , request ) ; Header etagHeader = response . getFirstHeader ( HttpHeaders . ETAG ) ; last = ( etagHeader == null ) ? null : new Memory ( etagHeader . getValue ( ) , response . getEntity ( ) ) ; return response . getEntity ( ) ; }


Input: Performs an HTTP PUT request on the { @link Endpoint#getUri () } . Sets { @link HttpHeaders#IF_MATCH } if there is a cached ETag to detect lost updates . [CODESPLIT] protected HttpResponse putContent ( HttpEntity content ) throws IOException , IllegalArgumentException , IllegalAccessException , FileNotFoundException , IllegalStateException { Request request = Request . Put ( uri ) . body ( content ) ; if ( last != null ) { request . addHeader ( HttpHeaders . IF_MATCH , last . etag ) ; } return executeAndHandle ( request ) ; }


Input: Performs an HTTP DELETE request on the { @link Endpoint#getUri () } . Sets { @link HttpHeaders#IF_MATCH } if there is a cached ETag to detect lost updates . [CODESPLIT] protected HttpResponse deleteContent ( ) throws IOException , IllegalArgumentException , IllegalAccessException , FileNotFoundException , IllegalStateException { Request request = Request . Delete ( uri ) ; if ( last != null ) { request . addHeader ( HttpHeaders . IF_MATCH , last . etag ) ; } return executeAndHandle ( request ) ; }


Input: Compare two <code > FileInformation< / code > objects . See { @link FitFilenameComparator } for more information . [CODESPLIT] @ Override public final int compare ( final T lhs , final T rhs ) { int c = compareDirectoryNames ( lhs , rhs ) ; if ( c == EQUAL ) { if ( isSetupFile ( lhs ) || isTearDownFile ( rhs ) ) { return LEFT_IS_SMALLER ; } else if ( isSetupFile ( rhs ) || isTearDownFile ( lhs ) ) { return RIGHT_IS_SMALLER ; } else { return compareFullnames ( lhs , rhs ) ; } } else if ( c <= LEFT_IS_SMALLER ) { return subCompare ( lhs , rhs ) ; } else { return - subCompare ( rhs , lhs ) ; } }


Input: Closes the SQL statement . [CODESPLIT] @ Override public void tearDown ( ) throws Exception { if ( statement != null ) { statement . close ( ) ; statement = null ; } super . tearDown ( ) ; }


Input: Generates a { @code java . sql . ResultSet } by using the saved connection . This method queries the table { @code tableName } and appends { @code where } as an optional where clause . [CODESPLIT] protected ResultSet getResultSet ( ) { if ( table == null ) { throw new IllegalArgumentException ( "missing parameter: table" ) ; } String whereClause = "" ; if ( where != null ) { whereClause = " WHERE " + where ; } try { statement = connection . createStatement ( ) ; return statement . executeQuery ( "SELECT * FROM " + table + whereClause ) ; } catch ( SQLException e ) { throw new RuntimeException ( e ) ; } }


Input: Execute post - construct on managed instance . In order to perform instance post - construction managed instance should implement { @link ManagedPostConstruct } interface . [CODESPLIT] @ Override public void postProcessInstance ( ManagedClassSPI managedClass , Object instance ) { if ( ! ( instance instanceof ManagedPostConstruct ) ) { return ; } ManagedPostConstruct managedInstance = ( ManagedPostConstruct ) instance ; log . debug ( "Post-construct managed instance |%s|" , managedInstance . getClass ( ) ) ; try { managedInstance . postConstruct ( ) ; } catch ( Throwable t ) { throw new BugError ( "Managed instance |%s| post-construct fail: %s" , instance , t ) ; } }


Input:
Closes all event streams still opened when event stream manager is destroyed . [CODESPLIT] @ Override public void preDestroy ( ) { if ( eventStreams . isEmpty ( ) ) { return ; } // EventStream#close signals stream loop that breaks
 // as a consequence, EventStreamServlet ends current request processing and call this#closeEventStream
 // this#closeEventStream removes event stream from this#eventStreams list resulting in concurrent change
 // to cope with this concurrent change uses a temporary array
 // toArray API is a little confusing for me regarding returned array
 // to be on safe side let toArray to determine array size
 // also I presume returned array is not altered by list updates
 for ( EventStream eventStream : eventStreams . toArray ( new EventStream [ 0 ] ) ) { log . debug ( "Force close stale event stream |%s|." , eventStream ) ; eventStream . close ( ) ; } }


Input: Subscribes to events stream and returns session ID . This method is remote accessible and public . It returns a session ID with a short life time for about 10 seconds . <p > This method creates a new { @link SessionID } and stores given configuration object to { @link #sessions } map with created session ID as key . Session storage is ephemere . It lasts only for { @link #SUBSCRIBE_TTL } period of time ; after that session ID becomes stale . <p > This method should be followed by { @link #createEventStream ( String ) } with returned session ID as argument . [CODESPLIT] @ Remote @ Public public String subscribe ( EventStreamConfig config ) { SessionID sessionID = new SessionID ( ) ; log . debug ( "Store event stream parameters for session |%s|." , sessionID ) ; sessions . put ( sessionID , config ) ; return sessionID . getValue ( ) ; }


Input: Enables or disabled buttons based on the Allow HTTP header . [CODESPLIT] protected void handleAllowedMethods ( ) { endpoint . isDownloadAllowed ( ) . ifPresent ( this :: setDownloadEnabled ) ; endpoint . isUploadAllowed ( ) . ifPresent ( this :: setUploadEnabled ) ; endpoint . isDeleteAllowed ( ) . ifPresent ( this :: setDeleteEnabled ) ; }


Input: Called to upload new blob data to the server . [CODESPLIT] protected void upload ( ) { try { onUpload ( ) ; eventBus . post ( new BlobUploadEvent ( endpoint ) ) ; Notification . show ( "Success" , "Upload complete" , Notification . Type . TRAY_NOTIFICATION ) ; } catch ( IOException | IllegalArgumentException | IllegalAccessException | IllegalStateException ex ) { onError ( ex ) ; } }


Input: Deletes the blob . [CODESPLIT] protected void delete ( ) { String question = "Are you sure you want to delete the data from the server?" ; ConfirmDialog . show ( getUI ( ) , question , new ConfirmDialog . Listener ( ) { @ Override public void onClose ( ConfirmDialog cd ) { if ( cd . isConfirmed ( ) ) { try { endpoint . delete ( ) ; close ( ) ; } catch ( IOException | IllegalArgumentException | IllegalAccessException | IllegalStateException ex ) { onError ( ex ) ; } catch ( RuntimeException ex ) { // Must explicitly send unhandled exceptions to error handler. // Would otherwise get swallowed silently within callback handler. getUI ( ) . getErrorHandler ( ) . error ( new com . vaadin . server . ErrorEvent ( ex ) ) ; } } } } ) ; }


Input: Parses a string and converts it into a { @code java . sql . Timestamp } object . [CODESPLIT] @ Override public final Timestamp unsafeParse ( final String s ) throws ParseException { try { return Timestamp . valueOf ( s ) ; } catch ( final IllegalArgumentException e ) { return new Timestamp ( dateFitDateHelper . parse ( s , parameter ) . getTime ( ) ) ; } }


Input: Finds an argument in an given argument list . <p > The search for an argument is case - insensitive and whitespaces at the beginning and the end are ignored . The argument s name and its value are separated by an equal sign . All these inputs will result in &quot ; world&quot ; if you look up &quot ; hello&quot ; : <p > &quot ; hello = world&quot ; &quot ; hello = world &quot ; &quot ; HeLLo = world&quot ; . < / p > <p > Note : the case of the value is unchanged . [CODESPLIT] public String getArg ( final String argName , final String defaultValue ) { if ( args == null || ! args . containsKey ( argName ) ) { return defaultValue ; } else { return validator . preProcess ( args . get ( argName ) ) ; } }


Input: Initializes the fixture arguments call { @code setUp } { @code fit . Fixture . doTable ( Parse ) } and { @code tearDown () } . [CODESPLIT] public void doTable ( FitTable table ) { copyParamsToFixture ( ) ; try { setUp ( ) ; try { doRows ( table . rows ( ) ) ; } catch ( Exception e ) { table . exception ( e ) ; } tearDown ( ) ; } catch ( final Exception e ) { table . exception ( e ) ; } table . finishExecution ( ) ; }


Input: extracts and removes parameters from a row . [CODESPLIT] protected String [ ] extractColumnParameters ( FitRow row ) { final List < String > result = new ArrayList <> ( ) ; for ( FitCell cell : row . cells ( ) ) { result . add ( FitUtils . extractCellParameter ( cell ) ) ; } return result . toArray ( new String [ result . size ( ) ] ) ; }


Input: Reads the argument list and copies all values in public members with the same name . <p > If these members do not exist the argument is skipped . You can still read the values using { @link #getArg ( String String ) } . [CODESPLIT] public void copyParamsToFixture ( ) { for ( final String fieldName : getArgNames ( ) ) { ValueReceiver valueReceiver ; try { valueReceiver = valueReceiverFactory . createReceiver ( this , fieldName ) ; } catch ( NoSuchMethodException | NoSuchFieldException e ) { continue ; } TypeHandler handler = createTypeHandler ( valueReceiver , null ) ; String fieldValueString = getArg ( fieldName , null ) ; try { Object fieldValue = handler . parse ( fieldValueString ) ; valueReceiver . set ( this , fieldValue ) ; } catch ( Exception ignored ) { } } }


Input: Returns all argument names . [CODESPLIT] protected String [ ] getArgNames ( ) { if ( args == null ) { return new String [ ] { } ; } return args . keySet ( ) . toArray ( new String [ args . keySet ( ) . size ( ) ] ) ; }


Input: Replacement of { @code check } which resolves cross - references before calling the original check method of fit . [CODESPLIT] public void check ( final FitCell cell , ValueReceiver valueReceiver , String currentCellParameter ) { validator . process ( cell , valueReceiver , currentCellParameter , typeHandlerFactory ) ; }


Input: Schedule periodic task execution . [CODESPLIT] public synchronized void period ( final PeriodicTask periodicTask , long period ) { TimerTask task = new PeriodicTaskImpl ( periodicTask ) ; this . tasks . put ( periodicTask , task ) ; this . timer . schedule ( task , 0L , period ) ; }


Input: Schedule timeout task reseting timeout period if given timeout task is already pending . [CODESPLIT] public synchronized void timeout ( final TimeoutTask timeoutTask , long timeout ) { TimerTask task = this . tasks . get ( timeoutTask ) ; if ( task != null ) { task . cancel ( ) ; this . tasks . values ( ) . remove ( task ) ; } task = new TimeoutTaskImpl ( timeoutTask ) ; this . tasks . put ( timeoutTask , task ) ; this . timer . schedule ( task , timeout ) ; }


Input: Purge task helper method . If given <code > task< / code > is not scheduled this method does nothing . [CODESPLIT] private void purgeTask ( Object task ) { TimerTask timerTask = this . tasks . get ( task ) ; if ( timerTask != null ) { timerTask . cancel ( ) ; this . tasks . values ( ) . remove ( timerTask ) ; } }


Input:
Create views meta pool from given managed view configuration object . Configuration object is described on class description . [CODESPLIT] @ Override public void config ( Config config ) throws ConfigException , IOException { for ( Config repositorySection : config . findChildren ( "repository" ) ) { // view manager configuration section is named <views>
 // a <views> configuration section has one or many <repository> child sections
 // scan every repository files accordingly files pattern and add meta views to views meta pool
 // load repository view implementation class and perform insanity checks
 String className = repositorySection . getAttribute ( "class" , DEF_IMPLEMENTATION ) ; Class < ? > implementation = Classes . forOptionalName ( className ) ; if ( implementation == null ) { throw new ConfigException ( "Unable to load view implementation |%s|." , className ) ; } if ( ! Types . isKindOf ( implementation , View . class ) ) { throw new ConfigException ( "View implementation |%s| is not of proper type." , className ) ; } if ( ! Classes . isInstantiable ( implementation ) ) { throw new ConfigException ( "View implementation |%s| is not instantiable. Ensure is not abstract or interface and have default constructor." , implementation ) ; } @ SuppressWarnings ( "unchecked" ) Class < ? extends View > viewImplementation = ( Class < ? extends View > ) implementation ; // load repository path and files pattern and create I18N repository instance
 String repositoryPath = repositorySection . getAttribute ( "path" ) ; if ( repositoryPath == null ) { throw new ConfigException ( "Invalid views repository configuration. Missing <path> attribute." ) ; } String filesPattern = repositorySection . getAttribute ( "files-pattern" ) ; if ( filesPattern == null ) { throw new ConfigException ( "Invalid views repository configuration. Missing <files-pattern> attribute." ) ; } ConfigBuilder builder = new I18nRepository . ConfigBuilder ( repositoryPath , filesPattern ) ; I18nRepository repository = new I18nRepository ( builder . build ( ) ) ; if ( viewsMetaPool == null ) { // uses first repository to initialize i18n pool
 // limitation for this solution is that all repositories should be the kind: locale sensitive or not
 viewsMetaPool = repository . getPoolInstance ( ) ; } Properties properties = repositorySection . getProperties ( ) ; // traverses all files from I18N repository instance and register view meta instance
 // builder is used by view meta to load the document template
 for ( I18nFile template : repository ) { ViewMeta meta = new ViewMeta ( template . getFile ( ) , viewImplementation , properties ) ; if ( viewsMetaPool . put ( meta . getName ( ) , meta , template . getLocale ( ) ) ) { log . warn ( "Override view |%s|" , meta ) ; } else { log . debug ( "Register view |%s|" , meta ) ; } } } }


Input: Create view instance based on view meta data identified by name and request locale . View instance is created from view implementation class - { @link ViewMeta#getImplementation () } . [CODESPLIT] @ Override public View getView ( String viewName ) { RequestContext context = Factory . getInstance ( RequestContext . class ) ; ViewMeta meta = viewsMetaPool . get ( viewName , context . getLocale ( ) ) ; if ( meta == null ) { throw new BugError ( "View |%s| not found. View name may be misspelled, forgot to add template file or template name doesn't match views files pattern." , viewName ) ; } AbstractView view = ( AbstractView ) Classes . newInstance ( meta . getImplementation ( ) ) ; view . setMeta ( meta ) ; return view ; }


Input: Returns <code > true< / code > if the iteration has more elements . ( In other words returns <code > true< / code > if <code > next< / code > would return an element rather than throwing an exception . ) [CODESPLIT] @ Override public final boolean hasNext ( ) { if ( files == null ) { return false ; } else if ( fileIndex < files . length ) { return true ; } else { return cacheNext ( ) ; } }


Input: Returns the next matching file . [CODESPLIT] @ Override public final File next ( ) { if ( files == null || fileIndex >= files . length ) { if ( ! cacheNext ( ) ) { throw new NoSuchElementException ( ) ; } } return files [ fileIndex ++ ] ; }


Input: Reads the given parameters and initializes the values of { @link #getEncoding () } and { @link #getFile () } . [CODESPLIT] @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; FileFixtureHelper helper = DependencyManager . getOrCreate ( FileFixtureHelper . class ) ; if ( encoding == null ) { encoding = helper . getEncoding ( ) ; } String fileName = getArg ( "file" ) ; if ( fileName == null ) { File provider = helper . getDirectory ( ) ; String dir = getArg ( "dir" ) ; if ( dir != null ) { provider = new File ( dir ) ; } if ( provider == null ) { throw new RuntimeException ( "No directory selected" ) ; } String pattern = helper . getPattern ( ) ; pattern = getArg ( "pattern" , pattern ) ; FileSelector fs = new FileSelector ( provider , pattern ) ; file = wrapper . wrap ( fs . getFirstFile ( ) ) ; } else { file = wrapper . wrap ( new File ( fileName ) . getAbsoluteFile ( ) ) ; } }


Input: Parses the first table row and generates an { @code int } array which contains the length of each record field . [CODESPLIT] public final int [ ] extractWidth ( FitRow row ) { int [ ] width = new int [ row . size ( ) ] ; int i = 0 ; for ( FitCell cell : row . cells ( ) ) { try { String value = validator . preProcess ( cell . getFitValue ( ) ) ; TypeHandler handler = typeHandlerFactory . getHandler ( Integer . class , null ) ; width [ i ++ ] = ( Integer ) handler . parse ( value ) ; } catch ( Exception e ) { cell . exception ( e ) ; return null ; } } return width ; }


Input: Sets the database username to { @code userName } . The username can be received using { @link SetupHelper#getUser () } . [CODESPLIT] public void user ( final String userName ) { SetupHelper helper = DependencyManager . getOrCreate ( SetupHelper . class ) ; helper . setUser ( userName ) ; }


Input: Sets the database password to { @code password } . The password can be received using { @link SetupHelper#getPassword () } . [CODESPLIT] public void password ( final String password ) { SetupHelper helper = DependencyManager . getOrCreate ( SetupHelper . class ) ; helper . setPassword ( password ) ; }


Input: Sets the database connection string to { @code uri } . The connection string can be received using { @link SetupHelper#getConnectionString () } . [CODESPLIT] public void connectionString ( final String uri ) { SetupHelper helper = DependencyManager . getOrCreate ( SetupHelper . class ) ; helper . setConnectionString ( uri ) ; }


Input: Configure Simple CAPTCHA service provider . See class description for configuration object properties . <p > Note that images repository should contain only images related to CAPTCHA ; sub - directories are not scanned only direct child files . [CODESPLIT] @ Override public void config ( Config config ) throws ConfigException { imagesRepositoryDir = config . getProperty ( "captcha.repository.path" , File . class ) ; if ( imagesRepositoryDir == null ) { throw new ConfigException ( "Missing <captcha.repository.path> property from CAPTCHA configuration." ) ; } challengeSetSize = config . getProperty ( "captcha.set.size" , int . class , 6 ) ; if ( ! imagesRepositoryDir . exists ( ) ) { throw new ConfigException ( "CAPTCHA images repository |%s| does not exist." , imagesRepositoryDir ) ; } if ( ! imagesRepositoryDir . isDirectory ( ) ) { throw new ConfigException ( "CAPTCHA images repository |%s| is not a directory." , imagesRepositoryDir ) ; } if ( ! imagesRepositoryDir . isAbsolute ( ) ) { throw new ConfigException ( "CAPTCHA images repository |%s| is not absolute path." , imagesRepositoryDir ) ; } int imagesCount = imagesRepositoryDir . list ( ) . length ; if ( imagesCount == 0 ) { throw new ConfigException ( "CAPTCHA images repository |%s| is empty." , imagesRepositoryDir ) ; } if ( imagesCount <= challengeSetSize ) { throw new ConfigException ( "Challenge set size is larger that avaliable images count from CAPTCHA repository." ) ; } }


Input:
Create a new challenge and store it on HTTP session . If HTTP session does not exist create it . This challenge is used by client to update user interface accordingly . It is called on initial form rendering and every time user choose to load another challenge if current one cannot be solved . <p > Client is free to display multiple Simple CAPTCHA instances but all instances should have distinct index generated in sequence starting from zero . [CODESPLIT] @ Remote public Challenge getChallenge ( int captchaIndex ) { if ( imagesRepositoryDir == null ) { log . debug ( "Simple CAPTCHA not properly initialized. Missing <captcha> section from application descriptor:\r\n" + //
 "\t<captcha>\r\n" + //
 "\t\t<property name=\"captcha.repository.path\" value=\"/path/to/captcha/images\" />\r\n" + //
 "\t\t<property name=\"captcha.set.size\" value=\"5\" />\r\n" + //
 "\t</captcha>" ) ; throw new BugError ( "Missing CAPTCHA images repository. Most probably <captcha> section is missing from application descriptor." ) ; } Challenge challenge = new Challenge ( imagesRepositoryDir , challengeSetSize ) ; getChallenges ( ) . put ( captchaIndex , challenge ) ; return challenge ; }


Input: Verify challenge response . If response is not correct returns a new challenge used by client to update user interface . It is highly recommended to refresh challenge on wrong answer to prevent response guessing . <p > Instance index should be the same provided to { @link #getChallenge ( int ) } . This is critical and client should consider this constrain . Anyway using wrong CAPTCHA instance index is not a security breach ; it always consider response as invalid . [CODESPLIT] @ Remote public Challenge verifyResponse ( int captchaIndex , String challengeResponse ) throws IllegalArgumentException , IllegalStateException { Params . notNullOrEmpty ( challengeResponse , "Challenge response" ) ; Challenge challenge = getChallenges ( ) . get ( captchaIndex ) ; if ( challenge == null ) { throw new IllegalStateException ( "Invalid challenge on session." ) ; } return challenge . verifyResponse ( challengeResponse ) ? null : getChallenge ( captchaIndex ) ; }


Input: Get the image identified by given token so that client is able to display it . In order to protect against recording attack a challenge image is identified by a token that is valid only once . <p > If given token does not identify a valid challenge image this method throws { @link NoSuchResourceException } and container responds with 404 Not Found . [CODESPLIT] @ Remote @ RequestPath ( "image" ) public Resource getImage ( String token ) throws IllegalArgumentException , NoSuchResourceException { Params . notNullOrEmpty ( token , "Image token" ) ; for ( Challenge challenge : getChallenges ( ) . values ( ) ) { File image = challenge . getImage ( token ) ; if ( image != null ) { return new FileResource ( image ) ; } } throw new NoSuchResourceException ( ) ; }


Input:
Get challenge instances storage bound to current HTTP request . Challenges storage is kept on HTTP session . It is legal to have multiple Simple CAPTCHA instances on a single page but client should use zero based numeric index to identify instances . <p > This method has side effects : it creates HTTP session if is not already created . [CODESPLIT] private Map < Integer , Challenge > getChallenges ( ) { // here is a circular package dependency that is hard to avoid
 // js.servlet package depends on js.http packages and this js.http.captcha package depends on js.servlet
 // as a consequence js.http.captcha package cannot be used externally without js.servlet
 HttpSession session = context . getInstance ( RequestContext . class ) . getSession ( true ) ; @ SuppressWarnings ( "unchecked" ) Map < Integer , Challenge > challenges = ( Map < Integer , Challenge > ) session . getAttribute ( CHALENGES_KEY ) ; if ( challenges == null ) { challenges = new HashMap <> ( ) ; session . setAttribute ( CHALENGES_KEY , challenges ) ; } return challenges ; }


Input: Configures the application . [CODESPLIT] private static void configureApplication ( ) { // Try to load the file. File file = new File ( "chameria.props" ) ; if ( file . exists ( ) ) { Properties props = new Properties ( ) ; InputStream is = null ; try { is = new FileInputStream ( file ) ; props . load ( is ) ; String n = props . getProperty ( "application.name" ) ; if ( n != null ) { QApplication . setApplicationName ( n ) ; } else { QApplication . setApplicationName ( "akquinet ChameRIA" ) ; } n = props . getProperty ( "application.version" ) ; if ( n != null ) { QApplication . setApplicationVersion ( n ) ; } n = props . getProperty ( "application.icon" ) ; if ( n != null ) { QIcon icon = new QIcon ( n ) ; QApplication . setWindowIcon ( icon ) ; } } catch ( Exception e ) { System . err . println ( "Cannot read the application configuration " + e . getMessage ( ) ) ; e . printStackTrace ( ) ; } finally { if ( is != null ) { try { is . close ( ) ; } catch ( IOException e ) { // Ignored } } } } QApplication . setOrganizationName ( "akquinet A.G." ) ; }


Input: Prints Welcome Banner . [CODESPLIT] private static void printWelcomeBanner ( ) { StringBuffer banner = new StringBuffer ( ) ; banner . append ( "\n" ) ; banner . append ( "\t============================\n" ) ; banner . append ( "\t|                          |\n" ) ; banner . append ( "\t|   Welcome to ChameRIA    |\n" ) ; banner . append ( "\t|                          |\n" ) ; banner . append ( "\t============================\n" ) ; banner . append ( "\n" ) ; System . out . println ( banner ) ; }


Input: Prints Stopped Banner . [CODESPLIT] private static void printStoppedBanner ( ) { System . out . println ( "\n" ) ; System . out . println ( "\t=========================" ) ; System . out . println ( "\t|   ChameRIA  stopped   |" ) ; System . out . println ( "\t=========================" ) ; System . out . println ( "\n" ) ; }


Input: Creates the Chameleon instance . The instance is not started . [CODESPLIT] public static ChameRIA createChameleon ( String [ ] args ) throws Exception { boolean debug = isDebugModeEnabled ( args ) ; String core = getCore ( args ) ; String app = getApp ( args ) ; String runtime = getRuntime ( args ) ; String fileinstall = getDeployDirectory ( args ) ; String config = getProps ( args ) ; if ( config == null || ! new File ( config ) . exists ( ) ) { return new ChameRIA ( core , debug , app , runtime , fileinstall , null ) ; } else { return new ChameRIA ( core , debug , app , runtime , fileinstall , config ) ; } }


Input: Parses the -- deploy parameter . [CODESPLIT] private static String getDeployDirectory ( String [ ] args ) { for ( int i = 0 ; i < args . length ; i ++ ) { String arg = args [ i ] ; if ( StringUtils . contains ( arg , "--deploy=" ) ) { return arg . substring ( "--deploy=" . length ( ) ) ; } } return null ; }


Input: Registers a shutdown hook to stop nicely the embedded framework . [CODESPLIT] private static void registerShutdownHook ( final ChameRIA chameleon ) { Runtime runtime = Runtime . getRuntime ( ) ; Runnable hook = new Runnable ( ) { public void run ( ) { try { if ( chameleon != null ) { chameleon . stop ( ) ; printStoppedBanner ( ) ; } } catch ( BundleException e ) { System . err . println ( "Cannot stop Chameleon correctly : " + e . getMessage ( ) ) ; } catch ( InterruptedException e ) { System . err . println ( "Unexpected Exception : " + e . getMessage ( ) ) ; // nothing to do } } } ; runtime . addShutdownHook ( new Thread ( hook ) ) ; }


Input: Parses the -- debug parameter . [CODESPLIT] private static boolean isDebugModeEnabled ( String [ ] args ) { for ( int i = 0 ; i < args . length ; i ++ ) { String arg = args [ i ] ; if ( arg . equalsIgnoreCase ( "--debug" ) ) { return true ; } } return false ; }


Input: Traversal //////////////////////////////// [CODESPLIT] @ Override protected void doRow ( FitRow row ) throws Exception { currentCellParameter = FitUtils . extractCellParameter ( row . cells ( ) . get ( 0 ) ) ; this . row = row ; super . doRow ( row ) ; }


Input: Actions ////////////////////////////////// [CODESPLIT] public void start ( ) throws Exception { actor = Class . forName ( row . cells ( ) . get ( 1 ) . getFitValue ( ) ) . newInstance ( ) ; }


Input: Utility ////////////////////////////////// [CODESPLIT] protected Method method ( int args ) throws NoSuchMethodException { return method ( FitUtils . camel ( row . cells ( ) . get ( 1 ) . getFitValue ( ) ) , args ) ; }


Input: Waits until a method returns true . The command takes a method name without parameters and a return value of { @code Boolean } as the first parameter and a timeout in ms as the second parameter . <br > The method is called every { @code sleepTime } ms until it returns true or the timeout is exceeded . [CODESPLIT] public void waitFor ( ) throws ParseException , NoSuchMethodException { Method method = method ( 0 ) ; long maxTime = parse ( Long . class , row . cells ( ) . get ( 2 ) . getFitValue ( ) ) ; long sleepTime = getSleepTime ( ) ; waitForResult . wait ( actor , method , maxTime , sleepTime ) ; writeResultIntoCell ( waitForResult ) ; }


Input: Transforms the selected row into an &quot ; enter&quot ; command and reinterprets it . <p > Example : Row content : { @code setEncoding | utf - 8 } <br > Code in the fixture : { @code public void setEncoding () throws Exception { transformAndEnter () ; } } <p > { @code public void setEncoding ( String encoding ) { // do stuff with encoding here } } [CODESPLIT] protected final void transformAndEnter ( ) throws Exception { FitCell cell = row . insert ( 0 ) ; cell . setFitValue ( "enter" ) ; Object oldActor = actor ; actor = this ; enter ( ) ; actor = oldActor ; row . remove ( 0 ) ; }


Input: Triggers the action . [CODESPLIT] public void trigger ( ) { try { onTrigger ( ) ; Notification . show ( getCaption ( ) , "Successful." , Notification . Type . TRAY_NOTIFICATION ) ; } catch ( IOException | IllegalArgumentException | IllegalAccessException | IllegalStateException ex ) { onError ( ex ) ; } }


Input: Handler for triggering the action . [CODESPLIT] protected void onTrigger ( ) throws IOException , IllegalArgumentException , IllegalAccessException , FileNotFoundException , IllegalStateException { endpoint . trigger ( ) ; eventBus . post ( new TriggerEvent ( endpoint ) ) ; }


Input: Gets the first matching event which matches { @link #matches ( LoggingEvent ) } and the given parameters . [CODESPLIT] public final LoggingEvent getFirstMatchingEvent ( final LoggingEvent [ ] events , final Map < String , String > parameters ) { for ( LoggingEvent event : events ) { if ( matchesParameters ( event , parameters ) && matches ( event ) ) { return event ; } } return null ; }


Input: Replaces a row with one or more results . [CODESPLIT] public void insertAndReplace ( final FitRow row ) { if ( results . isEmpty ( ) ) { return ; } int index = row . getIndex ( ) ; FitTable table = row . getTable ( ) ; table . remove ( index ) ; addRows ( table , index ) ; }


Input: Gets the sum of all results . [CODESPLIT] public Counts getCounts ( ) { Counts counts = new Counts ( ) ; for ( FileCount fileCount : results ) { counts . tally ( fileCount . getCounts ( ) ) ; } return counts ; }


Input: Sets the locale value to { @code locale } . [CODESPLIT] public void locale ( final String locale ) { FitDateHelper helper = DependencyManager . getOrCreate ( FitDateHelper . class ) ; helper . setLocale ( locale ) ; }


Input: Sets the format value to { @code format } . [CODESPLIT] public void format ( final String format ) { FitDateHelper helper = DependencyManager . getOrCreate ( FitDateHelper . class ) ; helper . setFormat ( format ) ; }


Input: setter for score - sets The score associated with the answer . [CODESPLIT] public void setScore ( double v ) { if ( Summary_Type . featOkTst && ( ( Summary_Type ) jcasType ) . casFeat_score == null ) jcasType . jcas . throwFeatMissing ( "score" , "edu.cmu.lti.oaqa.type.answer.Summary" ) ; jcasType . ll_cas . ll_setDoubleValue ( addr , ( ( Summary_Type ) jcasType ) . casFeatCode_score , v ) ; }


Input: getter for variants - gets List of alternative answer summaries . [CODESPLIT] public StringList getVariants ( ) { if ( Summary_Type . featOkTst && ( ( Summary_Type ) jcasType ) . casFeat_variants == null ) jcasType . jcas . throwFeatMissing ( "variants" , "edu.cmu.lti.oaqa.type.answer.Summary" ) ; return ( StringList ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Summary_Type ) jcasType ) . casFeatCode_variants ) ) ) ; }


Input: setter for variants - sets List of alternative answer summaries . [CODESPLIT] public void setVariants ( StringList v ) { if ( Summary_Type . featOkTst && ( ( Summary_Type ) jcasType ) . casFeat_variants == null ) jcasType . jcas . throwFeatMissing ( "variants" , "edu.cmu.lti.oaqa.type.answer.Summary" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Summary_Type ) jcasType ) . casFeatCode_variants , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }


Input: getter for questionType - gets The class of the question determined by either an automatic question classification process or human judgment . [CODESPLIT] public String getQuestionType ( ) { if ( Question_Type . featOkTst && ( ( Question_Type ) jcasType ) . casFeat_questionType == null ) jcasType . jcas . throwFeatMissing ( "questionType" , "edu.cmu.lti.oaqa.type.input.Question" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Question_Type ) jcasType ) . casFeatCode_questionType ) ; }


Input: setter for questionType - sets The class of the question determined by either an automatic question classification process or human judgment . [CODESPLIT] public void setQuestionType ( String v ) { if ( Question_Type . featOkTst && ( ( Question_Type ) jcasType ) . casFeat_questionType == null ) jcasType . jcas . throwFeatMissing ( "questionType" , "edu.cmu.lti.oaqa.type.input.Question" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Question_Type ) jcasType ) . casFeatCode_questionType , v ) ; }


Input: } [CODESPLIT] public void registered ( ResteasyProviderFactory factory ) { System . out . println ( "registered - factory = " + factory ) ; ResourceConstructor constructor = this . resourceClass . getConstructor ( ) ; if ( constructor == null ) { final Class < ? > clazz = this . resourceClass . getClazz ( ) ; final Class < ? > aClass = DI . getSubTypesWithoutInterfacesAndGeneratedOf ( clazz ) . stream ( ) . findFirst ( ) . get ( ) ; constructor = ResourceBuilder . constructor ( aClass ) ; } // if ( constructor == null ) { throw new RuntimeException ( Messages . MESSAGES . unableToFindPublicConstructorForClass ( this . scannableClass . getName ( ) ) ) ; } else { this . constructorInjector = factory . getInjectorFactory ( ) . createConstructor ( constructor , factory ) ; this . propertyInjector = factory . getInjectorFactory ( ) . createPropertyInjector ( this . resourceClass , factory ) ; } }


Input: getter for token - gets The corresponding token for the focus . [CODESPLIT] public Token getToken ( ) { if ( Focus_Type . featOkTst && ( ( Focus_Type ) jcasType ) . casFeat_token == null ) jcasType . jcas . throwFeatMissing ( "token" , "edu.cmu.lti.oaqa.type.nlp.Focus" ) ; return ( Token ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Focus_Type ) jcasType ) . casFeatCode_token ) ) ) ; }


Input: getter for depLabel - gets The dependency label of the token with respect to its head . [CODESPLIT] public String getDepLabel ( ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_depLabel == null ) jcasType . jcas . throwFeatMissing ( "depLabel" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_depLabel ) ; }


Input: setter for depLabel - sets The dependency label of the token with respect to its head . [CODESPLIT] public void setDepLabel ( String v ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_depLabel == null ) jcasType . jcas . throwFeatMissing ( "depLabel" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_depLabel , v ) ; }


Input: getter for semanticType - gets A semantic type typically the name of an Entity Annotation type . [CODESPLIT] public String getSemanticType ( ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_semanticType == null ) jcasType . jcas . throwFeatMissing ( "semanticType" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_semanticType ) ; }


Input: setter for semanticType - sets A semantic type typically the name of an Entity Annotation type . [CODESPLIT] public void setSemanticType ( String v ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_semanticType == null ) jcasType . jcas . throwFeatMissing ( "semanticType" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_semanticType , v ) ; }


Input: getter for partOfSpeech - gets Coarse - grained part of speech . --- Example : noun verb adj cord [CODESPLIT] public String getPartOfSpeech ( ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_partOfSpeech == null ) jcasType . jcas . throwFeatMissing ( "partOfSpeech" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_partOfSpeech ) ; }


Input: setter for partOfSpeech - sets Coarse - grained part of speech . --- Example : noun verb adj cord [CODESPLIT] public void setPartOfSpeech ( String v ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_partOfSpeech == null ) jcasType . jcas . throwFeatMissing ( "partOfSpeech" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_partOfSpeech , v ) ; }


Input: getter for lemmaForm - gets A canonical / lemmatized form of the covered text . [CODESPLIT] public String getLemmaForm ( ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_lemmaForm == null ) jcasType . jcas . throwFeatMissing ( "lemmaForm" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_lemmaForm ) ; }


Input: setter for lemmaForm - sets A canonical / lemmatized form of the covered text . [CODESPLIT] public void setLemmaForm ( String v ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_lemmaForm == null ) jcasType . jcas . throwFeatMissing ( "lemmaForm" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_lemmaForm , v ) ; }


Input: getter for isMainReference - gets If true then this is the main reference to the first argument . Modifiers and anaphoric references do not have isMainReference set . --- Example : A dark blue [ hat ] [CODESPLIT] public boolean getIsMainReference ( ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_isMainReference == null ) jcasType . jcas . throwFeatMissing ( "isMainReference" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; return jcasType . ll_cas . ll_getBooleanValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_isMainReference ) ; }


Input: setter for isMainReference - sets If true then this is the main reference to the first argument . Modifiers and anaphoric references do not have isMainReference set . --- Example : A dark blue [ hat ] [CODESPLIT] public void setIsMainReference ( boolean v ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_isMainReference == null ) jcasType . jcas . throwFeatMissing ( "isMainReference" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; jcasType . ll_cas . ll_setBooleanValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_isMainReference , v ) ; }


Input: getter for isVariable - gets True iff the token expresses some unknown entity typically the focus of a question : --- Example : [ Who ] shot JR? What [ city ] was JR born in? [CODESPLIT] public boolean getIsVariable ( ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_isVariable == null ) jcasType . jcas . throwFeatMissing ( "isVariable" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; return jcasType . ll_cas . ll_getBooleanValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_isVariable ) ; }


Input: setter for isVariable - sets True iff the token expresses some unknown entity typically the focus of a question : --- Example : [ Who ] shot JR? What [ city ] was JR born in? [CODESPLIT] public void setIsVariable ( boolean v ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_isVariable == null ) jcasType . jcas . throwFeatMissing ( "isVariable" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; jcasType . ll_cas . ll_setBooleanValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_isVariable , v ) ; }


Input: getter for determiner - gets The determiner attached to the node if any --- Example : [ the ] book [CODESPLIT] public String getDeterminer ( ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_determiner == null ) jcasType . jcas . throwFeatMissing ( "determiner" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_determiner ) ; }


Input: setter for determiner - sets The determiner attached to the node if any --- Example : [ the ] book [CODESPLIT] public void setDeterminer ( String v ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_determiner == null ) jcasType . jcas . throwFeatMissing ( "determiner" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_determiner , v ) ; }


Input: getter for sections - gets Content of sections in the document . [CODESPLIT] public StringArray getSections ( ) { if ( Document_Type . featOkTst && ( ( Document_Type ) jcasType ) . casFeat_sections == null ) jcasType . jcas . throwFeatMissing ( "sections" , "edu.cmu.lti.oaqa.type.retrieval.Document" ) ; return ( StringArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Document_Type ) jcasType ) . casFeatCode_sections ) ) ) ; }


Input: setter for sections - sets Content of sections in the document . [CODESPLIT] public void setSections ( StringArray v ) { if ( Document_Type . featOkTst && ( ( Document_Type ) jcasType ) . casFeat_sections == null ) jcasType . jcas . throwFeatMissing ( "sections" , "edu.cmu.lti.oaqa.type.retrieval.Document" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Document_Type ) jcasType ) . casFeatCode_sections , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }


Input: indexed getter for sections - gets an indexed value - Content of sections in the document . [CODESPLIT] public String getSections ( int i ) { if ( Document_Type . featOkTst && ( ( Document_Type ) jcasType ) . casFeat_sections == null ) jcasType . jcas . throwFeatMissing ( "sections" , "edu.cmu.lti.oaqa.type.retrieval.Document" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Document_Type ) jcasType ) . casFeatCode_sections ) , i ) ; return jcasType . ll_cas . ll_getStringArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Document_Type ) jcasType ) . casFeatCode_sections ) , i ) ; }


Input: indexed setter for sections - sets an indexed value - Content of sections in the document . [CODESPLIT] public void setSections ( int i , String v ) { if ( Document_Type . featOkTst && ( ( Document_Type ) jcasType ) . casFeat_sections == null ) jcasType . jcas . throwFeatMissing ( "sections" , "edu.cmu.lti.oaqa.type.retrieval.Document" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Document_Type ) jcasType ) . casFeatCode_sections ) , i ) ; jcasType . ll_cas . ll_setStringArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Document_Type ) jcasType ) . casFeatCode_sections ) , i , v ) ; }


Input: getter for sectionLabels - gets Section labels in the document e . g . sections . 0 sections1 etc . [CODESPLIT] public StringArray getSectionLabels ( ) { if ( Document_Type . featOkTst && ( ( Document_Type ) jcasType ) . casFeat_sectionLabels == null ) jcasType . jcas . throwFeatMissing ( "sectionLabels" , "edu.cmu.lti.oaqa.type.retrieval.Document" ) ; return ( StringArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Document_Type ) jcasType ) . casFeatCode_sectionLabels ) ) ) ; }


Input: setter for sectionLabels - sets Section labels in the document e . g . sections . 0 sections1 etc . [CODESPLIT] public void setSectionLabels ( StringArray v ) { if ( Document_Type . featOkTst && ( ( Document_Type ) jcasType ) . casFeat_sectionLabels == null ) jcasType . jcas . throwFeatMissing ( "sectionLabels" , "edu.cmu.lti.oaqa.type.retrieval.Document" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Document_Type ) jcasType ) . casFeatCode_sectionLabels , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }


Input: indexed getter for sectionLabels - gets an indexed value - Section labels in the document e . g . sections . 0 sections1 etc . [CODESPLIT] public String getSectionLabels ( int i ) { if ( Document_Type . featOkTst && ( ( Document_Type ) jcasType ) . casFeat_sectionLabels == null ) jcasType . jcas . throwFeatMissing ( "sectionLabels" , "edu.cmu.lti.oaqa.type.retrieval.Document" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Document_Type ) jcasType ) . casFeatCode_sectionLabels ) , i ) ; return jcasType . ll_cas . ll_getStringArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Document_Type ) jcasType ) . casFeatCode_sectionLabels ) , i ) ; }


Input: indexed setter for sectionLabels - sets an indexed value - Section labels in the document e . g . sections . 0 sections1 etc . [CODESPLIT] public void setSectionLabels ( int i , String v ) { if ( Document_Type . featOkTst && ( ( Document_Type ) jcasType ) . casFeat_sectionLabels == null ) jcasType . jcas . throwFeatMissing ( "sectionLabels" , "edu.cmu.lti.oaqa.type.retrieval.Document" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Document_Type ) jcasType ) . casFeatCode_sectionLabels ) , i ) ; jcasType . ll_cas . ll_setStringArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Document_Type ) jcasType ) . casFeatCode_sectionLabels ) , i , v ) ; }


Input: getter for names - gets All name variants ( preferred / default name synonyms lexicial variants etc ) of the concept . [CODESPLIT] public StringList getNames ( ) { if ( Concept_Type . featOkTst && ( ( Concept_Type ) jcasType ) . casFeat_names == null ) jcasType . jcas . throwFeatMissing ( "names" , "edu.cmu.lti.oaqa.type.kb.Concept" ) ; return ( StringList ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Concept_Type ) jcasType ) . casFeatCode_names ) ) ) ; }


Input: getter for uris - gets Array of uris that identify this named entity . There may be more than one uri if this named entity is ambiguous . [CODESPLIT] public StringList getUris ( ) { if ( Concept_Type . featOkTst && ( ( Concept_Type ) jcasType ) . casFeat_uris == null ) jcasType . jcas . throwFeatMissing ( "uris" , "edu.cmu.lti.oaqa.type.kb.Concept" ) ; return ( StringList ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Concept_Type ) jcasType ) . casFeatCode_uris ) ) ) ; }


Input: setter for uris - sets Array of uris that identify this named entity . There may be more than one uri if this named entity is ambiguous . [CODESPLIT] public void setUris ( StringList v ) { if ( Concept_Type . featOkTst && ( ( Concept_Type ) jcasType ) . casFeat_uris == null ) jcasType . jcas . throwFeatMissing ( "uris" , "edu.cmu.lti.oaqa.type.kb.Concept" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Concept_Type ) jcasType ) . casFeatCode_uris , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }


Input: getter for ids - gets A list of IDs ( e . g . UI in UMLS ) associated with this concept . [CODESPLIT] public StringList getIds ( ) { if ( Concept_Type . featOkTst && ( ( Concept_Type ) jcasType ) . casFeat_ids == null ) jcasType . jcas . throwFeatMissing ( "ids" , "edu.cmu.lti.oaqa.type.kb.Concept" ) ; return ( StringList ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Concept_Type ) jcasType ) . casFeatCode_ids ) ) ) ; }


Input: setter for ids - sets A list of IDs ( e . g . UI in UMLS ) associated with this concept . [CODESPLIT] public void setIds ( StringList v ) { if ( Concept_Type . featOkTst && ( ( Concept_Type ) jcasType ) . casFeat_ids == null ) jcasType . jcas . throwFeatMissing ( "ids" , "edu.cmu.lti.oaqa.type.kb.Concept" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Concept_Type ) jcasType ) . casFeatCode_ids , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }


Input: getter for mentions - gets A list of ConceptMentions ( text spans ) that might be surface forms to this concept . [CODESPLIT] public FSList getMentions ( ) { if ( Concept_Type . featOkTst && ( ( Concept_Type ) jcasType ) . casFeat_mentions == null ) jcasType . jcas . throwFeatMissing ( "mentions" , "edu.cmu.lti.oaqa.type.kb.Concept" ) ; return ( FSList ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Concept_Type ) jcasType ) . casFeatCode_mentions ) ) ) ; }


Input: setter for mentions - sets A list of ConceptMentions ( text spans ) that might be surface forms to this concept . [CODESPLIT] public void setMentions ( FSList v ) { if ( Concept_Type . featOkTst && ( ( Concept_Type ) jcasType ) . casFeat_mentions == null ) jcasType . jcas . throwFeatMissing ( "mentions" , "edu.cmu.lti.oaqa.type.kb.Concept" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Concept_Type ) jcasType ) . casFeatCode_mentions , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }


Input: getter for types - gets A list of concept types that the concept belongs to . [CODESPLIT] public FSList getTypes ( ) { if ( Concept_Type . featOkTst && ( ( Concept_Type ) jcasType ) . casFeat_types == null ) jcasType . jcas . throwFeatMissing ( "types" , "edu.cmu.lti.oaqa.type.kb.Concept" ) ; return ( FSList ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Concept_Type ) jcasType ) . casFeatCode_types ) ) ) ; }


Input: setter for types - sets A list of concept types that the concept belongs to . [CODESPLIT] public void setTypes ( FSList v ) { if ( Concept_Type . featOkTst && ( ( Concept_Type ) jcasType ) . casFeat_types == null ) jcasType . jcas . throwFeatMissing ( "types" , "edu.cmu.lti.oaqa.type.kb.Concept" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Concept_Type ) jcasType ) . casFeatCode_types , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }


Input: getter for targetType - gets The actual target type annotation . [CODESPLIT] public Annotation getTargetType ( ) { if ( AnswerType_Type . featOkTst && ( ( AnswerType_Type ) jcasType ) . casFeat_targetType == null ) jcasType . jcas . throwFeatMissing ( "targetType" , "edu.cmu.lti.oaqa.type.answer.AnswerType" ) ; return ( Annotation ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( AnswerType_Type ) jcasType ) . casFeatCode_targetType ) ) ) ; }


Input: setter for targetType - sets The actual target type annotation . [CODESPLIT] public void setTargetType ( Annotation v ) { if ( AnswerType_Type . featOkTst && ( ( AnswerType_Type ) jcasType ) . casFeat_targetType == null ) jcasType . jcas . throwFeatMissing ( "targetType" , "edu.cmu.lti.oaqa.type.answer.AnswerType" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( AnswerType_Type ) jcasType ) . casFeatCode_targetType , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }


Input: getter for rank - gets Rank of this result in the original hit - list . [CODESPLIT] public int getRank ( ) { if ( SearchResult_Type . featOkTst && ( ( SearchResult_Type ) jcasType ) . casFeat_rank == null ) jcasType . jcas . throwFeatMissing ( "rank" , "edu.cmu.lti.oaqa.type.retrieval.SearchResult" ) ; return jcasType . ll_cas . ll_getIntValue ( addr , ( ( SearchResult_Type ) jcasType ) . casFeatCode_rank ) ; }


Input: setter for rank - sets Rank of this result in the original hit - list . [CODESPLIT] public void setRank ( int v ) { if ( SearchResult_Type . featOkTst && ( ( SearchResult_Type ) jcasType ) . casFeat_rank == null ) jcasType . jcas . throwFeatMissing ( "rank" , "edu.cmu.lti.oaqa.type.retrieval.SearchResult" ) ; jcasType . ll_cas . ll_setIntValue ( addr , ( ( SearchResult_Type ) jcasType ) . casFeatCode_rank , v ) ; }


Input: getter for queryString - gets The query string associated with the hit . [CODESPLIT] public String getQueryString ( ) { if ( SearchResult_Type . featOkTst && ( ( SearchResult_Type ) jcasType ) . casFeat_queryString == null ) jcasType . jcas . throwFeatMissing ( "queryString" , "edu.cmu.lti.oaqa.type.retrieval.SearchResult" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( SearchResult_Type ) jcasType ) . casFeatCode_queryString ) ; }


Input: setter for queryString - sets The query string associated with the hit . [CODESPLIT] public void setQueryString ( String v ) { if ( SearchResult_Type . featOkTst && ( ( SearchResult_Type ) jcasType ) . casFeat_queryString == null ) jcasType . jcas . throwFeatMissing ( "queryString" , "edu.cmu.lti.oaqa.type.retrieval.SearchResult" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( SearchResult_Type ) jcasType ) . casFeatCode_queryString , v ) ; }


Input: getter for candidateAnswers - gets CandidateAnswerVariants generated from this SearchResult . [CODESPLIT] public FSArray getCandidateAnswers ( ) { if ( SearchResult_Type . featOkTst && ( ( SearchResult_Type ) jcasType ) . casFeat_candidateAnswers == null ) jcasType . jcas . throwFeatMissing ( "candidateAnswers" , "edu.cmu.lti.oaqa.type.retrieval.SearchResult" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( SearchResult_Type ) jcasType ) . casFeatCode_candidateAnswers ) ) ) ; }


Input: setter for candidateAnswers - sets CandidateAnswerVariants generated from this SearchResult . [CODESPLIT] public void setCandidateAnswers ( FSArray v ) { if ( SearchResult_Type . featOkTst && ( ( SearchResult_Type ) jcasType ) . casFeat_candidateAnswers == null ) jcasType . jcas . throwFeatMissing ( "candidateAnswers" , "edu.cmu.lti.oaqa.type.retrieval.SearchResult" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( SearchResult_Type ) jcasType ) . casFeatCode_candidateAnswers , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }


Input: indexed getter for candidateAnswers - gets an indexed value - CandidateAnswerVariants generated from this SearchResult . [CODESPLIT] public CandidateAnswerVariant getCandidateAnswers ( int i ) { if ( SearchResult_Type . featOkTst && ( ( SearchResult_Type ) jcasType ) . casFeat_candidateAnswers == null ) jcasType . jcas . throwFeatMissing ( "candidateAnswers" , "edu.cmu.lti.oaqa.type.retrieval.SearchResult" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( SearchResult_Type ) jcasType ) . casFeatCode_candidateAnswers ) , i ) ; return ( CandidateAnswerVariant ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( SearchResult_Type ) jcasType ) . casFeatCode_candidateAnswers ) , i ) ) ) ; }


Input: indexed setter for candidateAnswers - sets an indexed value - CandidateAnswerVariants generated from this SearchResult . [CODESPLIT] public void setCandidateAnswers ( int i , CandidateAnswerVariant v ) { if ( SearchResult_Type . featOkTst && ( ( SearchResult_Type ) jcasType ) . casFeat_candidateAnswers == null ) jcasType . jcas . throwFeatMissing ( "candidateAnswers" , "edu.cmu.lti.oaqa.type.retrieval.SearchResult" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( SearchResult_Type ) jcasType ) . casFeatCode_candidateAnswers ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( SearchResult_Type ) jcasType ) . casFeatCode_candidateAnswers ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }


Input: getter for query - gets The query in the native syntax of the corresponding search engine . [CODESPLIT] public String getQuery ( ) { if ( Search_Type . featOkTst && ( ( Search_Type ) jcasType ) . casFeat_query == null ) jcasType . jcas . throwFeatMissing ( "query" , "edu.cmu.lti.oaqa.type.retrieval.Search" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Search_Type ) jcasType ) . casFeatCode_query ) ; }


Input: setter for query - sets The query in the native syntax of the corresponding search engine . [CODESPLIT] public void setQuery ( String v ) { if ( Search_Type . featOkTst && ( ( Search_Type ) jcasType ) . casFeat_query == null ) jcasType . jcas . throwFeatMissing ( "query" , "edu.cmu.lti.oaqa.type.retrieval.Search" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Search_Type ) jcasType ) . casFeatCode_query , v ) ; }


Input: getter for hitList - gets Hit list of search results sorted in descreasing order of relevance score . [CODESPLIT] public FSArray getHitList ( ) { if ( Search_Type . featOkTst && ( ( Search_Type ) jcasType ) . casFeat_hitList == null ) jcasType . jcas . throwFeatMissing ( "hitList" , "edu.cmu.lti.oaqa.type.retrieval.Search" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Search_Type ) jcasType ) . casFeatCode_hitList ) ) ) ; }


Input: setter for hitList - sets Hit list of search results sorted in descreasing order of relevance score . [CODESPLIT] public void setHitList ( FSArray v ) { if ( Search_Type . featOkTst && ( ( Search_Type ) jcasType ) . casFeat_hitList == null ) jcasType . jcas . throwFeatMissing ( "hitList" , "edu.cmu.lti.oaqa.type.retrieval.Search" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Search_Type ) jcasType ) . casFeatCode_hitList , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }


Input: indexed getter for hitList - gets an indexed value - Hit list of search results sorted in descreasing order of relevance score . [CODESPLIT] public SearchResult getHitList ( int i ) { if ( Search_Type . featOkTst && ( ( Search_Type ) jcasType ) . casFeat_hitList == null ) jcasType . jcas . throwFeatMissing ( "hitList" , "edu.cmu.lti.oaqa.type.retrieval.Search" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Search_Type ) jcasType ) . casFeatCode_hitList ) , i ) ; return ( SearchResult ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Search_Type ) jcasType ) . casFeatCode_hitList ) , i ) ) ) ; }


Input: indexed setter for hitList - sets an indexed value - Hit list of search results sorted in descreasing order of relevance score . [CODESPLIT] public void setHitList ( int i , SearchResult v ) { if ( Search_Type . featOkTst && ( ( Search_Type ) jcasType ) . casFeat_hitList == null ) jcasType . jcas . throwFeatMissing ( "hitList" , "edu.cmu.lti.oaqa.type.retrieval.Search" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Search_Type ) jcasType ) . casFeatCode_hitList ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Search_Type ) jcasType ) . casFeatCode_hitList ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }


Input: getter for abstractQuery - gets The abstract query from which this actual query was generated . [CODESPLIT] public AbstractQuery getAbstractQuery ( ) { if ( Search_Type . featOkTst && ( ( Search_Type ) jcasType ) . casFeat_abstractQuery == null ) jcasType . jcas . throwFeatMissing ( "abstractQuery" , "edu.cmu.lti.oaqa.type.retrieval.Search" ) ; return ( AbstractQuery ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Search_Type ) jcasType ) . casFeatCode_abstractQuery ) ) ) ; }


Input: setter for abstractQuery - sets The abstract query from which this actual query was generated . [CODESPLIT] public void setAbstractQuery ( AbstractQuery v ) { if ( Search_Type . featOkTst && ( ( Search_Type ) jcasType ) . casFeat_abstractQuery == null ) jcasType . jcas . throwFeatMissing ( "abstractQuery" , "edu.cmu.lti.oaqa.type.retrieval.Search" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Search_Type ) jcasType ) . casFeatCode_abstractQuery , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }


Input: getter for searchId - gets An identifier for this search result . Used to collect hit - list objects that belong to this search result after they ve been split out for parallel processing then gathered up again . [CODESPLIT] public String getSearchId ( ) { if ( Search_Type . featOkTst && ( ( Search_Type ) jcasType ) . casFeat_searchId == null ) jcasType . jcas . throwFeatMissing ( "searchId" , "edu.cmu.lti.oaqa.type.retrieval.Search" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Search_Type ) jcasType ) . casFeatCode_searchId ) ; }


Input: setter for searchId - sets An identifier for this search result . Used to collect hit - list objects that belong to this search result after they ve been split out for parallel processing then gathered up again . [CODESPLIT] public void setSearchId ( String v ) { if ( Search_Type . featOkTst && ( ( Search_Type ) jcasType ) . casFeat_searchId == null ) jcasType . jcas . throwFeatMissing ( "searchId" , "edu.cmu.lti.oaqa.type.retrieval.Search" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Search_Type ) jcasType ) . casFeatCode_searchId , v ) ; }


Input: setter for docId - sets A unique identifier for the document that conatins this passage . [CODESPLIT] public void setDocId ( String v ) { if ( Passage_Type . featOkTst && ( ( Passage_Type ) jcasType ) . casFeat_docId == null ) jcasType . jcas . throwFeatMissing ( "docId" , "edu.cmu.lti.oaqa.type.retrieval.Passage" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Passage_Type ) jcasType ) . casFeatCode_docId , v ) ; }


Input: getter for offsetInBeginSection - gets Character offset of the start of this passage within the section that contains this passage . [CODESPLIT] public int getOffsetInBeginSection ( ) { if ( Passage_Type . featOkTst && ( ( Passage_Type ) jcasType ) . casFeat_offsetInBeginSection == null ) jcasType . jcas . throwFeatMissing ( "offsetInBeginSection" , "edu.cmu.lti.oaqa.type.retrieval.Passage" ) ; return jcasType . ll_cas . ll_getIntValue ( addr , ( ( Passage_Type ) jcasType ) . casFeatCode_offsetInBeginSection ) ; }


Input: setter for offsetInBeginSection - sets Character offset of the start of this passage within the section that contains this passage . [CODESPLIT] public void setOffsetInBeginSection ( int v ) { if ( Passage_Type . featOkTst && ( ( Passage_Type ) jcasType ) . casFeat_offsetInBeginSection == null ) jcasType . jcas . throwFeatMissing ( "offsetInBeginSection" , "edu.cmu.lti.oaqa.type.retrieval.Passage" ) ; jcasType . ll_cas . ll_setIntValue ( addr , ( ( Passage_Type ) jcasType ) . casFeatCode_offsetInBeginSection , v ) ; }


Input: getter for offsetInEndSection - gets Character offset of the end of this passage within the section that contains this passage . [CODESPLIT] public int getOffsetInEndSection ( ) { if ( Passage_Type . featOkTst && ( ( Passage_Type ) jcasType ) . casFeat_offsetInEndSection == null ) jcasType . jcas . throwFeatMissing ( "offsetInEndSection" , "edu.cmu.lti.oaqa.type.retrieval.Passage" ) ; return jcasType . ll_cas . ll_getIntValue ( addr , ( ( Passage_Type ) jcasType ) . casFeatCode_offsetInEndSection ) ; }


Input: setter for offsetInEndSection - sets Character offset of the end of this passage within the section that contains this passage . [CODESPLIT] public void setOffsetInEndSection ( int v ) { if ( Passage_Type . featOkTst && ( ( Passage_Type ) jcasType ) . casFeat_offsetInEndSection == null ) jcasType . jcas . throwFeatMissing ( "offsetInEndSection" , "edu.cmu.lti.oaqa.type.retrieval.Passage" ) ; jcasType . ll_cas . ll_setIntValue ( addr , ( ( Passage_Type ) jcasType ) . casFeatCode_offsetInEndSection , v ) ; }


Input: getter for beginSection - gets The start section of this passage within the document that contains this passage . [CODESPLIT] public String getBeginSection ( ) { if ( Passage_Type . featOkTst && ( ( Passage_Type ) jcasType ) . casFeat_beginSection == null ) jcasType . jcas . throwFeatMissing ( "beginSection" , "edu.cmu.lti.oaqa.type.retrieval.Passage" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Passage_Type ) jcasType ) . casFeatCode_beginSection ) ; }


Input: setter for beginSection - sets The start section of this passage within the document that contains this passage . [CODESPLIT] public void setBeginSection ( String v ) { if ( Passage_Type . featOkTst && ( ( Passage_Type ) jcasType ) . casFeat_beginSection == null ) jcasType . jcas . throwFeatMissing ( "beginSection" , "edu.cmu.lti.oaqa.type.retrieval.Passage" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Passage_Type ) jcasType ) . casFeatCode_beginSection , v ) ; }


Input: getter for endSection - gets The end section of this passage within the document that contains this passage . [CODESPLIT] public String getEndSection ( ) { if ( Passage_Type . featOkTst && ( ( Passage_Type ) jcasType ) . casFeat_endSection == null ) jcasType . jcas . throwFeatMissing ( "endSection" , "edu.cmu.lti.oaqa.type.retrieval.Passage" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Passage_Type ) jcasType ) . casFeatCode_endSection ) ; }


Input: setter for endSection - sets The end section of this passage within the document that contains this passage . [CODESPLIT] public void setEndSection ( String v ) { if ( Passage_Type . featOkTst && ( ( Passage_Type ) jcasType ) . casFeat_endSection == null ) jcasType . jcas . throwFeatMissing ( "endSection" , "edu.cmu.lti.oaqa.type.retrieval.Passage" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Passage_Type ) jcasType ) . casFeatCode_endSection , v ) ; }


Input: getter for aspects - gets Aspects of the gold standard passage . [CODESPLIT] public String getAspects ( ) { if ( Passage_Type . featOkTst && ( ( Passage_Type ) jcasType ) . casFeat_aspects == null ) jcasType . jcas . throwFeatMissing ( "aspects" , "edu.cmu.lti.oaqa.type.retrieval.Passage" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Passage_Type ) jcasType ) . casFeatCode_aspects ) ; }


Input: setter for aspects - sets Aspects of the gold standard passage . [CODESPLIT] public void setAspects ( String v ) { if ( Passage_Type . featOkTst && ( ( Passage_Type ) jcasType ) . casFeat_aspects == null ) jcasType . jcas . throwFeatMissing ( "aspects" , "edu.cmu.lti.oaqa.type.retrieval.Passage" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Passage_Type ) jcasType ) . casFeatCode_aspects , v ) ; }


Input: getter for triple - gets The relevant triple searched in the RDF store . [CODESPLIT] public Triple getTriple ( ) { if ( TripleSearchResult_Type . featOkTst && ( ( TripleSearchResult_Type ) jcasType ) . casFeat_triple == null ) jcasType . jcas . throwFeatMissing ( "triple" , "edu.cmu.lti.oaqa.type.retrieval.TripleSearchResult" ) ; return ( Triple ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( TripleSearchResult_Type ) jcasType ) . casFeatCode_triple ) ) ) ; }


Input: setter for triple - sets The relevant triple searched in the RDF store . [CODESPLIT] public void setTriple ( Triple v ) { if ( TripleSearchResult_Type . featOkTst && ( ( TripleSearchResult_Type ) jcasType ) . casFeat_triple == null ) jcasType . jcas . throwFeatMissing ( "triple" , "edu.cmu.lti.oaqa.type.retrieval.TripleSearchResult" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( TripleSearchResult_Type ) jcasType ) . casFeatCode_triple , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }


Input: getter for sourceRelation - gets The triple from which the search result was generated [CODESPLIT] public Triple getSourceRelation ( ) { if ( PassageFromRelation_Type . featOkTst && ( ( PassageFromRelation_Type ) jcasType ) . casFeat_sourceRelation == null ) jcasType . jcas . throwFeatMissing ( "sourceRelation" , "edu.cmu.lti.oaqa.type.retrieval.PassageFromRelation" ) ; return ( Triple ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( PassageFromRelation_Type ) jcasType ) . casFeatCode_sourceRelation ) ) ) ; }


Input: setter for sourceRelation - sets The triple from which the search result was generated [CODESPLIT] public void setSourceRelation ( Triple v ) { if ( PassageFromRelation_Type . featOkTst && ( ( PassageFromRelation_Type ) jcasType ) . casFeat_sourceRelation == null ) jcasType . jcas . throwFeatMissing ( "sourceRelation" , "edu.cmu.lti.oaqa.type.retrieval.PassageFromRelation" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( PassageFromRelation_Type ) jcasType ) . casFeatCode_sourceRelation , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }