Package anvil.script

Examples of anvil.script.Type


  /// @synopsis Type lookupInherited(string name)
  /// @return Type or undefined, if there was not a declaration with that name
  public static final Object[] p_lookupInherited = { "name" };
  public Any m_lookupInherited(String name)
  {
    Type type = null;
    switch(_typecode) {
    case Type.CLASS:
      type = ((ClassType)_type).lookupInheritedDeclaration(name);
    case Type.INTERFACE:
      type = ((InterfaceType)_type).lookupInheritedDeclaration(name);
View Full Code Here


  public Any m_getBaseClass()
  {
    if (_typecode == Type.CLASS) {
      ClassRef ref = ((ClassType)_type).getBase();
      if (ref != null) {
        Type type = ref.getType();
        return (type != null) ? new AnyType(type) : UNDEFINED;
      }
    }
    return UNDEFINED;
  }
View Full Code Here

      refs = ((ClassType)_type).getInterfaces();
    } else if (_typecode == Type.INTERFACE) {
      refs = ((InterfaceType)_type).getBases();
    }
    if (refs != null) {
      Type type;
      int n = refs.length;
      Any[] list = new Any[n];
      for(int i=0; i<n; i++) {
        type = refs[i].getType();
        list[i] = (type != null) ? new AnyType(type) : UNDEFINED;
View Full Code Here

  /// Returns the pathinfo where this type is declared.
  /// If it is located on a library, returns the name of library.
  /// @synopsis string getPathinfo()
  public Any m_getPathinfo()
  {
    Type type = _type;
    while(type != null) {
      if (type instanceof Module) {
        return new AnyString(((Module)type).getPathinfo());
      }
      type = type.getParent();
    }
    return UNDEFINED;
  }
View Full Code Here

  /// Returns the url where this type is declared.
  /// If it is located on a library, undefined.
  /// @synopsis URL getURL()
  public Any m_getURL()
  {
    Type type = _type;
    while(type != null) {
      if (type instanceof Module) {
        URL url = ((Module)type).getAddress().getURL();
        if (url != null) {
          return new AnyURL(url);
        }
      }
      type = type.getParent();
    }
    return UNDEFINED;
 
View Full Code Here

  /// @method getModule
  /// Returns the script where this type is declared.
  /// @synopsis Type getModule()
  public Any m_getModule()
  {
    Type type = _type;
    while(type != null) {
      if (type instanceof Module) {
        return new AnyType(type);
      }
      type = type.getParent();
    }
    return UNDEFINED;
  }
View Full Code Here

  /// @synopsis Configurable getZone()
  /// @throws AccessDenied If security policy denies this operation.
  public Any m_getZone(Context context)
  {
    context.checkAccess(anvil.core.system.AnyConfigurable.CAN_READ);
    Type type = _type;
    while(type != null) {
      if (type instanceof Module) {
        Module script = (Module)type;
        Address addr = script.getAddress();
        if (addr != null) {
          return new anvil.core.system.AnyConfigurable(addr.getZone());
        }
      }
      type = type.getParent();
    }
    return UNDEFINED;
  }
View Full Code Here

  /// @method getClass
  /// Returns the class where this type is declared.
  /// @synopsis Type getClass()
  public Any m_getClass()
  {
    Type parent = _type.getParent();
    if (parent != null && parent.getType() == Type.CLASS) {
      return new AnyType(parent);
    }
    return UNDEFINED;
  }
View Full Code Here

  /// @method getParent
  /// Returns the parent type for this type.
  /// @synopsis Scope getParent()
  public Any m_getParent()
  {
    Type type = _type.getParent();
    if (type != null) {
      return new AnyType(type);
    }
    return UNDEFINED;
  }
View Full Code Here

    if (!(clazz instanceof AnyType)) {
      throw context.BadParameter("Type expected");
    }
    if (_typecode == Type.CLASS) {
      ClassType self = (ClassType)_type;
      Type other = (Type)clazz.toObject();
      return self.isInstanceOf(other) ? TRUE : FALSE;
    }
    return FALSE;
  }
View Full Code Here

TOP

Related Classes of anvil.script.Type

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.