Package anvil.core

Examples of anvil.core.Any.toObject()


          if (param.isBinary()) {
            update(param.toBinary(), 0, param.sizeOf());

          } else if (param instanceof AnyFile) {
            update(context, (File)param.toObject());

          } else if (param instanceof AnyURL) {
            update((URL)param.toObject());

          } else {
View Full Code Here


          } else if (param instanceof AnyFile) {
            update(context, (File)param.toObject());

          } else if (param instanceof AnyURL) {
            update((URL)param.toObject());

          } else {
            byte[] bytes = anvil.util.Conversions.getBytes(param.toString());
            update(bytes, 0, bytes.length);
          }
View Full Code Here

    if (item.isMap()) {
      AnyMap map = item.toMap();
      int modop = map.getLeft().toInt();
      Any right = map.getRight();
      if (right instanceof AnyAttribute) {
        Attribute attr = (Attribute)right.toObject();
        return new ModificationItem(modop, attr);
      }
    } else {
      if (item instanceof AnyAttribute) {
        Attribute attr = (Attribute)item.toObject();
View Full Code Here

    }
    Context ctx = getContext();
    try {
      Any param = parameters[0];
      if (param instanceof AnyName) {
        return Any.create(ctx.lookup((Name)param.toObject()));
      } else {
        return Any.create(ctx.lookup(param.toString()));
      }
    } catch (NamingException e) {
      throw context.exception(e);
View Full Code Here

    }
    Context ctx = getContext();
    try {
      Any param = parameters[0];
      if (param instanceof AnyName) {
        return Any.create(ctx.lookupLink((Name)param.toObject()));
      } else {
        return Any.create(ctx.lookupLink(param.toString()));
      }
    } catch (NamingException e) {
      throw context.exception(e);
View Full Code Here

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

      Any param = parameters[0];
      String child = parameters[1].toString();
      AnyList list;
      if (param instanceof AnyName) {
        return new AnyName(ctx.getNameParser(
          (Name)param.toObject()).parse(child));
      } else {
        return new AnyName(ctx.getNameParser(
          param.toString()).parse(child));
      }
    } catch (NamingException e) {
View Full Code Here

      String prefix = parameters[1].toString();
      Any param1 = parameters[0];
      Any param2 = parameters[1];
      if (param1 instanceof AnyName && param2 instanceof AnyName) {
        return new AnyName(ctx.composeName(
          (Name)param1.toObject(), (Name)param2.toObject()));
      } else {
        return Any.create(ctx.composeName(param1.toString(), param2.toString()));
      }
    } catch (NamingException e) {
      throw context.exception(e);
View Full Code Here

    Attributes attrs = null;

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

    try {
      if ((attrs != null) && (ctx instanceof DirContext)) {
View Full Code Here

    try {
      if ((attrs != null) && (ctx instanceof DirContext)) {
        DirContext dirctx = (DirContext)ctx;
        param = parameters[0];
        if (param instanceof AnyName) {
          dirctx.bind((Name)param.toObject(), value, attrs);
        } else {
          dirctx.bind(param.toString(), value, attrs);
        }
        return this;
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.