EDOBE XDOM TAKE 6 IR - PRODUCTSHEET Spécifications Page 222

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 304
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 221
CHAPTER 8: ExtendScript Tools and Features ExtendScript reflection interface 222
Examples
This code determines the class name of an object:
obj = new String ("hi");
obj.reflect.name; // => String
This code gets a list of all methods:
obj = new String ("hi");
obj.reflect.methods; //=> indexOf,slice,...
obj.reflect.find ("indexOf"); // => the method info
This code gets a list of properties:
Math.reflect.properties; //=> PI,LOG10,...
This code gets the data type of a property:
Math.reflect.find ("PI").type; // => number
ReflectionInfo object
This object contains information about a property, a method, or a method argument.
X You can access ReflectionInfo objects in a Reflection object’s properties and methods arrays, by
name or index:
obj = new String ("hi");
obj.reflect.methods[0];
obj.reflect.methods["indexOf"];
X
You can access the ReflectionInfo objects for the arguments of a method in the arguments array of
the
ReflectionInfo object for the method, by index:
obj.reflect.methods["indexOf"].arguments[0];
obj.reflect.methods.indexOf.arguments[0];
Vue de la page 221
1 2 ... 217 218 219 220 221 222 223 224 225 226 227 ... 303 304

Commentaires sur ces manuels

Pas de commentaire