Package anvil.core

Examples of anvil.core.Any


    if (parameters.length < 1) {
      throw parametersMissing(context, "destroy");
    }
    Context ctx = getContext();
    try {
      Any param = parameters[0];
      if (param instanceof AnyName) {
        ctx.destroySubcontext((Name)param.toObject());
      } else {
        ctx.destroySubcontext(param.toString());
      }
    } catch (NamingException e) {
      throw context.exception(e);
    }
    return this;
View Full Code Here


    if (parameters.length < 1) {
      throw parametersMissing(context, "create");
    }
    Context ctx = getContext();

    Any param;
    Attributes attrs = null;

    if (parameters.length > 1) {
      param = parameters[1];
      if (param instanceof AnyAttributes) {
        attrs = (Attributes)param.toObject();
      }
    }

    try {
   
      if ((attrs != null) && (ctx instanceof DirContext)) {
        DirContext dirctx = (DirContext)ctx;
        param = parameters[0];
        if (param instanceof AnyName) {
          return new AnyNamingContext(
            dirctx.createSubcontext((Name)param.toObject(), attrs));
        } else {
          return new AnyNamingContext(
            dirctx.createSubcontext(param.toString(), attrs));
        }
      }

      param = parameters[0];
      if (param instanceof AnyName) {
        return new AnyNamingContext(
          ctx.createSubcontext((Name)param.toObject()));
      } else {
        return new AnyNamingContext(
          ctx.createSubcontext(param.toString()));
      }
     
    } catch (NamingException e) {
      throw context.exception(e);
    }
View Full Code Here

    if (parameters.length < 2) {
      throw parametersMissing(context, "rename");
    }
    Context ctx = getContext();
    try {
      Any param1 = parameters[0];
      Any param2 = parameters[1];
      if (param1 instanceof AnyName && param2 instanceof AnyName) {
        ctx.rebind((Name)param1.toObject(), (Name)param2.toObject());
      } else if (parameters[0].isString()) {
        ctx.rebind(param1.toString(), param2.toString());
      }
    } catch (NamingException e) {
      throw context.exception(e);
    }
    return this;
View Full Code Here

   
    try {
      switch(nparams) {
      case 2:
        {
          Any param = parameters[0];
          String[] attributes = AnyUtils.toStringArray(parameters[1]);
          if (param instanceof AnyName) {
            return new AnyAttributes(dirctx.getAttributes((Name)param.toObject(), attributes));
          } else {
            return new AnyAttributes(dirctx.getAttributes(parameters[0].toString(), attributes));
          }
        }

      case 1:
        {
          Any param = parameters[0];
          if (param instanceof AnyName) {
            return new AnyAttributes(dirctx.getAttributes((Name)param.toObject()));
          } else {
            return new AnyAttributes(dirctx.getAttributes(param.toString()));
          }
        }
       
      case 0:
        return new AnyAttributes(dirctx.getAttributes(""));
View Full Code Here

    if (parameters.length < 1) {
      throw parametersMissing(context, "modifyAttributes");
    }
   
    int i = 0;
    Any param;

    Name name = null;
    String sname = null;
    Attributes attributes = null;
    ModificationItem[] modifications = null;
    int modop = DirContext.REPLACE_ATTRIBUTE;
   
    for(; i<n; i++) {
      param = parameters[i];
      if (param instanceof AnyName) {
        name = (Name)param.toObject();
      } else if (param instanceof AnyAttributes) {
        attributes = (Attributes)param.toObject();
      } else if (param.isString()) {
        sname = param.toString();
      } else if (param.isInt()) {
        modop = param.toInt();
      } else if (param.isMap()) {
        break;
      } else {
        break;
      }
    }
View Full Code Here

  }


  public Any eval()
  {
    Any a = _child.eval();
    return Any.create(a.toString());
  }
View Full Code Here

  }
 
 
  public Any getRef()
  {
    Any result = _result;
    if (result == null) {
      synchronized(this) {
        if ((result = _result) != null) {
          return result;
        }
View Full Code Here

  }
 

  public Any eval()
  {
    Any a = _child.eval();
    return Any.create(a.toLong());
  }
View Full Code Here

    int minute = (int)unserializer.getLong();
    int second = (int)unserializer.getLong();
    int millis = (int)unserializer.getLong();
    unserializer.consume('s');
    String zone = unserializer.getUTF16String();
    Any cal = create(year, month, day, hour, minute, second, millis, zone);
    unserializer.register(cal);
    return cal;
  }
View Full Code Here

        boolean[] consumed = new boolean[n];
        int p = 0;
        for(int i=0; i<max; i++) {
          int argtype = function.getParameterType(i);
          String argname = function.getParameterName(i);
          Any argdefault = function.getParameterDefault(i);
          switch(argtype) {
          case CompilableFunction.PARAMETER_CONTEXT:
            break;
          case CompilableFunction.PARAMETER_ARRAY:
          case CompilableFunction.PARAMETER_ANYLIST:
View Full Code Here

TOP

Related Classes of anvil.core.Any

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.