How to "get object" -- ResourceBundle

According to the ResourceBundle API:
ResourceBundle myResources =  ResourceBundle.getBundle("MyResources");Besides getString, ResourceBundle also provides ... a generic getObject method for any other type of object. When using getObject, you'll have to cast the result to the appropriate type. For example:
int[] myIntegers = (int[]) myResources.getObject("intList");
{code}
Elsewhere,
+getBundle+ attempts to locate a property resource file.
Does it make sense/Is it possible to +getObject+ from a property resource file? If so, how is the object "expressed" in the property resource file?
For example, if the resource file looks like
1=Person
then the key 1 is associated with the String "Person"
If
[code]class Person {
String firstName;
String lastName;
... }[/code]
is it possible to associate "1" with a Person object, where firstName is "Foo" and lastName is "Bar"?
If so, how would it look in the property resource file?
Thanks in advance,
C                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

In the resource file, you can save the data like this:
numberofperson=2
firstname1=Foo
firstname2=dummyfirst
lastname1=Bar
lastname2=dummylast
For programming, you can code like this:
public class Person{
private String firstname;
private String lastname;
public Person(String firstname, String lastname){
this.firstname = firstname;
this.lastname = lastname;
int personNum = Integer.parseInt(myResources.getString("numberofperson"));
Person personArr[] = new Person[personNum];
for (int i=1; i<personNum; i++){
personArr[i] = new Person(myResources.getString("firstname"+i),myResources.getString("lastname"+i));
}

Similar Messages

  • How to get object key before load data into form?

    I need to get object key (e.g. ItemCode in Item Master Data From ,docEntry in A/R Invoice From) to calculate and do something  before data is loaded into this form .
    I try to use SAPbouiCOM.BusinessObjectInfo.objectKey as in this code.
    Private Sub oApp_FormDataEvent(ByRef pVal As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean) Handles oApp.FormDataEvent
           If pVal.FormTypeEx = "672" And pVal.BeforeAction = True And pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD Then
                   oApp.MessageBox(pVal.ObjectKey)
           End If
    End Sub
    But this fields doesn't valid under this condition (form DI help file).
    - The property returns an empty value in the before notification of the Load action (et_FORM_DATA_LOAD) triggered by a Find operation.
    How can I get this value(key)?

    Janos
    I can't do a calculation after data is loaded because what I'm going to do is that if the opening entry match my condition , the system will not let that user see that entry (bubbleEvent = False).
    I think when formDataEvent is triggered B1 know which entry are going to load because before this event is triggered we did one of following ways
    1. choose from "choose from list windows"
    2. enter docEntry or itemCode or cardCode  and then press Find Button
    3. press "next/previous record button"
    4. press linked button (orange arrow)
    Choice 3 and 4 can be done by retrieve data from BusinessObjectInfo.objectKey (I've tested and it return entry key that is going to open correctly).
    but 1 and 2 can't (it return empty as I mention before).
    thanks
    Edited by: daron tancharoen on Aug 5, 2008 2:34 PM

  • How to get Object Name

    hi
    i make a widget in flex for Captivate5.5, now i want to get my Object Name(widget->Animation->ObjectName) in flex , how can i get that name
    how can i get Object Name in Flex Dynamically....

    thnx Jim Leichliter for ur replay
    i'm using  http://blogs.adobe.com/captivate/2010/10/flex-based-widgets.html classes,

  • How to get object?

    Hi,
    I have a generic question on how to get the object if the all known is the name of
    the object (string).
    For instrance, if the name of the user is given, how can I get the DirectoyObject of
    that user so that I can call removeMember(DirectoryObject member) method to
    remove it.
    Similarly, if the name of grantee in ACE is given and reftype = 'name' in XML, how
    can I get the ACE object so that I can call
    removeAccessControlEntry (AccessControlEntry ace) method in AccessControlList
    class.
    Thanks.
    Jinren

    Jinren,
    oracle.ifs.common.Collection c = ifsSession.getDirectoryUserCollection();
    DirectoryUser user = (DirectoryUser)c.getItems("user");
    This is quite an expensive operation if you have an extremely large number of users.
    We did and we found this method unusable on an NT platform with anything over a few thousand users.
    What we do is use the SQL views on the iFS schema to look up the object id number.
    e.g.
    select user_id from ifs_users where name='bob';
    We do this with JDBC calls straight to the ifs schema.
    Once you have the user_id you can use the
    public PublicObject findPublicObjectById(java.lang.Long id)
    function in oracle.ifs.adk.filesystem.IfsFileSystem
    to get the PublicObject with that Id.
    You can then downcast the PublicObject to a DirectoryUser.
    Grubby, but FAST!
    Hope this helps.
    Paul

  • How to get objects necessary for transporting Business Content?

    Hi Experts,
    Small ques for u:
    I have installed 0FIAA_C11, 0FIAA_C12, 0FIAA_C13 for Asset Accounting in Dev system. Already the previous content 0FIAA_C04 was installed and transported to Quality system.
    Now I want to transport new content (0FIAA_C11, 0FIAA_C12, 0FIAA_C13) to Quality. But I guess since already some infoobjects were transported to quality, transport connection wud nt show me all necesary objects.
    <b>So how to get a list of all objects necessary</b> so that my req does nt fail while moving to production from quality.(I think req might not fail while goin from Dev ->quality).
    Thanks in advance!!
    Sorabh

    Hi Srini,
    I have already applied "Before setting". But the problem is I dont want to transport objects which are not relevant to me, but only those which are necessary for content described in previous mail.
    If we check the link provide by you " For activating an InfoSource, InfoObjects may also be necessary which are not contained in the InfoCube and have therefore not yet been collected. However, for these additional objects, the objects that come before them in the data flow are not collected.
    "  I am worried by about these.Some objects will be missing and some are in addition which are not all required, and we shud nt transport them.How to be sure tht transport will not fail and it is consistent as well?
    Thanks for replying!!
    Sorabh
    Message was edited by: sorabh arora

  • Any Pointers on how to get object list values and component values in iw32

    Hi,
    I have a requirement where whenever a user enters a creates(iw31) or changes(iw32) an order then we have to validate the materials entered by the user before saving the order.We have en interface structure for the transaction 'CAUFVD'.Which gives us the values of functional location and equipment entered under the Reference object.But we need to validate all the object list functional locations and also Order components enetered by the user.Can any one tell me how to get the values of all these fields entered by the user?
    And also I need to query Equipment Bill of Material.What does this equipment BOM refers to .Is it the equipments under Object list or something else.
    Please Help.
    Thanks

    Hi Anu
    There is a user exit that gets trigerred when you try to save a work order . The exit is 'EXIT_SAPLCOIH_009' . This exit has the structure CAUFVD_IMP which will give you all the order header values entered by the user.
    User exit 'EXIT_SAPLCOBT_001' will give all the values entered by the user including order components. Also check the package CO  amd see if there is any other function group suiting your requirement.
    hope this helps you.
    cheers
    shivika

  • How to get object which is created previously?

    Hi ,
    My question is that how to get reference of the object which is created previously using reflection API.
    that means,
    suppose i created one instance of class : ABC
    Class classAbc = Class.forname("ABC"); //load the class ABC.
    Object abcClassObject =classAbc.newInstance(); // create an instance of classABC.
    now how do i retrieve that object which is referred by ref. variable abcClassObject?
    expecting a favourable reply,
    Thanks & regards ,
    Swapnil

    My question is that how to get reference of the object which is created previously using reflection API.
    Object abcClassObject =classAbc.newInstance(); // create an instance of classABC.
    now how do i retrieve that object which is referred by ref. variable abcClassObject?abcClassObject is already a reference to it. Just use it. Nothing further required.

  • How to get object-path at runtime

    Hi, In my application paths of particular controls(radio buttons and links) get changed at runtime. Therefore I cant access those objects. It would be helpful if somebody guide me how to get paths of objects(controls) at runtime. To be more specific following are the paths procured on different time ie. on different runs.
    "window(name='incident173747')[1].window(name='ifrmTabWindow')[1].input(name='generateQuote')[1]"
    "window(name='incident173750')[1].window(name='ifrmTabWindow')[1].input(name='generateQuote')[1]"
    One can see only first window name is changed here.In first case it is :
    name='incident173747'
    while in the second one it's:
    name='incident173750'

    Hi Vivek555,
    How do you know which radio button or link you want to click on? If each one is called generateQuote, what is in on the page that says "This is the one I want to click on".
    Please give a snippet of the html for the page so that we can help you out.
    Thanks,
    Kevin Gehrke
    Empirix, Inc.

  • How to get OBJECT for FI Doc number?

    HI Experts,
    I want to use FM NUMBER_GET_NEXT to get the next doc number for FI document, But there have a parameters in this FM is OBJECT, can any friends tell me how to get this parameters for FI doc?? Thanks in advance and your be rewarded once it is helpful.

    Hey Joe,
    The object and other details are configured in the transaction  'SAP number Ranges'' SNRO.
    I do not know under what circumstances you want to use the FM 'GET_NUMBER_NEXT' but doing this will increase the current number in the number range by 1.
    If you are planning to pre determine what is the number of the FI document that will be created, then this is not the right solution.

  • How to get Object key name

    var obj:Object = {a:"foo", b:"bar"}
    obj.a // foo keya=a value='foo'
    obj.b // bar keya=b value="bar"
    for each (var value:Object in obj){
    trace(value);
    Q: How can I get key from obj liking hash?

    var obj:Object = {a:"foo", b:"bar"}
    var retValue:String;
    for ( var key:* in obj)
    if ( obj[key] == "foo")
    retValue= key;
    break;
    return retValue;
    (you could of course return it straight from within the loop
    but thats not very good idea, so , you get the idea right?

  • SQL tracing and TKPROF tool, how to get object name

    Hi,
    I set sql_trace = ture for my session.
    Then I use TKPROF (on trace file) to get the explain plan (for my stored procedure). but the explain plan shows obj# (object number), HOW do I get TKPROF to show object name on explain plan (I have checked the SYBEX book, it has no info on that)?
    Also can you get explain plan from SQL (without sql_trace) for stored procs, if so HOW?
    Thanks

    SELECT
    SERVERPROPERTY('MachineName') AS [ServerName],
    SERVERPROPERTY('ServerName') AS [ServerInstanceName],
    SERVERPROPERTY('InstanceName') AS [Instance],
    SERVERPROPERTY('Edition') AS [Edition],
    SERVERPROPERTY('ProductVersion') AS [ProductVersion],
    Left(@@Version, Charindex('-', @@version) - 2) As VersionName
     |
    Blog: MSBICOE.com |
    MCITP - BI, SQL Developer & DBA
    Hate to mislead others, if I'm wrong slap me. Thanks!

  • How to Get object that a JPanel belongs to.

    I created an object that has a JPanel. When that JPanel is clicked, how can I get the object to which its a GUI data member of?

    Hi,
    If you try JPanel.getParent() it will return the Container that it is in.
    If what you want is the creator you can derive from JPanel and add a constructor that has the creator as its only parm.
      JPanel panel = new JPanel(this);
    public class MyPanel extends JPanel {
      Object myCreator;
      public JPanel(Object creator) {
         super();
         myCreator = creator;
    }Now you can use myCreator to access that class that created it.
    Paul

  • How to get object type and object key of bapi_acc_gl_posting_post

    Hi,
       I want to upload data from flat file to FB01 transaction using BAPI. For this i found bapi_acc_gl_posting_post. How should i get the obj type and object key for this bapi.
    Please let me know wether this is correct bapi for fb01 transaction.
    Thanks in advance,
    Regards,
    Sun.

    Hi,
       I want to upload data from flat file to FB01 transaction using BAPI. For this i found bapi_acc_gl_posting_post. How should i get the obj type and object key for this bapi.
    Please let me know wether this is correct bapi for fb01 transaction.
    Thanks in advance,
    Regards,
    Sun.

  • How to get object level security in Universe?

    Hi,
    I need to get the object level security for an Universe. I'm able to get the list of objects and its security access level (Public / Controlled / Restricted / Confidential / Private / )  from the (.Unv) file using the Designer SDK.
    But I need to get the list of users who has the object level security in the universe. In the CMC, by clicking the Universe and click on the Object Level Security tab, we can see the list of users there.
    I need to get the same using BOE SDK.
    I have used the following query to get the universe from the repository,
    "select * from ci_appobjects where si_kind='universe' "
    But I'm not able to get the list of users having obj. level security for that universe.
    Kindly help me to proceed.
    Thanks.

    The access security level is encapsulated in the SI_KIND='Overload' object. 
    Look for those types of objects, and the doc for the Overload class.
    An Overload references the Universe to which it's associated, and User/UserGroup objects are associated with the Overload via SecurityInfo.
    Sincerely,
    Ted Ueda

  • How to get object/instance name in method

    Hi folks,
    I have created a class and implemented a method within the class.
    Now i would like get the name of instance/object calling this method ,within this method.
    Is their any way to get this obj name within method?
    Eg:
    I hve class ZCL with method METH
    Now in some program i used this method, by creating any obj
              data obj type ref to ZCL
              obj->METH
    Now is there any way to get this obj name within the methodMETH by using some method like GET_OBJ_NAME(just making a guess)
    Regards
    PG

    >
    PG wrote:
    > Now is there any way to get this obj name within the methodMETH by using some method like GET_OBJ_NAME(just making a guess)
    >
    > Regards
    > PG
    Please check the below code snippet
      DATA:
        lref_obj TYPE REF TO cl_abap_typedescr.
      lref_obj ?= cl_abap_objectdescr=>describe_by_object_ref( me ).

Maybe you are looking for

  • The way how field exit gets called??????

    Hi ALL, Can any guru tell me how exactally the field exit works. Senario- I have created field exit on Data element WERKS_EXT for user validation on plant level for T-code VA01. Issue- I don't have proper user details in Dev. system to test this thin

  • Number jump while post capture excise through J1IEX

    Sir, My client is facing a problem when they capture excise for captical goods through J1IEX the number is jumper over 50 number while saving they want to avoid such insident and how to solve plz give the solution is there is any possible to get back

  • Where do I find the download of previous version of DreamWeaver (CC 2014 - NOT CC 2014.1).

    The new one has an annoying bug with the preferences that hangs DW when saving files... The Windows one! Nancy O. sent me the Mac link, but I need the Windows version... Thanks Pedro

  • BO Data Services的SDK相关资料在哪里下载

    首先我已经看了置顶贴,也到http://www.sdn.sap.com/irj/boc/sdklibrary找过了,没看到BODS相关的内容哈. 想要的资料是如何调用BODS的API,根据我定义的规则创建job,work flow,data flow,query等等. 因为目前开发的产品ETL流程很简单,大部分方法是相同的重复工作,因此想写一个ETL代码生成的工具. 在这里求助了,希望有好心人指点在哪里下载.

  • My Macbook pro charger has frayed. Is this covered by the warranty?

    Basically, my mac Charger cable has burned/frayed near the large white unit, and I was wondering if this is covered by the warranty? My warranty ends in a few days...