How to determine the object type?

Hi,
I got a method that is of the following signature:
Object result = method.invoke(object,args);The result can be any type from primitive types like double to class type.
How can I determine whether the result object is of what type?
I am thinking of using
(if result instanceof Double)
      //do something
}However, the method call invoke can return a primitive type double, so will the above method
(if result instanceodf Double) be called?
Thanks.

However, the method call invoke can return a primitive
type double, so will the above method
(if result instanceodf Double) be called?(result instanceof Double) will be true because quoting the javadocs for Method.invoke(): "if the value has a primitive type, it is first appropriately wrapped in an object."
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/reflect/Method.html#invoke(java.lang.Object,%20java.lang.Object[])

Similar Messages

  • How to determine the object in the tablespace

    Hi
    I have a problem with my database, How can i determine the object in the tablespace
    and how do move old tablespace into new tablespace and how to drop existing tablespace.
    Thanks

    Hi,
    If you want to find for all objects information, you can use dba_segments and filter this against the tablespace name. Once done you can create another tablespace and move the objects from old tablespace to new tablespace. Later you can drop the old tablepspace. You can use the below mention commands also:
    SELECT 'ALTER TABLE '|| table_name ||' MOVE TABLESPACE USERS;'
    FROM user_tables WHERE tablespace_name='MY_TableSpace';
    SELECT 'ALTER INDEX '|| index_name ||' REBUILD TABLESPACE USERS;'
    FROM user_indexes WHERE tablespace_name='MY_TableSpace';
    SELECT 'ALTER TABLE '|| table_name ||' MOVE LOB ('
    || column_name ||') STORE AS (TABLESPACE USERS);'
    FROM user_lobs WHERE tablespace_name='MY_TableSpace';
    On the other hand,
    You can also export a backup of the source tablespace and import into the target tablespace.
    Regards,
    XIC

  • How to determine the data type of  a text field

    hi,
    I have a text field, now i need to know what data type i have given?
    it may be numerical, string, date & boolean data type. when i write something after that it will determine the data type of the input text? is it possible in jsp? Is there anyone who can help me about this? Please help me
    With regards
    Bina

    javascript:
    function test(sample){
          if(sample==true || sample==false){
           alert('boolean')
          }else if(isNaN(sample)){
           alert('number')
          }else{
          alert('string')
        }

  • How to initialize the object type in pl/sql

    Hi,
    I am looking for an easy way to initialize the object type in pl/sql.
    I have created a object type with around 2 attributes.
    when ever i need to initialize the object ..need to pass:
    declare
    v_obj emp_obj;
    begin
    v_obj := emp_obj(null,null);
    then i can assign the values to object.
    Since I am having more than 50 attributes.. need to pass null to all the object attributes.
    is there any other way to initialize the object.
    thanking you in advance!!!

    RTFM [url http://oraclesvca2.oracle.com/docs/cd/B10501_01/appdev.920/a96594/adobjadv.htm#1008810]Advantages of User-Defined Constructors

  • How to determine the transaction type?

    Hello,
    I have a requirement to disable the user when the role string field on the usr form is empty. I set up a post update entity adapter to do that and it works fine.
    When I want to enable the user using the Enable button, the above post update entity adapter detects that the role string field is empty and the user is Active, it disables the user right back.
    So, I need to set up a pre-update entity adapter that can detect the type of transaction. If the transaction is to Enable the Xellerate User, then I will update the role string to a dummy value (as long as it's not empty) so that the Disable adapter doesn't get fired.
    Is this possible to do? Where can I find the transaction type information for a given Object?
    Thanks
    Khanh

    Thanks
    This is the information that i got :
    java version "1.4.2_07"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_07
    Java HotSpot(TM) Client VM (build 1.4.2_07-b05, mixed mode)
    from this i could make out that the jvm is client version,, but how do i determine which vendor has provided the jvm .

  • How to identify the object type in xpress

    In ui global.startdate is evalued with Date object type when use display class as DatePicker. After save, the global.startdate is String type. The other place in the code has use this global.startdate to convert to special date string. The problem is how to detect what data type the global.startdate is at one particular moment?

    In my case I do the following.
    1. Use the following rule to display the date in the desired format.
    <invoke name='dateToString' class='com.waveset.util.Util'>
    <ref>inputdate</ref>
    <s>MM-dd-yyyy</s>
    </invoke>
    At any point in time if one wants to know, one explicity needs to convert the java.util.Date obtained from datepicker using dateToString method in the Util class.
    2. When one wants to insert the date into the database then the following can be done.
         // First Convert the dates into appropriate formats
         SimpleDateFormat formater = new SimpleDateFormat("mm-dd-yyyy");
         java.sql.Date _startDate     = null;
         if(startdate != null) {
              java.util.Date parsedDate = formater.parse(startdate, new ParsePosition(0));
              _startDate = new java.sql.Date(parsedDate.getTime());
              System.out.println("_startDate::::"+_startDate);
         }

  • How to determine the MIME types of the files?

    I'm making an application, in which I've to upload the files to the database. Now I want to insert into the database the MIME type of the files. Now how can I know that which type of the file is having which MIME type?
    where can I get the list of all supported MIME types?
    Even if I get the list, then every time I update the file in the database, so every time I have to check the file extension and then insert the MIME type...
    this seems to be a tedioius job..
    Is there any simple way to do this?

    I could ask "supported by what?" but I assume you will
    be the one supporting them. Here's a link to the
    latest list of registered MIME types.HERE's the link...
    ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media-types

  • How to determine the file type in FTP

    What command code that should be sent to FTP server in order to identify if
    a given name (return from NLST command code) is a file, a folder, or even a link?
    Any help is greately appreciated.
    Thanks in advance,
    ferdieabtik

    user-exit for outbound COSMAS01
    Idoc extension

  • EEWB :  how to determine the business object and the extension type ?

    Hi,
    I ask myself how to determine the business object and the extension type to use to add new fields in a new tab of a specific transaction ? what means each business object, does that correspond to a specific transaction ?
    I need to add a new tab in the ‘BaMI’ business activity in transaction CRMD_ORDER just after the tab 'Actions' at header level.
    Could you help me please to determine which business object and extension type I have to select during creation of the project and which business object category I have to select during creation of the extension (wizard) ?
    Thanks for your help,
    Marie

    Marie,
    In order to determine what type of transaction you are extending, you will need to look at the customizing for the transaction.
    In the IMG:
    Goto:
    Customer Relationship Management->Transactions->Basic Settings->Define Transaction Types.
    You will then choose the transaction defined that you want to extend.  If you display the details of the transaction you will find an attribute called:
    "Leading Transaction Category".  This tells you the general context in which the transaction is used.  The other item to view is the assignment of business transaction categories found in the maintenance screen.
    This information general corresponds to one of the options that the EEWB will give you on the transaction type.
    As far as extensions go, my recommendation is the following:
    - Use CUSTOMER_H Customer Header Extensions for any new fields at the header level.
    - Use CUSTOMER_I Customer Item Extensions for any new fields at the item level.
    Unless you have a specific requirement to extend a segment of the transaction, I recommend placing all new fields in these segments.  The CUSTOMER_H & CUSTOMER_I segments are considered "standard" segments, that are already built into all the necessary API structures. 
    Let me know if you have any further questions.
    Good luck,
    Stephen

  • How to determine the type of the jobject... similar to instanceof

    hi,
    I would like to know how to determine the jobject reference of an instance is of which class.
    this is something similar to instanceof we use in java.
    is there any thing like 'instanceof' in JNI. if there how to use it?
    i got this as objective question for which answers were(i do not remember exactly)
    1.instanceof
    2.assignedto
    i could nt het much help in googling.
    thanks in advance

    Hi
    The JNI provides a native version to the java instanceof operator, this function takes two arguments
    an object refrence and a class refrence and reports JNI_TRUE.
    jclass myclass = env->FindClass("your class name");
    if(env->IsInstanceOf(obj,myclass) == JNI_TRUE)
    // obj is of type myclass
    }Regards
    pradish

  • Mailexample.sql how do you determine the file type?

    I'm using the mailexample.sql which explains how to use the demo_mail wrapper package for utl_smtp. There's a procedure for attaching text files and a procedure for attaching binary files. I've got binary files to attach to email successfully.
    How can I determine the file type so that I can use the attach_text procedure when attaching text files rather than the procedure for attaching binary files?
    Sandy

    Watch out! I think there is a bug in that code :-
    bug with PL/SQL Sample - maildemo.sql
    To answer your question - the usual way of determining a file type is to look for 'magic numbers' in the file that indicate its type. For example, Windows exe files often (always?) begin with the two letters 'MZ'. Zip files begin with 'PK'; Rar archives begin with 'Rar!'. Text files can begin with anything, and do not have any characteristic marker, but USASCII7 (which is what the format that routine is designed for - I think), is a characterset that only uses the first 7 bits of the byte. You could read the file, and if you find any bytes > 127, then you know it is not a USASCII7 file. I have seen various programs that 'sample' the first 64 or 256 bytes of a file instead of reading the whole file, and they usually get it right.
    Hope this helps.
    Takmeister

  • How to determine the proper size for Oracle 8i Data Base Objects

    Hi,
    I'm working on an Oracle 8i Data base. I'd like to know how to determine the proper size for the Data Base objects such as tables, datafiles, tablespaces...
    Thanks.

    Start with the docs.
    http://download-west.oracle.com/docs/cd/A87860_01/doc/server.817/a76956/schema.htm#949
    Best Regards
    Krystian Zieja / mob

  • How the system determines the Requirement type  for one sales order

    Hi,
    SAP-SD Gurus,
    Please tell me how the system determines the Requirement type  for one sales order?
    Thanks & Regards,
    Sreenivas.P

    Hi,
    System follows some search criterial to determine the requirement type
    1. First, an attempt is made to find a requirements type using the strategy group in the material master.
    2. If the strategy group has not been maintained, the system will determine it using the MRP group.
    3. If the MRP group has not been defined, the system uses the material type instead of the MRP group when accessing the corresponding control tables.
    4. If no requirements type is found here, the system assumes a special rule and attempts to find a requirements type with the aid of the item category and the MRP type.
    5. If this is not possible, a last attempt is made to find a requirements type with the item category only.
    6. If the last attempt fails, the system declares the transaction as not relevant for the availability check or transfer of requirements.
    Please check the path
    SPRO->SALES & DISTRIBUTIONS->BASIC FUNCTIONS>AVAILABILITY CHECK AND TOR->TRANSFER OF REQUIREMENTS--->DETERMINATION OF REQUIREMENT TYPE USING TRANSACTION.
    Hope it will clarify
    regards,
    santosh

  • How to Convert OBJECT_TYPE to the Object Type Used for DBMS_METADATA?

    How do you convert the object type in ALL_OBJECTS to the object type that DBMA_METADATA.GET_DDL expects?
    Thanks,
    Kurz

    maybe one needs to find a mapping between sys.metaview$ and all_objects:
    SQL> select type, xmltag, udt, viewname from sys.metaview$ where type like '%PACKAGE%'
    TYPE                      XMLTAG                    UDT                       VIEWNAME                
    DE_S_PACKAGE                                                                                          
    DE_S_COMP_PACKAGE                                                                                     
    DE_S_COMP_PACKAGE2                                                                                    
    DE_S_COMP_PACKAGE_SPEC                                                                                
    DE_S_PACKAGE_BODY1                                                                                    
    DE_S_PACKAGE_BODY                                                                                     
    SE_PACKAGE                                                                                            
    SE_COMP_PACKAGE                                                                                       
    SE_COMP_PACKAGE2                                                                                      
    SE_COMP_PACKAGE_SPEC                                                                                  
    SE_PACKAGE_BODY                                                                                       
    PACKAGE                   PACKAGE_T                 KU$_PROC_T                KU$_PKG_VIEW            
    PACKAGE                   PACKAGE_BODY_T            KU$_PROC_T                KU$_PKGBDY_VIEW         
    PACKAGE                   FULL_PACKAGE_T            KU$_FULL_PKG_T            KU$_FULL_PKG_VIEW       
    PACKAGE_SPEC              PACKAGE_T                 KU$_PROC_T                KU$_PKG_VIEW            
    PACKAGE_BODY              PACKAGE_BODY_T            KU$_EXP_PKG_BODY_T        KU$_EXP_PKG_BODY_VIEW   
    ALTER_PACKAGE_SPEC        ALTER_PACKAGE_SPEC_T      KU$_ALTER_PROC_T          KU$_ALTER_PKGSPC_VIEW   
    ALTER_PACKAGE_BODY        ALTER_PACKAGE_BODY_T      KU$_ALTER_PROC_T          KU$_ALTER_PKGBDY_VIEW   
    18 rows selected.

  • How to trigging a object event which the object type has two key fields

    Hi,kind guys
    I use the object type QMSM about qualification notification task,it has two key fiedls,qualification notification number and task number (can display by t-code -QM03), I want to trigging the event 'create' in  BOR 'QMSM ' by function SWE_EVENT_CREATE(or SAP_WAPI_event_create), but it only has one object key ,
    example:
    CALL FUNCTION 'SWE_EVENT_CREATE'
      EXPORTING
        OBJTYPE                       =  OBJTYPE
        OBJKEY                        =  OBJKEY " only one key
        EVENT                         =   EVENT
    but the BOR object 'QMSM' has two keys,so it cann't be trigged rightly.
    thanks for any help.

    You have to Concatenate the Business object keys and pass it in one variable OBJKEY.
    Thanks
    Arghadip

Maybe you are looking for

  • How do i get itunes to read my ipod touch

    how do i get itunes to read my ipod touch

  • Agent Encode error

    I run "agent.sh encode SUNOPSIS" and I get to see this error A JDK is required to execute Web Services with OracleDI. You are currently using a JRE. java.sql.SQLException: Driver must be specified at com.sunopsis.sql.SnpsConnection.a(SnpsConnection.j

  • Import after reinstalling on same computer doesn't work

    After a computer crash I reinstalled Thunderbird. Trying to import all the email addies, etc I get to a box that says something like "import from" and click next but nothing happens. What am I missing? Thanks for any suggestions.

  • What kind of card should I buy-- or do I really need to spend $300?

    Hi everyone-- I'm hoping for some suggestions. I have a 23" Apple Cinema Display HD -- I think it's the ADC connector (no power brick which is nice). I'm tired of the stock 9600 card and need a graphics boost. My needs are probably pretty limited. He

  • Yosemite 10.10.2 spinning wheel. Please help.

    Comptuer specs: MacBook Pro 13" 9,2 i5 10GB RAM 480GB OWC Mercury 6G SSD I've been running Yosemite for about 5 months and updated to 10.10.2 when it was released. I have had ZERO issues until March 5. I tried closing Photoshop CC 2014, and that's wh