EDOBE XDOM TAKE 6 IR - PRODUCTSHEET Especificaciones Pagina 222

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 304
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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];
Vista de pagina 221
1 2 ... 217 218 219 220 221 222 223 224 225 226 227 ... 303 304

Comentarios a estos manuales

Sin comentarios