Seng 513 - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

Seng 513

Description:

Seng 513. piwilson_at_ucalgary.ca. www.cpsc.ucalgary.ca/~piwilson. Reflexion ... Can be called on any java object to get further information about the class. ... – PowerPoint PPT presentation

Number of Views:55
Avg rating:3.0/5.0
Slides: 7
Provided by: patrick144
Category:
Tags: reflexion | seng

less

Transcript and Presenter's Notes

Title: Seng 513


1
Seng 513
  • piwilson_at_ucalgary.ca
  • www.cpsc.ucalgary.ca/piwilson

2
Reflexion
  • Used to create/manipulate unknown types of
    objects.
  • IE creating a class from a string class name.

3
getClass()
  • Can be called on any java object to get further
    information about the class.
  • Returns a Class object.
  • Gives access to methods, properties etc.

4
Class.forName(String)
  • Creates a Class object by invoking the current
    class loader.
  • Ie Class.forName(java.lang.String) will return
    the String class.

5
Class.newInstance
  • Creates a new instance of the object (calls
    default constructor)

6
Application in Assignment
  • Read the class name from the server xml
    fileltwebservicegt
  • lturl-mappinggt/webservice.wbslt/url-mappinggt
  • ltclassgtserver.DefaultWebServicelt/classgt
  • lt/webservicegt
Write a Comment
User Comments (0)
About PowerShow.com