Examples of Any


Examples of anvil.core.Any

  private ModificationItem buildItem(Any item)
  {
    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

Examples of anvil.core.Any

    if (parameters.length < 1) {
      throw parametersMissing(context, "lookup");
    }
    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

Examples of anvil.core.Any

    if (parameters.length < 1) {
      throw parametersMissing(context, "lookupLink");
    }
    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

Examples of anvil.core.Any

    if (parameters.length < 1) {
      throw parametersMissing(context, "getNameParser");
    }
    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

Examples of anvil.core.Any

  }

 
  public Any eval()
  {
    Any a = _left.eval();
    Any b = _right.eval();
    return a.concat(b);
  }
View Full Code Here

Examples of anvil.core.Any

    if (parameters.length < 2) {
      throw parametersMissing(context, "parse");
    }
    Context ctx = getContext();
    try {
      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) {
      throw context.exception(e);
    }
  }
View Full Code Here

Examples of anvil.core.Any

      throw parametersMissing(context, "compose");
    }
    Context ctx = getContext();
    try {
      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

Examples of anvil.core.Any

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

    Any param;
    Object value = parameters[1].toObject();
    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)) {
        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;
      }

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

Examples of anvil.core.Any

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

    Any param;
    Object value = parameters[1].toObject();
    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)) {
        DirContext dirctx = (DirContext)ctx;
        param = parameters[0];
        if (param instanceof AnyName) {
          dirctx.rebind((Name)param.toObject(), value, attrs);
        } else {
          dirctx.rebind(param.toString(), value, attrs);
        }
        return this;
      }

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

Examples of com.sun.star.uno.Any

                    }
                    else
                    {
                        formulaToken = new FormulaToken();
                        formulaToken.OpCode = opCodePush.Token.OpCode;
                        formulaToken.Data = new Any(Type.STRING, token.image);
                    }

                    tokens.add(formulaToken);
                    token = tokenParser.getNextToken();
                }
                if ( brackets > 0 )
                {
                    final FormulaOpCodeMapEntry opCode = (FormulaOpCodeMapEntry) parserNames.get(")");
                    while ( brackets-- != 0 )
                    {
                        formula = formula.concat(")");
                        images.add(")");
                        tokens.add(opCode.Token);
                    }
                       
                }

                parser.parse(formula);
            } catch ( ParseException ex )
            {
                boolean found = false;
                // error occured so all token must be bad
                for (int i = 0; i < tokens.size(); i++)
                {
                    if ( !found && ex.currentToken != null && images.get(i).equals(ex.currentToken.image) )
                        found = true;
                    if ( found )
                    {
                        final FormulaToken dest = new FormulaToken();
                        dest.OpCode = ((FormulaOpCodeMapEntry) specialOpCodes.get(FormulaMapGroupSpecialOffset.BAD)).Token.OpCode;
                        dest.Data = new Any(Type.STRING, images.get(i));
                        tokens.remove(i);
                        tokens.add(i, dest);
                    }
                }
            } catch ( java.lang.Exception e )
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.