idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
8,600
public void update ( ) { boolean shouldShow = shouldShow ( ) ; if ( visible != shouldShow ) { visible = shouldShow ; BaseUIComponent target = element . getMaskTarget ( ) ; if ( visible ) { Menupopup contextMenu = ElementUI . getDesignContextMenu ( target ) ; String displayName = element . getDisplayName ( ) ; target . ...
Show or hide the design mode mask .
8,601
protected URL toURL ( String filename ) { try { return new File ( filename ) . toURI ( ) . toURL ( ) ; } catch ( MalformedURLException e ) { throw new IllegalArgumentException ( e ) ; } }
Returns a file URL pointing to the given file
8,602
public float putAndGet ( final int key , final float value ) { int index = findInsertionIndex ( key ) ; float previous = missingEntries ; boolean newMapping = true ; if ( index < 0 ) { index = changeIndexSign ( index ) ; previous = values [ index ] ; newMapping = false ; } keys [ index ] = key ; states [ index ] = FULL...
Put a value associated with a key in the map .
8,603
private void growTable ( ) { final int oldLength = states . length ; final int [ ] oldKeys = keys ; final float [ ] oldValues = values ; final byte [ ] oldStates = states ; final int newLength = RESIZE_MULTIPLIER * oldLength ; final int [ ] newKeys = new int [ newLength ] ; final float [ ] newValues = new float [ newLe...
Grow the tables .
8,604
public static < T > T newObject ( Class < T > clazz ) { return getFactory ( clazz ) . newObject ( clazz ) ; }
Creates a new instance of an object of this domain .
8,605
public static < T > T fetchObject ( Class < T > clazz , String id ) { return getFactory ( clazz ) . fetchObject ( clazz , id ) ; }
Fetches an object identified by its unique id from the underlying data store .
8,606
public static < T > List < T > fetchObjects ( Class < T > clazz , String [ ] ids ) { return getFactory ( clazz ) . fetchObjects ( clazz , ids ) ; }
Fetches multiple domain objects as specified by an array of identifier values .
8,607
@ SuppressWarnings ( "unchecked" ) public static < T > IDomainFactory < T > getFactory ( Class < T > clazz ) { for ( IDomainFactory < ? > factory : instance ) { String alias = factory . getAlias ( clazz ) ; if ( alias != null ) { return ( IDomainFactory < T > ) factory ; } } throw new IllegalArgumentException ( "Domain...
Returns a domain factory for the specified class .
8,608
public static int compare ( float a , float b , float delta ) { if ( equals ( a , b , delta ) ) { return 0 ; } return Float . compare ( a , b ) ; }
Compares two float values up to some delta .
8,609
public static short countCommon ( short [ ] indices1 , short [ ] indices2 ) { short numCommonIndices = 0 ; int i = 0 ; int j = 0 ; while ( i < indices1 . length && j < indices2 . length ) { if ( indices1 [ i ] < indices2 [ j ] ) { i ++ ; } else if ( indices2 [ j ] < indices1 [ i ] ) { j ++ ; } else { numCommonIndices +...
Counts the number of indices that appear in both arrays .
8,610
public boolean isSponsorInHierarchy ( DevelopmentProposalContract sponsorable , String sponsorHierarchy , String level1 ) { return sponsorHierarchyService . isSponsorInHierarchy ( sponsorable . getSponsor ( ) . getSponsorCode ( ) , sponsorHierarchy , 1 , level1 ) ; }
This method tests whether a document s sponsor is in a given sponsor hierarchy .
8,611
public Map < String , String > getSubmissionType ( ProposalDevelopmentDocumentContract pdDoc ) { Map < String , String > submissionInfo = new HashMap < > ( ) ; S2sOpportunityContract opportunity = pdDoc . getDevelopmentProposal ( ) . getS2sOpportunity ( ) ; if ( opportunity != null ) { if ( opportunity . getS2sSubmissi...
This method creates and returns Map of submission details like submission type description and Revision code
8,612
private RRBudgetDocument getRRBudget ( ) { deleteAutoGenNarratives ( ) ; RRBudgetDocument rrBudgetDocument = RRBudgetDocument . Factory . newInstance ( ) ; RRBudget rrBudget = RRBudget . Factory . newInstance ( ) ; rrBudget . setFormVersion ( FormVersion . v1_1 . getVersion ( ) ) ; if ( pdDoc . getDevelopmentProposal (...
This method returns RRBudgetDocument object based on proposal development document which contains the informations such as DUNSID OrganizationName BudgetType BudgetYear and BudgetSummary .
8,613
private BudgetYear1DataType getBudgetYear1DataType ( BudgetPeriodDto periodInfo ) { BudgetYear1DataType budgetYear = BudgetYear1DataType . Factory . newInstance ( ) ; if ( periodInfo != null ) { budgetYear . setBudgetPeriodStartDate ( s2SDateTimeService . convertDateToCalendar ( periodInfo . getStartDate ( ) ) ) ; budg...
This method gets BudgetYear1DataType details like BudgetPeriodStartDate BudgetPeriodEndDate BudgetPeriod KeyPersons OtherPersonnel TotalCompensation Equipment ParticipantTraineeSupportCosts Travel OtherDirectCosts DirectCosts IndirectCosts CognizantFederalAgency TotalCosts
8,614
private CumulativeEquipments getCumulativeEquipments ( BudgetSummaryDto budgetSummaryData ) { CumulativeEquipments cumulativeEquipments = CumulativeEquipments . Factory . newInstance ( ) ; if ( budgetSummaryData != null && budgetSummaryData . getCumEquipmentFunds ( ) != null ) { cumulativeEquipments . setCumulativeTota...
This method gets CumulativeEquipments information CumulativeTotalFundsRequestedEquipment based on BudgetSummaryInfo for the form RRBudget .
8,615
private CumulativeOtherDirect getCumulativeOtherDirect ( BudgetSummaryDto budgetSummaryData ) { CumulativeOtherDirect cumulativeOtherDirect = CumulativeOtherDirect . Factory . newInstance ( ) ; cumulativeOtherDirect . setCumulativeTotalFundsRequestedOtherDirectCosts ( BigDecimal . ZERO ) ; if ( budgetSummaryData != nul...
This method gets CumulativeOtherDirectCost details CumulativeMaterialAndSupplies CumulativePublicationCosts CumulativeConsultantServices CumulativeADPComputerServices CumulativeSubawardConsortiumContractualCosts CumulativeEquipmentFacilityRentalFees CumulativeAlterationsAndRenovations and CumulativeOther1DirectCost bas...
8,616
private OtherDirectCosts getOtherDirectCosts ( BudgetPeriodDto periodInfo ) { OtherDirectCosts otherDirectCosts = OtherDirectCosts . Factory . newInstance ( ) ; if ( periodInfo != null && periodInfo . getOtherDirectCosts ( ) . size ( ) > 0 ) { if ( periodInfo . getOtherDirectCosts ( ) . get ( 0 ) . getpublications ( ) ...
This method gets OtherDirectCosts details such as PublicationCosts MaterialsSupplies ConsultantServices ADPComputerServices SubawardConsortiumContractualCosts EquipmentRentalFee AlterationsRenovations and TotalOtherDirectCost in BudgetYearDataType based on BudgetPeriodInfo for the RRBudget .
8,617
private Others getOthersForOtherDirectCosts ( BudgetPeriodDto periodInfo ) { Others others = Others . Factory . newInstance ( ) ; if ( periodInfo != null && periodInfo . getOtherDirectCosts ( ) != null ) { Others . Other otherArray [ ] = new Others . Other [ periodInfo . getOtherDirectCosts ( ) . size ( ) ] ; int Other...
This method is to get Other type description and total cost OtherDirectCosts details in BudgetYearDataType based on BudgetPeriodInfo for the RRBudget .
8,618
public static void status ( String statusText ) { try { getEventManager ( ) . fireLocalEvent ( STATUS_EVENT , statusText == null ? "" : statusText ) ; } catch ( Throwable e ) { log . error ( e ) ; } }
Fires a generic event of type STATUS to update any object that subscribes to it .
8,619
public static void ping ( String responseEvent , List < PingFilter > filters , Recipient ... recipients ) { IEventManager eventManager = getEventManager ( ) ; IGlobalEventDispatcher ged = ( ( ILocalEventDispatcher ) eventManager ) . getGlobalEventDispatcher ( ) ; if ( ged != null ) { ged . Ping ( responseEvent , filter...
Fires a ping request to specified or all recipients .
8,620
public static String getChannelName ( String eventName ) { return eventName == null ? null : EVENT_PREFIX + eventName . split ( "\\." , 2 ) [ 0 ] ; }
Returns the messaging channel name from the event name .
8,621
public static String getEventName ( String channelName ) { int i = channelName . indexOf ( EVENT_PREFIX ) ; return i < 0 ? channelName : channelName . substring ( i + EVENT_PREFIX . length ( ) ) ; }
Returns the event name from the channel name .
8,622
public void refresh ( ) { String url = mockupTypes . getUrl ( mockupType ) ; if ( mockupId == null || url == null ) { iframe . setSrc ( null ) ; return ; } iframe . setSrc ( String . format ( url , mockupId , System . currentTimeMillis ( ) ) ) ; }
Refreshes the iframe content .
8,623
public String getPath ( ) { if ( path == null ) { HelpModule module = HelpModule . getModule ( id ) ; path = module == null ? "" : module . getTitle ( ) ; } return path ; }
Returns the path that determines where the associated menu item will appear under the help submenu . If this value has not been explicitly set and a help module has been specified its value will be determined from the help module .
8,624
public String getAction ( ) { if ( action == null ) { HelpModule module = HelpModule . getModule ( id ) ; action = module == null ? "" : "groovy:" + CareWebUtil . class . getName ( ) + ".showHelpTopic(\"" + id + "\",\"" + ( topic == null ? "" : topic ) + "\",\"" + module . getTitle ( ) + "\");" ; } return action ; }
Returns the action that will be invoked when the associated menu item is clicked . For externally derived help content this value must be explicitly set . Otherwise it will be determined automatically from the specified help module .
8,625
public static ApplicationContext createAppContext ( Page page ) { XmlWebApplicationContext appContext = new FrameworkAppContext ( ) ; new AppContextInitializer ( page ) . initialize ( appContext ) ; appContext . refresh ( ) ; return appContext ; }
Creates an application context as a child of the root application context and associates it with the specified page . In this way any objects managed by the root application context are available to the framework context .
8,626
public static void destroyAppContext ( Page page ) { XmlWebApplicationContext appContext = getAppContext ( page ) ; if ( appContext != null ) { appContext . close ( ) ; } }
Destroys the application context associated with the specified page .
8,627
public ApplicationContext getChildAppContext ( ) { ApplicationContext appContext = getAppContext ( ExecutionContext . getPage ( ) ) ; return appContext == null ? getRootAppContext ( ) : appContext ; }
Returns the application context for the current scope . If no page exists or no application context is associated with the page looks for an application context registered to the current thread . Failing that returns the root application context .
8,628
public static XmlWebApplicationContext getAppContext ( Page page ) { return page == null ? null : ( XmlWebApplicationContext ) page . getAttribute ( APP_CONTEXT_ATTRIB ) ; }
Returns the application context associated with the given page .
8,629
private String firstUpper ( String value ) { return value == null ? null : value . substring ( 0 , 1 ) . toUpperCase ( ) + value . substring ( 1 ) ; }
Convert first character of a string to upper case .
8,630
public Object getPropertyValue ( Object instance , boolean forceDirect ) { try { if ( instance == null ) { return dflt == null || ! isSerializable ( ) ? null : getPropertyType ( ) . getSerializer ( ) . deserialize ( dflt ) ; } if ( ! forceDirect && instance instanceof IPropertyAccessor ) { return ( ( IPropertyAccessor ...
Returns the property value for a specified object instance .
8,631
public void setPropertyValue ( Object instance , Object value , boolean forceDirect ) { try { if ( ! forceDirect && instance instanceof IPropertyAccessor ) { ( ( IPropertyAccessor ) instance ) . setPropertyValue ( this , value ) ; return ; } Method method = null ; try { method = PropertyUtil . findSetter ( setter , ins...
Sets the property value for a specified object instance .
8,632
public Integer getConfigValueInt ( String key , Integer dflt ) { try { return Integer . parseInt ( getConfigValue ( key ) ) ; } catch ( Exception e ) { return dflt ; } }
This is a convenience method for returning a named configuration value that is expected to be an integer .
8,633
public Double getConfigValueDouble ( String key , Double dflt ) { try { return Double . parseDouble ( getConfigValue ( key ) ) ; } catch ( Exception e ) { return dflt ; } }
This is a convenience method for returning a named configuration value that is expected to be a double floating point number .
8,634
public Boolean getConfigValueBoolean ( String key , Boolean dflt ) { try { String value = getConfigValue ( key ) ; return value == null ? dflt : Boolean . parseBoolean ( value ) ; } catch ( Exception e ) { return dflt ; } }
This is a convenience method for returning a named configuration value that is expected to be a Boolean value .
8,635
public String [ ] getConfigValueArray ( String key , String delimiter ) { return StringUtils . split ( getConfigValue ( key ) , delimiter ) ; }
This is a convenience method for returning a named configuration value that is expected to be a list of array elements .
8,636
public boolean include ( T result ) { return getDateRange ( ) . inRange ( DateUtil . stripTime ( dateTypeExtractor . getDateByType ( result , dateType ) ) , true , true ) ; }
Filter result based on selected date range .
8,637
public static void appendResponse ( StringBuilder buffer , String response ) { if ( response != null && ! response . isEmpty ( ) ) { if ( buffer . length ( ) > 0 ) { buffer . append ( "\r\n" ) ; } buffer . append ( response ) ; } }
Accumulate response values in string buffer .
8,638
public void ccowJoin ( ) { if ( ccowIsActive ( ) ) { return ; } if ( ccowContextManager == null && ccowEnabled ) { ccowContextManager = new CCOWContextManager ( ) ; ccowContextManager . subscribe ( this ) ; ccowContextManager . run ( "CareWebFramework#" , "" , true , "*" ) ; } if ( ccowContextManager != null ) { if ( !...
Joins the CCOW common context if available .
8,639
public void init ( IManagedContext < ? > item , ISurveyCallback callback ) { contextItems . clear ( ) ; if ( ccowIsActive ( ) ) { contextItems . addItems ( ccowContextManager . getCCOWContext ( ) ) ; } if ( item != null ) { initItem ( item , callback ) ; } else { SurveyResponse response = new SurveyResponse ( ) ; initI...
Initializes one or all managed contexts to their default state .
8,640
private void initItem ( IManagedContext < ? > item , ISurveyCallback callback ) { try { localChangeBegin ( item ) ; if ( hasSubject ( item . getContextName ( ) ) ) { item . setContextItems ( contextItems ) ; } else { item . init ( ) ; } localChangeEnd ( item , callback ) ; } catch ( ContextException e ) { log . error (...
Initializes the managed context .
8,641
private boolean hasSubject ( String subject ) { boolean result = false ; String s = subject + "." ; int c = s . length ( ) ; for ( String propName : contextItems . getItemNames ( ) ) { result = s . equalsIgnoreCase ( propName . substring ( 0 , c ) ) ; if ( result ) { break ; } } return result ; }
Returns true if the CCOW context contains context settings pertaining to the named subject .
8,642
private void commitContexts ( boolean accept , boolean all ) { Stack < IManagedContext < ? > > stack = commitStack ; commitStack = new Stack < > ( ) ; for ( IManagedContext < ? > managedContext : stack ) { if ( managedContext . isPending ( ) ) { managedContext . commit ( accept ) ; } } while ( ! stack . isEmpty ( ) ) {...
Commit or cancel all pending context changes .
8,643
public void setCCOWEnabled ( boolean ccowEnabled ) { this . ccowEnabled = ccowEnabled ; if ( ! ccowEnabled && ccowContextManager != null ) { ccowContextManager . suspend ( ) ; ccowContextManager = null ; } updateCCOWStatus ( ) ; }
Enables or disables CCOW support .
8,644
public ContextItems getMarshaledContext ( ) { ContextItems marshaledContext = new ContextItems ( ) ; for ( IManagedContext < ? > managedContext : managedContexts ) { marshaledContext . addItems ( managedContext . getContextItems ( false ) ) ; } return marshaledContext ; }
Returns the marshaled context representing the state of all shared contexts .
8,645
private CCOWStatus getCCOWStatus ( ) { if ( ccowContextManager == null ) { return ccowEnabled ? CCOWStatus . NONE : CCOWStatus . DISABLED ; } else if ( ccowTransaction ) { return CCOWStatus . CHANGING ; } else { switch ( ccowContextManager . getState ( ) ) { case csParticipating : return CCOWStatus . JOINED ; case csSu...
Returns the current status of the CCOW common context . Return values correspond to possible states of the standard CCOW status icon .
8,646
private void updateCCOWStatus ( ) { if ( ccowEnabled && eventManager != null ) { eventManager . fireLocalEvent ( "CCOW" , Integer . toString ( getCCOWStatus ( ) . ordinal ( ) ) ) ; } }
Notifies subscribers of a change in the CCOW status via a generic event .
8,647
public void registerObject ( Object object ) { if ( object instanceof IManagedContext ) { managedContexts . add ( ( IManagedContext < ? > ) object ) ; } }
Register an object with the context manager if it implements the IManagedContext interface .
8,648
public void unregisterObject ( Object object ) { if ( object instanceof IContextEvent ) { for ( IManagedContext < ? > managedContext : managedContexts ) { managedContext . removeSubscriber ( ( IContextEvent ) object ) ; } } if ( object instanceof IManagedContext ) { managedContexts . remove ( object ) ; } }
Unregister an object from the context manager .
8,649
private void localChangeEnd ( IManagedContext < ? > managedContext , boolean silent , boolean deferCommit , ISurveyCallback callback ) throws ContextException { if ( pendingStack . isEmpty ( ) || pendingStack . peek ( ) != managedContext ) { throw new ContextException ( "Illegal context change nesting." ) ; } if ( ! ma...
Commits a pending context change .
8,650
private void resetItem ( IManagedContext < ? > item , boolean silent , ISurveyCallback callback ) { try { localChangeBegin ( item ) ; item . reset ( ) ; localChangeEnd ( item , silent , true , callback ) ; } catch ( ContextException e ) { execCallback ( callback , e ) ; } }
Resets the managed context .
8,651
public void ccowPending ( CCOWContextManager sender , ContextItems contextItems ) { ccowTransaction = true ; updateCCOWStatus ( ) ; setMarshaledContext ( contextItems , false , response -> { if ( response . rejected ( ) ) { sender . setSurveyResponse ( response . toString ( ) ) ; } ccowTransaction = false ; updateCCOWS...
Callback to handle a polling request from the CCOW context manager .
8,652
private void initTopicTree ( ) { try { Object data = view . getViewData ( ) ; if ( ! ( data instanceof TopicTree ) ) { return ; } TopicTree topicTree = ( TopicTree ) data ; HelpTopicNode baseNode ; if ( helpViewType == HelpViewType . TOC ) { HelpTopic topic = new HelpTopic ( null , hs . getName ( ) , hs . getName ( ) )...
Initialize the topic tree .
8,653
private void parseResources ( Element element , BeanDefinitionBuilder builder , ManagedList < AbstractBeanDefinition > resourceList ) { NodeList resources = element . getChildNodes ( ) ; for ( int i = 0 ; i < resources . getLength ( ) ; i ++ ) { Node node = resources . item ( i ) ; if ( ! ( node instanceof Element ) ) ...
Parse the resource list .
8,654
private void parseAuthorities ( Element element , BeanDefinitionBuilder builder , ManagedList < AbstractBeanDefinition > authorityList ) { NodeList authorities = element . getChildNodes ( ) ; for ( int i = 0 ; i < authorities . getLength ( ) ; i ++ ) { Node node = authorities . item ( i ) ; if ( ! ( node instanceof Ele...
Parse the authority list .
8,655
private void parseProperties ( Element element , BeanDefinitionBuilder builder , ManagedList < AbstractBeanDefinition > propertyList ) { NodeList properties = element . getChildNodes ( ) ; for ( int i = 0 ; i < properties . getLength ( ) ; i ++ ) { Node node = properties . item ( i ) ; if ( ! ( node instanceof Element ...
Parse the property list .
8,656
private void parseConfig ( Element property , BeanDefinitionBuilder propertyBuilder ) { Element config = ( Element ) getTagChildren ( "config" , property ) . item ( 0 ) ; if ( config != null ) { Properties properties = new Properties ( ) ; NodeList entries = getTagChildren ( "entry" , config ) ; for ( int i = 0 ; i < e...
Parses out configuration settings for current property descriptor .
8,657
private ResourceType getResourceType ( String resourceTag ) { if ( resourceTag == null || ! resourceTag . endsWith ( "-resource" ) ) { return ResourceType . unknown ; } try { return ResourceType . valueOf ( resourceTag . substring ( 0 , resourceTag . length ( ) - 9 ) ) ; } catch ( Exception e ) { return ResourceType . ...
Returns the ResourceType enum value corresponding to the resource tag .
8,658
public Fixture getFixture ( String name , String ... params ) throws Throwable { Type < ? > type = loadType ( name ) ; Object target = type . newInstanceUsingCoercion ( params ) ; return new DefaultFixture ( target ) ; }
Creates a new instance of a fixture class using a set of parameters .
8,659
protected int readWord ( InputStream inputStream ) throws IOException { byte [ ] bytes = new byte [ 2 ] ; boolean success = inputStream . read ( bytes ) == 2 ; return ! success ? - 1 : readWord ( bytes , 0 ) ; }
Reads a two - byte integer from the input stream .
8,660
protected int readWord ( byte [ ] data , int offset ) { int low = data [ offset ] & 0xff ; int high = data [ offset + 1 ] & 0xff ; return high << 8 | low ; }
Reads a two - byte integer from a byte array at the specified offset .
8,661
protected String getString ( byte [ ] data , int offset ) { if ( offset < 0 ) { return "" ; } int i = offset ; while ( data [ i ++ ] != 0x00 ) { ; } return getString ( data , offset , i - offset - 1 ) ; }
Returns a string value from a zero - terminated byte array at the specified offset .
8,662
protected String getString ( byte [ ] data , int offset , int length ) { return new String ( data , offset , length , CS_WIN1252 ) ; }
Returns a string value from the byte array .
8,663
protected byte [ ] loadBinaryFile ( String file ) throws IOException { try ( InputStream is = resource . getInputStream ( file ) ) { return IOUtils . toByteArray ( is ) ; } }
Loads the entire contents of a binary file into a byte array .
8,664
public static < T > IQueryResult < T > abortResult ( String reason ) { return packageResult ( null , CompletionStatus . ABORTED , reason == null ? null : Collections . singletonMap ( "reason" , ( Object ) reason ) ) ; }
Returns a query result for an aborted operation .
8,665
public static < T > IQueryResult < T > errorResult ( Throwable exception ) { return packageResult ( null , CompletionStatus . ERROR , exception == null ? null : Collections . singletonMap ( "exception" , ( Object ) exception ) ) ; }
Returns a query result for an error .
8,666
public List < T > filter ( List < T > results ) { if ( filters . isEmpty ( ) || results == null ) { return results ; } List < T > include = new ArrayList < > ( ) ; for ( T result : results ) { if ( include ( result ) ) { include . add ( result ) ; } } return results . size ( ) == include . size ( ) ? results : include ...
Filters a list of results based on the member filters .
8,667
protected void updateVisibility ( boolean visible , boolean activated ) { tab . setVisible ( visible ) ; tab . setSelected ( visible && activated ) ; }
Sets the visibility and selection state of the tab .
8,668
private void init ( ) { add ( "text" , PropertySerializer . STRING , PropertyEditorText . class ) ; add ( "color" , PropertySerializer . STRING , PropertyEditorColor . class ) ; add ( "choice" , PropertySerializer . STRING , PropertyEditorChoiceList . class ) ; add ( "action" , PropertySerializer . STRING , PropertyEdi...
Add built - in property types .
8,669
private void computeInputParatemeter ( final EntryPoint entryPoint , final String [ ] parameterNames , final Set < Class < ? > > consolidatedTypeBlacklist , final Set < String > consolidatedNameBlacklist , MethodParameter methodParameter ) { if ( consolidatedTypeBlacklist . contains ( methodParameter . getParameterType...
Checks whether or not the supplied parameter should be part of the response or not . It adds to the entry point if necessary .
8,670
public static Method findSetter ( String methodName , Object instance , Class < ? > valueClass ) throws NoSuchMethodException { return findMethod ( methodName , instance , valueClass , true ) ; }
Returns the requested setter method from an object instance .
8,671
public static Method findGetter ( String methodName , Object instance , Class < ? > valueClass ) throws NoSuchMethodException { return findMethod ( methodName , instance , valueClass , false ) ; }
Returns the requested getter method from an object instance .
8,672
private static Method findMethod ( String methodName , Object instance , Class < ? > valueClass , boolean setter ) throws NoSuchMethodException { if ( methodName == null ) { return null ; } int paramCount = setter ? 1 : 0 ; for ( Method method : instance . getClass ( ) . getMethods ( ) ) { if ( method . getName ( ) . e...
Returns the requested method from an object instance .
8,673
protected ScaleTwoDecimal getTotalCost ( BudgetModularContract budgetModular ) { ScaleTwoDecimal totalCost = ScaleTwoDecimal . ZERO ; if ( budgetModular . getTotalDirectCost ( ) != null ) { totalCost = budgetModular . getTotalDirectCost ( ) ; } for ( BudgetModularIdcContract budgetModularIdc : budgetModular . getBudget...
This method is used to get total cost as sum of totalDirectCost and total sum of fundRequested .
8,674
protected String getCognizantFederalAgency ( RolodexContract rolodex ) { StringBuilder agency = new StringBuilder ( ) ; if ( rolodex . getOrganization ( ) != null ) { agency . append ( rolodex . getOrganization ( ) ) ; } agency . append ( COMMA_SEPERATOR ) ; if ( rolodex . getFirstName ( ) != null ) { agency . append (...
This method is used to get rolodex Organization FirstName LastName and PhoneNumber as a single string
8,675
public boolean transform ( IResource resource ) throws Exception { String path = resource . getSourcePath ( ) ; if ( path . startsWith ( "META-INF/" ) ) { return false ; } if ( hsFile == null && loader . isHelpSetFile ( path ) ) { hsFile = getResourceBase ( ) + resource . getTargetPath ( ) ; } return super . transform ...
Excludes resources under the META - INF folder and checks the resource against the help set pattern saving a path reference if it matches .
8,676
public VCSConfiguration loadConfiguration ( Gson gson ) { try { URL resource = ResourceUtils . getResourceAsURL ( VCS_CONFIG_JSON ) ; if ( null == resource ) { throw new IncorrectConfigurationException ( "Unable to find VCS configuration" ) ; } return gson . fromJson ( Resources . asCharSource ( resource , Charsets . U...
Loads VCS configuration
8,677
protected IQueueMessage < ID , DATA > takeFromQueue ( ) { KafkaMessage kMsg = kafkaClient . consumeMessage ( consumerGroupId , true , topicName , 1000 , TimeUnit . MILLISECONDS ) ; return kMsg != null ? deserialize ( kMsg . content ( ) ) : null ; }
Takes a message from Kafka queue .
8,678
public ParticipantListener createSessionListener ( String sessionId , ISessionUpdate callback ) { return SessionService . create ( self , sessionId , eventManager , callback ) ; }
Creates a session listener .
8,679
public void createSession ( String sessionId ) { boolean newSession = sessionId == null ; sessionId = newSession ? newSessionId ( ) : sessionId ; SessionController controller = sessions . get ( sessionId ) ; if ( controller == null ) { controller = SessionController . create ( sessionId , newSession ) ; sessions . put ...
Creates a new session with the specified session id .
8,680
public void setActive ( boolean active ) { if ( this . active != active ) { this . active = active ; inviteListener . setActive ( active ) ; acceptListener . setActive ( active ) ; participants . clear ( ) ; participants . add ( self ) ; participantListener . setActive ( active ) ; } }
Sets the listening state of the service . When set to false the service stops listening to all events .
8,681
public void invite ( String sessionId , Collection < IPublisherInfo > invitees , boolean cancel ) { if ( invitees == null || invitees . isEmpty ( ) ) { return ; } List < Recipient > recipients = new ArrayList < > ( ) ; for ( IPublisherInfo invitee : invitees ) { recipients . add ( new Recipient ( RecipientType . SESSIO...
Sends an invitation request to the specified invitees .
8,682
public static void store ( String absolutePath , Properties configs ) throws IOException { OutputStream outStream = null ; try { outStream = new FileOutputStream ( new File ( absolutePath ) ) ; configs . store ( outStream , null ) ; } finally { try { if ( outStream != null ) { outStream . close ( ) ; } } catch ( IOExce...
Write into properties file .
8,683
public void registerObject ( Object object ) { if ( object instanceof ICareWebStartup ) { startupRoutines . add ( ( ICareWebStartup ) object ) ; } }
Register a startup routine .
8,684
public void execute ( ) { List < ICareWebStartup > temp = new ArrayList < > ( startupRoutines ) ; for ( ICareWebStartup startupRoutine : temp ) { try { if ( startupRoutine . execute ( ) ) { unregisterObject ( startupRoutine ) ; } } catch ( Throwable t ) { log . error ( "Error executing startup routine." , t ) ; unregis...
Execute registered startup routines .
8,685
public void setStretch ( boolean stretch ) { this . stretch = stretch ; image . setWidth ( stretch ? "100%" : null ) ; image . setHeight ( stretch ? "100%" : null ) ; }
Sets whether or not to stretch the image to fill its parent .
8,686
public static < T > T getBean ( Class < T > clazz ) { ApplicationContext appContext = getAppContext ( ) ; try { return appContext == null ? null : appContext . getBean ( clazz ) ; } catch ( Exception e ) { return null ; } }
Return the bean of the specified class .
8,687
public static String getProperty ( String name ) { if ( propertyProvider == null ) { initPropertyProvider ( ) ; } return propertyProvider . getProperty ( name ) ; }
Returns a property value from the application context .
8,688
public static Resource getResource ( String location ) { Resource resource = resolver . getResource ( location ) ; return resource . exists ( ) ? resource : null ; }
Returns the resource at the specified location . Supports classpath references .
8,689
public static Resource [ ] getResources ( String locationPattern ) { try { return resolver . getResources ( locationPattern ) ; } catch ( IOException e ) { throw MiscUtil . toUnchecked ( e ) ; } }
Returns an array of resources matching the location pattern .
8,690
protected static void setShell ( CareWebShell shell ) { if ( getShell ( ) != null ) { throw new RuntimeException ( "A CareWeb shell instance has already been registered." ) ; } ExecutionContext . getPage ( ) . setAttribute ( Constants . SHELL_INSTANCE , shell ) ; }
Sets the active instance of the CareWeb shell . An exception is raised if an active instance has already been set .
8,691
public static void showMessage ( String message , String caption ) { getShell ( ) . getMessageWindow ( ) . showMessage ( message , caption ) ; }
Sends an informational message for display by desktop .
8,692
public static void showHelpTopic ( String module , String topic , String label ) { getShell ( ) . getHelpViewer ( ) ; HelpUtil . show ( module , topic , label ) ; }
Shows help topic in help viewer .
8,693
public static String getUrlMapping ( String url , Map < String , String > urlMappings ) { if ( urlMappings != null ) { for ( String pattern : urlMappings . keySet ( ) ) { if ( urlMatcher . match ( pattern , url ) ) { return urlMappings . get ( pattern ) ; } } } return null ; }
Returns the target of a url pattern mapping .
8,694
public static String generateRandomPassword ( int minLength , int maxLength , String [ ] constraints ) { if ( constraints == null || constraints . length == 0 || minLength <= 0 || maxLength < minLength ) { throw new IllegalArgumentException ( ) ; } int pwdLength = RandomUtils . nextInt ( maxLength - minLength + 1 ) + m...
Generates a random password within the specified parameters .
8,695
public String [ ] getMessageWithParams ( ) { String [ ] messageWithParams = new String [ getParams ( ) . length + 1 ] ; messageWithParams [ 0 ] = errorMessage ; System . arraycopy ( params , 0 , messageWithParams , 1 , messageWithParams . length - 1 ) ; return messageWithParams ; }
This method returns the message as the first element followed by all params .
8,696
public boolean validateName ( String name ) { return name != null && ! name . isEmpty ( ) && StringUtils . isAlphanumericSpace ( name . replace ( '_' , ' ' ) ) ; }
Validates a layout name .
8,697
public boolean layoutExists ( LayoutIdentifier layout ) { return getLayouts ( layout . shared ) . contains ( layout . name ) ; }
Returns true if the specified layout exists .
8,698
public void saveLayout ( LayoutIdentifier layout , String content ) { propertyService . saveValue ( getPropertyName ( layout . shared ) , layout . name , layout . shared , content ) ; }
Saves a layout with the specified name and content .
8,699
public void renameLayout ( LayoutIdentifier layout , String newName ) { String text = getLayoutContent ( layout ) ; saveLayout ( new LayoutIdentifier ( newName , layout . shared ) , text ) ; deleteLayout ( layout ) ; }
Rename a layout .