idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
14,300 | public static final < T > T applyList ( Object base , String fieldname ) { return applyList ( base , fieldname , BeanHelper :: defaultFactory ) ; } | Applies bean action by using default factory . |
14,301 | public static final String applyPrefix ( String property ) { int addIdx = property . lastIndexOf ( Add ) ; if ( addIdx != - 1 ) { return property . substring ( 0 , addIdx ) ; } else { int assignIdx = property . lastIndexOf ( Assign ) ; if ( assignIdx != - 1 ) { return property . substring ( 0 , assignIdx ) ; } else { i... | Return prefix of apply pattern or pattern if not apply - pattern . |
14,302 | public static final Object removeList ( Object bean , String property ) { return doFor ( bean , property , null , ( Object a , int i ) -> { throw new UnsupportedOperationException ( "not supported" ) ; } , ( List l , int i ) -> { return l . remove ( i ) ; } , ( Object b , Class c , String p ) -> { throw new Unsupported... | Removes pattern item from list |
14,303 | public static final < T > void addList ( Object bean , String property , T value ) { addList ( bean , property , null , ( Class < T > c , String h ) -> { return value ; } ) ; } | Adds pattern item to end of list |
14,304 | public static final < T > T addList ( Object bean , String property , String hint , BiFunction < Class < T > , String , T > factory ) { Object fieldValue = getValue ( bean , property ) ; if ( fieldValue instanceof List ) { List list = ( List ) fieldValue ; Class [ ] pt = getParameterTypes ( bean , property ) ; T value ... | Adds pattern item to end of list using given factory and hint |
14,305 | public static final String getter ( Field field , String fieldName ) { Class < ? > type = field . getType ( ) ; if ( type . isPrimitive ( ) && "boolean" . equals ( type . getName ( ) ) ) { return isser ( fieldName ) ; } else { return getter ( fieldName ) ; } } | property - > getProperty |
14,306 | public static final String prefix ( String pattern ) { int idx = CharSequences . lastIndexOf ( pattern , BeanHelper :: separator ) ; if ( idx != - 1 ) { return pattern . substring ( 0 , idx ) ; } else { return "" ; } } | Return string before last reparator |
14,307 | public static final boolean isListItem ( String pattern ) { int idx = pattern . lastIndexOf ( Lim ) ; if ( idx != - 1 ) { try { Integer . parseInt ( pattern . substring ( idx + 1 ) ) ; return true ; } catch ( NumberFormatException ex ) { return false ; } } else { return false ; } } | Return true if string after last separator is numeric |
14,308 | public static final Set < String > getProperties ( Object bean ) { return stream ( bean ) . collect ( Collectors . toSet ( ) ) ; } | Return set of objects patterns |
14,309 | public void free ( ) { super . free ( ) ; if ( m_record != null ) m_record . removeField ( this ) ; m_record = null ; m_strFieldName = null ; m_strFieldDesc = null ; if ( m_vScreenField != null ) { m_vScreenField . removeAllElements ( ) ; m_vScreenField = null ; } } | Free this field s resources . Removes this fieldlist from the parent record . |
14,310 | public void addComponent ( Object sField ) { if ( m_vScreenField == null ) m_vScreenField = new Vector < Object > ( ) ; m_vScreenField . addElement ( sField ) ; } | This screen component is displaying this field . |
14,311 | public Object getComponent ( int iPosition ) { if ( m_vScreenField == null ) return null ; if ( iPosition < m_vScreenField . size ( ) ) { try { return m_vScreenField . elementAt ( iPosition ) ; } catch ( ArrayIndexOutOfBoundsException e ) { return null ; } } return null ; } | Get the component at this position . |
14,312 | public void displayField ( ) { if ( m_vScreenField == null ) return ; for ( int i = 0 ; i < m_vScreenField . size ( ) ; i ++ ) { Object component = m_vScreenField . elementAt ( i ) ; Convert converter = null ; if ( component instanceof ScreenComponent ) converter = ( ( ScreenComponent ) component ) . getConverter ( ) ;... | Display this field . Go through the sFieldList and setText for JTextComponents and setControlValue for FieldComponents . |
14,313 | public String getFieldDesc ( ) { String strFieldDesc = null ; if ( m_strFieldDesc != null ) strFieldDesc = m_strFieldDesc ; else { if ( this . getRecord ( ) != null ) strFieldDesc = this . getRecord ( ) . getString ( this . getFieldName ( ) ) ; } return strFieldDesc ; } | Get the short field description . |
14,314 | public String getFieldTip ( ) { String strTipKey = this . getFieldName ( ) + Constants . TIP ; String strFieldTip = strTipKey ; if ( this . getRecord ( ) != null ) strFieldTip = this . getRecord ( ) . getString ( strTipKey ) ; if ( strFieldTip == strTipKey ) return this . getFieldDesc ( ) ; return strFieldTip ; } | Get the long field description tip . Look in the resource for the long description if not found return the field desc . |
14,315 | public int getMaxLength ( ) { if ( m_iMaxLength == Constants . DEFAULT_FIELD_LENGTH ) { m_iMaxLength = 20 ; if ( m_classData == Short . class ) m_iMaxLength = 4 ; else if ( m_classData == Integer . class ) m_iMaxLength = 8 ; else if ( m_classData == Float . class ) m_iMaxLength = 8 ; else if ( m_classData == Double . c... | Maximum string length . |
14,316 | public int initField ( boolean bDisplayOption ) { if ( ( this . getDefault ( ) == null ) || ( this . getDefault ( ) instanceof String ) ) return this . setString ( ( String ) this . getDefault ( ) , bDisplayOption , Constants . INIT_MOVE ) ; return this . setData ( this . getDefault ( ) , bDisplayOption , Constants . I... | Set this field back to the original value . |
14,317 | public double getValue ( ) { Object objData = this . getData ( ) ; if ( objData != null ) { Class < ? > classData = this . getDataClass ( ) ; if ( classData != Object . class ) if ( classData == objData . getClass ( ) ) { if ( classData == Short . class ) return ( ( Short ) objData ) . shortValue ( ) ; else if ( classD... | For numeric fields get the current value . Usually overidden . |
14,318 | public int setState ( boolean bState , boolean bDisplayOption , int iMoveMode ) { Boolean objData = new Boolean ( bState ) ; if ( this . getDataClass ( ) == Boolean . class ) return this . setData ( objData , bDisplayOption , iMoveMode ) ; else if ( Number . class . isAssignableFrom ( this . getDataClass ( ) ) ) return... | Set the data in this field to true or false . |
14,319 | public boolean getState ( ) { if ( this . getDataClass ( ) == Boolean . class ) { Boolean objData = ( Boolean ) this . getData ( ) ; if ( objData != null ) return objData . booleanValue ( ) ; } return false ; } | Get the state of this boolean field . |
14,320 | public Optional < T > updateResourceWithLog ( ) { Optional < T > resourceAsOpt = updateResource ( ) ; log . debug ( "Updated Resource - {}" , updateResource ( ) . isPresent ( ) ? "YES" : "NO" ) ; return resourceAsOpt ; } | Update resource with log optional . |
14,321 | public Optional < T > updateResource ( ) { return JMOptional . getOptional ( JMRestfulResource . getStringWithRestOrClasspathOrFilePath ( restfulResourceUrl ) ) . filter ( getEquals ( cachedJsonString ) . negate ( ) ) . filter ( peek ( this :: setJsonStringCache ) ) . map ( jsonString -> JMJson . withJsonString ( jsonS... | Update resource optional . |
14,322 | private static String stripFileExtensionIfAny ( final String name ) { final int suffix = name . lastIndexOf ( ".html" ) ; return suffix == - 1 ? name : name . substring ( 0 , suffix ) ; } | bit of a hack ... |
14,323 | public void addPropertyListeners ( ) { this . addPropertiesFieldBehavior ( this . getField ( MessageDetail . DESTINATION_SITE ) , TrxMessageHeader . DESTINATION_PARAM ) ; this . addPropertiesFieldBehavior ( this . getField ( MessageDetail . DESTINATION_PATH ) , TrxMessageHeader . DESTINATION_MESSAGE_PARAM ) ; this . ad... | AddPropertyListeners Method . |
14,324 | public TrxMessageHeader addMessageProperties ( TrxMessageHeader trxMessageHeader , MessageDetailTarget recMessageDetailTarget , MessageProcessInfo recMessageProcessInfo , MessageTransport recMessageTransport ) { try { if ( trxMessageHeader == null ) trxMessageHeader = new TrxMessageHeader ( null , null ) ; ContactType ... | Get the message properties for this vendor . |
14,325 | @ SuppressWarnings ( "unchecked" ) public final SelfType startTime ( final DateTime when , final TimeSpan jitter ) { final DateTime now = new DateTime ( ) . withZone ( when . getZone ( ) ) ; final int startWeekDay = when . getDayOfWeek ( ) ; final int currentWeekDay = now . getDayOfWeek ( ) ; final int daysTilStart = (... | Set the time - of - day when the first run of the job will take place . |
14,326 | public void doFilter ( ServletRequest request , ServletResponse response , FilterChain chain ) throws IOException , ServletException { if ( response instanceof HttpServletResponse ) { HttpServletResponse httpResponse = ( HttpServletResponse ) response ; String queryString = ( ( HttpServletRequest ) request ) . getQuery... | Add no - cache headers if Query String matches reqExoFilters |
14,327 | private void setHeader ( HttpServletResponse response , String name , String value ) { if ( response . containsHeader ( value ) ) { response . setHeader ( name , value ) ; } else { response . addHeader ( name , value ) ; } } | Set Cache header . |
14,328 | protected Element createLinkWrapperElement ( final Document document , final Node node , final String cssClass ) { final Element linkElement = document . createElement ( "para" ) ; if ( cssClass != null ) { linkElement . setAttribute ( "role" , cssClass ) ; } node . appendChild ( linkElement ) ; return linkElement ; } | Creates the wrapper element for bug or editor links and adds it to the document . |
14,329 | protected Element createExternalLinkElement ( final DocBookVersion docBookVersion , final Document document , String title , final String url ) { final Element linkEle ; if ( docBookVersion == DocBookVersion . DOCBOOK_50 ) { linkEle = document . createElement ( "link" ) ; linkEle . setAttributeNS ( "http://www.w3.org/1... | Creates an element that represents an external link . |
14,330 | protected String createExternalLinkElement ( final DocBookVersion docBookVersion , final String title , final String url ) { final StringBuilder linkEle = new StringBuilder ( ) ; if ( docBookVersion == DocBookVersion . DOCBOOK_50 ) { linkEle . append ( "<link xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"" ... | Creates a string that represents an external link . |
14,331 | public void processTopicAdditionalInfo ( final BuildData buildData , final SpecTopic specTopic , final Document document ) throws BuildProcessingException { if ( ! shouldAddAdditionalInfo ( buildData , specTopic ) ) return ; final List < Node > invalidNodes = XMLUtilities . getChildNodes ( document . getDocumentElement... | Adds some debug information and links to the end of the topic |
14,332 | protected static boolean shouldAddAdditionalInfo ( final BuildData buildData , final SpecTopic specTopic ) { return ( buildData . getBuildOptions ( ) . getInsertEditorLinks ( ) && specTopic . getTopicType ( ) != TopicType . AUTHOR_GROUP ) || ( buildData . getBuildOptions ( ) . getInsertBugLinks ( ) && specTopic . getTo... | Checks to see if additional info should be added based on the build options and the spec topic type . |
14,333 | private static List < InjectionData > processIdList ( final String list ) { final String [ ] ids = list . split ( "," ) ; List < InjectionData > retValue = new ArrayList < InjectionData > ( ids . length ) ; for ( final String id : ids ) { final String topicId = id . replaceAll ( OPTIONAL_MARKER , "" ) . trim ( ) ; fina... | Takes a comma separated list of ints and returns an array of Integers . This is used when processing custom injection points . |
14,334 | public static byte [ ] encodeLength ( int length , int offset ) { if ( length < SIZE_THRESHOLD ) { byte firstByte = ( byte ) ( length + offset ) ; return new byte [ ] { firstByte } ; } else if ( length < MAX_ITEM_LENGTH ) { byte [ ] binaryLength ; if ( length > 0xFF ) binaryLength = intToBytesNoLeadZeroes ( length ) ; ... | Integer limitation goes up to 2^31 - 1 so length can never be bigger than MAX_ITEM_LENGTH |
14,335 | public double getIntensity ( double dlat , double dlong , double year , double altitude ) { calcGeoMag ( dlat , dlong , year , altitude ) ; return ti ; } | Returns the magnetic field intensity from the Department of Defense geomagnetic model and data in nano Tesla . |
14,336 | public double getHorizontalIntensity ( double dlat , double dlong , double year , double altitude ) { calcGeoMag ( dlat , dlong , year , altitude ) ; return bh ; } | Returns the horizontal magnetic field intensity from the Department of Defense geomagnetic model and data in nano Tesla . |
14,337 | public double getVerticalIntensity ( double dlat , double dlong , double year , double altitude ) { calcGeoMag ( dlat , dlong , year , altitude ) ; return bz ; } | Returns the vertical magnetic field intensity from the Department of Defense geomagnetic model and data in nano Tesla . |
14,338 | public double getNorthIntensity ( double dlat , double dlong , double year , double altitude ) { calcGeoMag ( dlat , dlong , year , altitude ) ; return by ; } | Returns the northerly magnetic field intensity from the Department of Defense geomagnetic model and data in nano Tesla . |
14,339 | public double getEastIntensity ( double dlat , double dlong , double year , double altitude ) { calcGeoMag ( dlat , dlong , year , altitude ) ; return bx ; } | Returns the easterly magnetic field intensity from the Department of Defense geomagnetic model and data in nano Tesla . |
14,340 | public double getDipAngle ( double dlat , double dlong , double year , double altitude ) { calcGeoMag ( dlat , dlong , year , altitude ) ; return dip ; } | Returns the magnetic field dip angle from the Department of Defense geomagnetic model and data in degrees . |
14,341 | private void setCoeff ( ) { c [ 0 ] [ 0 ] = 0.0 ; cd [ 0 ] [ 0 ] = 0.0 ; epoch = Double . parseDouble ( input [ 0 ] . trim ( ) . split ( "[\\s]+" ) [ 0 ] ) ; defaultDate = epoch + 2.5 ; String [ ] tokens ; for ( int i = 1 ; i < input . length ; i ++ ) { tokens = input [ i ] . trim ( ) . split ( "[\\s]+" ) ; int n = Int... | This method sets the input data to the internal fit coefficents . If there is an exception reading the input file WMM . COF these values are used . |
14,342 | void setState ( final WorldState state ) { if ( this . ready ) { throw new IllegalStateException ( "Cannot reassign the world state of a response." ) ; } this . state = state ; this . ready = true ; synchronized ( this ) { this . notifyAll ( ) ; } } | Sets the state of this Response message . This method should only be called once . |
14,343 | public < T > T asObject ( String string , Class < T > valueType ) { return ( T ) TimeZone . getTimeZone ( string ) ; } | Create time zone instance from time zone ID . If time zone ID is not recognized return UTC . |
14,344 | public static < I , O > JMProcessor < I , O > build ( Function < I , O > transformerFunction ) { return new JMProcessor < > ( transformerFunction ) ; } | Build jm processor . |
14,345 | public static < T , M , R > Processor < T , R > combine ( Processor < T , M > processor1 , Processor < M , R > processor2 ) { processor1 . subscribe ( processor2 ) ; return new Processor < > ( ) { public void subscribe ( Flow . Subscriber < ? super R > subscriber ) { processor2 . subscribe ( subscriber ) ; } public voi... | Combine processor . |
14,346 | public boolean isContactDisplay ( ) { String strUserContactType = this . getProperty ( DBParams . CONTACT_TYPE ) ; String strUserContactID = this . getProperty ( DBParams . CONTACT_ID ) ; String strContactType = ( ( ReferenceField ) this . getScreenRecord ( ) . getField ( MessageLogScreenRecord . CONTACT_TYPE_ID ) ) . ... | IsContactDisplay Method . |
14,347 | public static Date parseDate ( final String date , final List < String > patterns ) { for ( final String pattern : patterns ) { final SimpleDateFormat formatter = new SimpleDateFormat ( pattern ) ; try { return formatter . parse ( date ) ; } catch ( final ParseException e ) { } } return null ; } | Tries to convert the given String to a Date . |
14,348 | public static Date parseToDate ( final String datum , final String [ ] formats , final Locale locale ) { for ( final String format : formats ) { final SimpleDateFormat sdf = new SimpleDateFormat ( format , locale ) ; try { return sdf . parse ( datum ) ; } catch ( final ParseException e ) { } } return null ; } | Returns a date - object if the array with the formats are valid otherwise null . |
14,349 | private String readBeanName ( Class beanClass ) throws NoSuchFieldException , IllegalAccessException { final Field field = beanClass . getField ( "BEAN_NAME" ) ; return String . valueOf ( field . get ( null ) ) ; } | Find what s stored in BEAN_NAME and return it or toss an exception . |
14,350 | public static final double deltaLongitude ( double latitude , double distance , double bearing ) { double departure = departure ( latitude ) ; double sin = Math . sin ( Math . toRadians ( bearing ) ) ; return ( sin * distance ) / ( 60 * departure ) ; } | Return longitude change after moving distance at bearing |
14,351 | public static final double departure ( WayPoint loc1 , WayPoint loc2 ) { return departure ( loc2 . getLatitude ( ) , loc1 . getLatitude ( ) ) ; } | Return average departure of two waypoints |
14,352 | public static final double departure ( double latitude1 , double latitude2 ) { checkLatitude ( latitude1 ) ; checkLatitude ( latitude2 ) ; return departure ( ( latitude1 + latitude2 ) / 2 ) ; } | Returns departure of average latitude |
14,353 | public static final double bearing ( WayPoint wp1 , WayPoint wp2 ) { double lat1 = wp1 . getLatitude ( ) ; double lat2 = wp2 . getLatitude ( ) ; double lon1 = wp1 . getLongitude ( ) ; double lon2 = wp2 . getLongitude ( ) ; return bearing ( lat1 , lon1 , lat2 , lon2 ) ; } | Return bearing from wp1 to wp2 in degrees |
14,354 | public static final double speed ( WayPoint wp1 , WayPoint wp2 ) { double lat1 = wp1 . getLatitude ( ) ; double lat2 = wp2 . getLatitude ( ) ; double lon1 = wp1 . getLongitude ( ) ; double lon2 = wp2 . getLongitude ( ) ; long time1 = wp1 . getTime ( ) ; long time2 = wp2 . getTime ( ) ; return speed ( time1 , lat1 , lon... | Returns the speed needed to move from wp1 to wp2 |
14,355 | public static final double addLongitude ( double longitude , double delta ) { double gha = longitudeToGHA ( longitude ) ; gha -= delta ; return ghaToLongitude ( normalizeAngle ( gha ) ) ; } | Adds delta to longitude . Positive delta is to east |
14,356 | public void setVersion ( String value ) { clear ( ) ; if ( value == null || value . length ( ) == 0 ) { return ; } String pcs [ ] = value . split ( "\\." , 4 ) ; int len = Math . min ( pcs . length , 4 ) ; for ( int i = 0 ; i < len ; i ++ ) { ver [ i ] = Long . parseLong ( pcs [ i ] ) ; } } | Set version components from input value . |
14,357 | private void appendVersion ( StringBuilder sb , long ver ) { if ( sb . length ( ) > 0 ) { sb . append ( "." ) ; } sb . append ( ver ) ; } | Append version component . |
14,358 | public void init ( String jsonString ) throws AuthenticationException { try { setConfig ( new JsonSimpleConfig ( jsonString ) ) ; } catch ( UnsupportedEncodingException e ) { throw new AuthenticationException ( e ) ; } catch ( IOException e ) { throw new AuthenticationException ( e ) ; } } | Initialisation of Internal Authentication plugin |
14,359 | private void setConfig ( JsonSimpleConfig config ) throws IOException { user_object = new InternalUser ( ) ; file_path = config . getString ( null , "authentication" , "internal" , "path" ) ; loadUsers ( ) ; } | Set default configuration |
14,360 | private void loadUsers ( ) throws IOException { file_store = new Properties ( ) ; try { File user_file = new File ( file_path ) ; if ( ! user_file . exists ( ) ) { user_file . getParentFile ( ) . mkdirs ( ) ; OutputStream out = new FileOutputStream ( user_file ) ; IOUtils . copy ( getClass ( ) . getResourceAsStream ( "... | Load users from the file |
14,361 | private void saveUsers ( ) throws IOException { if ( file_store != null ) { try { file_store . store ( new FileOutputStream ( file_path ) , "" ) ; } catch ( Exception e ) { throw new IOException ( e ) ; } } } | Save user lists to the file on the disk |
14,362 | private String encryptPassword ( String password ) throws AuthenticationException { byte [ ] passwordBytes = password . getBytes ( ) ; try { MessageDigest algorithm = MessageDigest . getInstance ( "MD5" ) ; algorithm . reset ( ) ; algorithm . update ( passwordBytes ) ; byte messageDigest [ ] = algorithm . digest ( ) ; ... | Password encryption method |
14,363 | public User createUser ( String username , String password ) throws AuthenticationException { String user = file_store . getProperty ( username ) ; if ( user != null ) { throw new AuthenticationException ( "User '" + username + "' already exists." ) ; } String ePwd = encryptPassword ( password ) ; file_store . put ( us... | Create a user . |
14,364 | public void changePassword ( String username , String password ) throws AuthenticationException { String user = file_store . getProperty ( username ) ; if ( user == null ) { throw new AuthenticationException ( "User '" + username + "' not found." ) ; } String ePwd = encryptPassword ( password ) ; file_store . put ( use... | Change a user s password . |
14,365 | public User getUser ( String username ) throws AuthenticationException { String user = file_store . getProperty ( username ) ; if ( user == null ) { throw new AuthenticationException ( "User '" + username + "' not found." ) ; } user_object = new InternalUser ( ) ; user_object . init ( username ) ; return user_object ; ... | Returns a User object if the implementing class supports user queries without authentication . |
14,366 | public List < User > searchUsers ( String search ) throws AuthenticationException { String [ ] users = file_store . keySet ( ) . toArray ( new String [ file_store . size ( ) ] ) ; List < User > found = new ArrayList < User > ( ) ; for ( int i = 0 ; i < users . length ; i ++ ) { if ( users [ i ] . toLowerCase ( ) . cont... | Returns a list of users matching the search . |
14,367 | public Map < String , Object > getServerProperties ( ) { Map < String , Object > properties = super . getServerProperties ( ) ; return BaseDatabase . addDBProperties ( properties , this , null ) ; } | Get the base properties to pass to the server . |
14,368 | public String getResourceClassName ( String strBasePackage , String resourceName ) { if ( resourceName == null ) resourceName = strBasePackage . substring ( strBasePackage . lastIndexOf ( '.' ) + 1 ) ; strBasePackage = strBasePackage . substring ( 0 , strBasePackage . lastIndexOf ( '.' ) + 1 ) ; resourceName = Utility ... | Given a class name in the program package get this resource s class name in the res package . |
14,369 | public static long calculateOffsetInMs ( int intervalInMinutes , int offsetInMinutes ) { while ( offsetInMinutes < 0 ) { offsetInMinutes = intervalInMinutes + offsetInMinutes ; } while ( offsetInMinutes > intervalInMinutes ) { offsetInMinutes -= intervalInMinutes ; } return offsetInMinutes * MINUTE_IN_MS ; } | Reformulates negative offsets or offsets larger than interval . |
14,370 | public static void updateLookAndFeel ( Container container , PropertyOwner propertyOwner , Map < String , Object > properties ) { String lookAndFeelClassName = ScreenUtil . getPropery ( ScreenUtil . LOOK_AND_FEEL , propertyOwner , properties , null ) ; if ( lookAndFeelClassName == null ) lookAndFeelClassName = ScreenUt... | Set the look and feel . |
14,371 | public static String getPropery ( String key , PropertyOwner propertyOwner , Map < String , Object > properties , String defaultValue ) { String returnValue = null ; if ( propertyOwner != null ) returnValue = propertyOwner . getProperty ( key ) ; if ( properties != null ) if ( returnValue == null ) returnValue = ( Stri... | A utility to get the property from the propertyowner or the property . |
14,372 | public static void setProperty ( String key , String value , PropertyOwner propertyOwner , Map < String , Object > properties ) { if ( propertyOwner != null ) { propertyOwner . setProperty ( key , value ) ; } if ( properties != null ) { if ( value != null ) properties . put ( key , value ) ; else properties . remove ( ... | A utility to set the property from the propertyowner or the property . |
14,373 | public static Frame getFrame ( Component component ) { while ( component != null ) { if ( component instanceof Frame ) return ( Frame ) component ; component = component . getParent ( ) ; } return null ; } | Get the frame for this component . |
14,374 | public static void setEnabled ( Component component , boolean bEnabled ) { if ( component instanceof JPanel ) { for ( int i = 0 ; i < ( ( JPanel ) component ) . getComponentCount ( ) ; i ++ ) { JComponent componentSub = ( JComponent ) ( ( JPanel ) component ) . getComponent ( i ) ; ScreenUtil . setEnabled ( componentSu... | Fake disable a control . |
14,375 | @ SuppressWarnings ( "ProhibitedExceptionDeclared" ) public void init ( ) throws Exception { final String configFileLocation = getConfigFileLocation ( ) ; T fileConfig = getEmptyConfig ( ) ; boolean fileExists = false ; log . info ( "Using {} as config file location" , configFileLocation ) ; try ( Reader reader = new B... | Exception thrown by method in library |
14,376 | public ConfigResponse < T > getConfigResponse ( ) { T config = this . config . get ( ) ; config = withoutDefaultLogin ( config ) ; if ( config instanceof PasswordsConfig < ? > ) { config = ( ( PasswordsConfig < T > ) config ) . withoutPasswords ( ) ; } return new ConfigResponse < > ( config , getConfigFileLocation ( ) ... | Returns the Config in a format suitable for revealing to users . |
14,377 | public void clearBuffer ( ) { super . clearBuffer ( ) ; if ( m_vector == null ) m_vector = new Vector < Object > ( ) ; else m_vector . removeAllElements ( ) ; m_iCurrentIndex = 0 ; } | Initialize the physical data buffer . |
14,378 | public List < T > fetchList ( int limit ) throws SQLException , InstantiationException , IllegalAccessException { ArrayList < T > result = new ArrayList < T > ( ) ; if ( primitive ) { for ( int i = 0 ; i < limit ; i ++ ) { if ( ! finished ) { result . add ( fetchSingleInternal ( ) ) ; next ( ) ; } else { break ; } } } ... | Fetches limited list of entities . |
14,379 | public List < T > fetchList ( ) throws SQLException , InstantiationException , IllegalAccessException { ArrayList < T > result = new ArrayList < T > ( ) ; if ( primitive ) { while ( ! finished ) { result . add ( fetchSinglePrimitiveInternal ( ) ) ; next ( ) ; } } else { while ( ! finished ) { result . add ( fetchSingle... | Fetches the whole list of entities . It will not stop until entire result set will end . |
14,380 | public T fetchSingle ( ) throws InstantiationException , IllegalAccessException , SQLException { if ( ! finished ) { T result = primitive ? fetchSinglePrimitiveInternal ( ) : fetchSingleInternal ( ) ; next ( ) ; return result ; } else { throw new SQLException ( "Result set don't have data for single fetch." ) ; } } | Fetches single entity being sure that it exists . Throws exception if there is no entity . |
14,381 | public T fetchSingleOrNull ( ) throws InstantiationException , IllegalAccessException , SQLException { if ( ! finished ) { T result = primitive ? fetchSinglePrimitiveInternal ( ) : fetchSingleInternal ( ) ; next ( ) ; return result ; } else { return null ; } } | Fetches single entity or null . |
14,382 | public void close ( boolean closeConnection ) throws SQLException { if ( closeConnection ) { resultSet . getStatement ( ) . getConnection ( ) . close ( ) ; } else { resultSet . close ( ) ; } finished = true ; } | Closes underlying result set and optionally the whole connection . |
14,383 | public void close ( ) { super . close ( ) ; try { if ( m_remoteDatabase != null ) { synchronized ( this . getSyncObject ( m_remoteDatabase ) ) { m_remoteDatabase . close ( ) ; } } } catch ( RemoteException ex ) { Utility . getLogger ( ) . warning ( "Remote close error: " + ex . getMessage ( ) ) ; ex . printStackTrace (... | Close the remote databases . |
14,384 | public RemoteDatabase getRemoteDatabase ( ) throws RemoteException { if ( m_remoteDatabase != null ) return m_remoteDatabase ; try { if ( this . getTableCount ( ) == 0 ) return null ; ClientTable table = ( ClientTable ) m_vTableList . get ( 0 ) ; RemoteTable tableRemote = table . getRemoteTable ( ) ; if ( tableRemote !... | Open the remote database . |
14,385 | public String getRemoteProperty ( String strProperty , boolean readIfNotCached ) { if ( m_remoteProperties == null ) if ( readIfNotCached ) { try { this . getRemoteDatabase ( ) ; } catch ( RemoteException e ) { e . printStackTrace ( ) ; } } if ( m_remoteProperties != null ) return ( String ) m_remoteProperties . get ( ... | Get this property from the remote database . This does not make a remote call it just return the property cached on remote db open . |
14,386 | public String getFakeRemoteProperty ( String strProperty ) { if ( SQLParams . EDIT_DB_PROPERTY . equalsIgnoreCase ( strProperty ) ) return SQLParams . DB_EDIT_NOT_SUPPORTED ; return null ; } | To keep from having to contact the remote database remote a property that will not effect the logic . |
14,387 | public void commit ( ) throws DBException { super . commit ( ) ; try { if ( this . getRemoteDatabase ( ) != null ) { synchronized ( this . getSyncObject ( this . getRemoteDatabase ( ) ) ) { this . getRemoteDatabase ( ) . commit ( ) ; } } } catch ( RemoteException ex ) { Utility . getLogger ( ) . warning ( "Remote commi... | Commit the transactions since the last commit . |
14,388 | public BaseMessage processMessage ( BaseMessage message ) { if ( message == null ) return null ; this . updateLogFiles ( message , true ) ; String strReturnQueueName = null ; if ( message . getMessageHeader ( ) instanceof TrxMessageHeader ) strReturnQueueName = ( String ) ( ( TrxMessageHeader ) message . getMessageHead... | Given the converted message for return do any further processing before returning the message . |
14,389 | public static String getPathForResource ( final String resourcePath ) { URL path = ResourceUtil . class . getResource ( resourcePath ) ; if ( path == null ) { path = ResourceUtil . class . getResource ( "/" ) ; File tmpFile = new File ( path . getPath ( ) , resourcePath ) ; return tmpFile . getPath ( ) ; } return path ... | Convert a resource path to an absolute file path . |
14,390 | public static File getFileForResource ( final String resourcePath ) { URL path = ResourceUtil . class . getResource ( resourcePath ) ; if ( path == null ) { path = ResourceUtil . class . getResource ( "/" ) ; return new File ( new File ( path . getPath ( ) ) , resourcePath ) ; } return new File ( path . getPath ( ) ) ;... | Convert a resource path to a File object . |
14,391 | public static String getResourceAsString ( final String resourcePath ) { File resource = getFileForResource ( resourcePath ) ; if ( ! resource . exists ( ) || resource . isDirectory ( ) ) { logger . error ( "Cannot read resource, does not exist" + " (or is a directory)." ) ; return "" ; } try { return FileUtils . readF... | Read the resource found at a specific path into a string . |
14,392 | public static InputStream getResourceAsStream ( final String resourcePath ) { File resource = getFileForResource ( resourcePath ) ; if ( ! resource . exists ( ) || resource . isDirectory ( ) ) { logger . error ( "Cannot read resource, does not exist" + " (or is a directory)." ) ; return new NullInputStream ( 0 ) ; } tr... | Read the resource found at the given path into a stream . |
14,393 | public SetBuilder < T > add ( T ... items ) { set . addAll ( Arrays . asList ( items ) ) ; return this ; } | Adds items to the set . |
14,394 | public int getPrintOptions ( ) throws DBException { int iHtmlOptions = HtmlConstants . HTML_DISPLAY ; if ( ( ( BaseGridScreen ) this . getScreenField ( ) ) . getEditing ( ) ) iHtmlOptions |= HtmlConstants . HTML_INPUT ; String strParamForm = this . getProperty ( HtmlConstants . FORMS ) ; if ( ( strParamForm == null ) |... | display this screen in html input format . |
14,395 | protected void readFileData ( final ParserData parserData , final BufferedReader br ) throws IOException { String line ; while ( ( line = br . readLine ( ) ) != null ) { parserData . addLine ( line ) ; } } | Reads the data from a file that is passed into a BufferedReader and processes it accordingly . |
14,396 | protected ParserResults processSpec ( final ParserData parserData , final ParsingMode mode , final boolean processProcesses ) { while ( parserData . getLines ( ) . peek ( ) != null ) { final String input = parserData . getLines ( ) . peek ( ) ; if ( isCommentLine ( input ) || isBlankLine ( input ) ) { parserData . setL... | Starting method to process a Content Specification string into a ContentSpec object . |
14,397 | protected ParserResults processNewSpec ( final ParserData parserData , final boolean processProcesses ) { final String input = parserData . getLines ( ) . poll ( ) ; parserData . setLineCount ( parserData . getLineCount ( ) + 1 ) ; try { final Pair < String , String > keyValuePair = ProcessorUtilities . getAndValidateK... | Process a New Content Specification . That is that it should start with a Title instead of a CHECKSUM and ID . |
14,398 | protected ParserResults processEditedSpec ( final ParserData parserData , final boolean processProcesses ) { final String input = parserData . getLines ( ) . poll ( ) ; parserData . setLineCount ( parserData . getLineCount ( ) + 1 ) ; try { final Pair < String , String > keyValuePair = ProcessorUtilities . getAndValida... | Process an Edited Content Specification . That is that it should start with a CHECKSUM and ID instead of a Title . |
14,399 | protected ParserResults processEitherSpec ( final ParserData parserData , final boolean processProcesses ) { try { final Pair < String , String > keyValuePair = ProcessorUtilities . getAndValidateKeyValuePair ( parserData . getLines ( ) . peek ( ) ) ; final String key = keyValuePair . getFirst ( ) ; if ( key . equalsIg... | Process Content Specification that is either NEW or EDITED . That is that it should start with a CHECKSUM and ID or a Title . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.