Re: How to convert a string to an object reference?



Alois Haslinger wrote:
is there an easy way to convert a string to an object reference of
a well-known class?

Lew wrote:
Unless the "well-known" class has a "valueOf( String )" method or equivalent, you will have to parse the string and convert by your own code.

Is the "well-known" class part of the standard API or a custom class?

Or you could use a Map< String, WellKnown >.

--
Lew
.



Relevant Pages

  • Re: How to convert a string to an object reference?
    ... Alois Haslinger wrote: ... you will have to parse the string and convert by your own code. ... Is the "well-known" class part of the standard API or a custom class? ...
    (comp.lang.java.help)
  • Re: Help With PyParsing of output from win32pdhutil.ShowAllProcesses()
    ... None to a string). ... Still have an urge to parse with pyparsing? ... pyparsing Dict class. ... keys from the parsed data, so it looks like you are already thinking ...
    (comp.lang.python)
  • Re: Pyparsing help
    ... our grammar isn't parsing the METAL2 entry at all. ... input string". ... successful parse, then restored half of the entries I removed, until I ... Layer PRBOUNDARY ...
    (comp.lang.python)
  • Re: Nasty code...but please critique it anyway :-)
    ... You only need <string>, move all the other #includes to the C++ files. ... compilation times. ... You may want to use a std::stringstream to parse the integer, ... You may want to flush the output stream after printing menutext, ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Nasty code...but please critique it anyway :-)
    ... You only need <string>, move all the other #includes to the C++ files. ... compilation times. ... You may want to use a std::stringstream to parse the integer, ... You may want to flush the output stream after printing menutext, ...
    (comp.lang.cpp)