Examples of ArgType


Examples of com.ibm.icu.text.MessagePattern.ArgType

            }
            // We do not support parsing Plural formats. (No REPLACE_NUMBER here.)
            assert type==Part.Type.ARG_START : "Unexpected Part "+part+" in parsed message.";
            int argLimit=msgPattern.getLimitPartIndex(i);
           
            ArgType argType=part.getArgType();
            part=msgPattern.getPart(++i);
            // Compute the argId, so we can use it as a key.
            Object argId=null;
            int argNumber = 0;
            String key = null;
            if(args!=null) {
                argNumber=part.getValue()// ARG_NUMBER
                argId = Integer.valueOf(argNumber);
            } else {
                if(part.getType()==MessagePattern.Part.Type.ARG_NAME) {
                    key=msgPattern.getSubstring(part);
                } else /* ARG_NUMBER */ {
                    key=Integer.toString(part.getValue());
                }
                argId = key;
            }

            ++i;
            Format formatter = null;
            boolean haveArgResult = false;
            Object argResult = null;
            if(cachedFormatters!=null && (formatter=cachedFormatters.get(i - 2))!=null) {
                // Just parse using the formatter.
                tempStatus.setIndex(sourceOffset);
                argResult = formatter.parseObject(source, tempStatus);
                if (tempStatus.getIndex() == sourceOffset) {
                    pos.setErrorIndex(sourceOffset);
                    return; // leave index as is to signal error
                }
                haveArgResult = true;
                sourceOffset = tempStatus.getIndex();
            } else if(
                    argType==ArgType.NONE ||
                    (cachedFormatters!=null && cachedFormatters.containsKey(i - 2))) {
                // Match as a string.
                // if at end, use longest possible match
                // otherwise uses first match to intervening string
                // does NOT recursively try all possibilities
                String stringAfterArgument = getLiteralStringUntilNextArgument(argLimit);
                int next;
                if (stringAfterArgument.length() != 0) {
                    next = source.indexOf(stringAfterArgument, sourceOffset);
                } else {
                    next = source.length();
                }
                if (next < 0) {
                    pos.setErrorIndex(sourceOffset);
                    return; // leave index as is to signal error
                } else {
                    String strValue = source.substring(sourceOffset, next);
                    if (!strValue.equals("{" + argId.toString() + "}")) {
                        haveArgResult = true;
                        argResult = strValue;
                    }
                    sourceOffset = next;
                }
            } else if(argType==ArgType.CHOICE) {
                tempStatus.setIndex(sourceOffset);
                double choiceResult = parseChoiceArgument(msgPattern, i, source, tempStatus);
                if (tempStatus.getIndex() == sourceOffset) {
                    pos.setErrorIndex(sourceOffset);
                    return; // leave index as is to signal error
                }
                argResult = choiceResult;
                haveArgResult = true;
                sourceOffset = tempStatus.getIndex();
            } else if(argType.hasPluralStyle() || argType==ArgType.SELECT) {
                // No can do!
                throw new UnsupportedOperationException(
                        "Parsing of plural/select/selectordinal argument is not supported.");
            } else {
                // This should never happen.
View Full Code Here

Examples of jadx.core.dex.instructions.args.ArgType

        LiteralArg litArg = (LiteralArg) insn.getArg(0);
        if (res.getType().isObject()) {
          long lit = litArg.getLiteral();
          if (lit != 0) {
            // incorrect literal value for object
            ArgType type = lit == 1 ? ArgType.BOOLEAN : ArgType.INT;
            // can't merge with object -> force it
            litArg.setType(type);
            res.getSVar().setType(type);
            return true;
          }
        }
        return litArg.merge(res);

      case MOVE: {
        boolean change = false;
        if (insn.getResult().merge(insn.getArg(0))) {
          change = true;
        }
        if (insn.getArg(0).merge(insn.getResult())) {
          change = true;
        }
        return change;
      }

      case AGET:
        return fixArrayTypes(insn.getArg(0), insn.getResult());

      case APUT:
        return fixArrayTypes(insn.getArg(0), insn.getArg(2));

      case IF: {
        boolean change = false;
        if (insn.getArg(1).merge(insn.getArg(0))) {
          change = true;
        }
        if (insn.getArg(0).merge(insn.getArg(1))) {
          change = true;
        }
        return change;
      }

      // check argument types for overloaded methods
      case INVOKE: {
        boolean change = false;
        InvokeNode inv = (InvokeNode) insn;
        MethodInfo callMth = inv.getCallMth();
        MethodNode node = mth.dex().resolveMethod(callMth);
        if (node != null && node.isArgsOverload()) {
          List<ArgType> args = callMth.getArgumentsTypes();
          int j = inv.getArgsCount() - 1;
          for (int i = args.size() - 1; i >= 0; i--) {
            ArgType argType = args.get(i);
            InsnArg insnArg = inv.getArg(j--);
            if (insnArg.isRegister() && !argType.equals(insnArg.getType())) {
              insnArg.setType(argType);
              change = true;
            }
          }
        }
        return change;
      }

      case CHECK_CAST: {
        ArgType castType = (ArgType) ((IndexInsnNode) insn).getIndex();
        RegisterArg result = insn.getResult();
        // don't override generic types of same base class
        boolean skip = castType.isObject() && castType.getObject().equals(result.getType().getObject());
        if (!skip) {
          // workaround for compiler bug (see TestDuplicateCast)
          result.getSVar().setType(castType);
        }
        return true;
      }

      case PHI: {
        PhiInsn phi = (PhiInsn) insn;
        RegisterArg result = phi.getResult();
        SSAVar resultSVar = result.getSVar();
        if (resultSVar != null && !result.getType().isTypeKnown()) {
          for (InsnArg arg : phi.getArguments()) {
            ArgType argType = arg.getType();
            if (argType.isTypeKnown()) {
              resultSVar.setType(argType);
              return true;
            }
          }
        }
View Full Code Here

Examples of org.apache.cxf.binding.corba.wsdl.ArgType

            addCorbaReturn(corbaType, fqName, RETURN_PARAMETER);
        }
    }

    private void addCorbaReturn(CorbaTypeImpl corbaType, Scope fqName, String partName) {
        ArgType param = new ArgType();
        param.setName(partName);
        if (corbaType != null) {
            param.setIdltype(corbaType.getQName());
        } else {
            wsdlVisitor.getDeferredActions().
                add(fqName, new OperationDeferredAction(param));
        }
        corbaOperation.setReturn(param);
View Full Code Here

Examples of org.apache.cxf.binding.corba.wsdl.ArgType

        String name = GETTER_PREFIX + nameNode.toString();
        Operation op = generateOperation(name, inMsg, outMsg);
       
       
        // generate corba return param
        ArgType corbaReturn = generateCorbaReturnParam(typeNode);
       
        // generate corba operation
        OperationType corbaOp = generateCorbaOperation(op, null, corbaReturn);
       
        // generate binding
View Full Code Here

Examples of org.apache.cxf.binding.corba.wsdl.ArgType

       
        return result;
    }

    private ArgType generateCorbaReturnParam(AST type) {
        ArgType param = new ArgType();
        param.setName(RETURN_PARAM_NAME);

        ParamTypeSpecVisitor visitor = new ParamTypeSpecVisitor(getScope(),
                                                                definition,
                                                                schema,
                                                                wsdlVisitor);
        visitor.visit(type);
        CorbaTypeImpl corbaType = visitor.getCorbaType();
       
        if (corbaType != null) {
            param.setIdltype(corbaType.getQName());
        } else {
            wsdlVisitor.getDeferredActions().
                add(visitor.getFullyQualifiedName(), new AttributeDeferredAction(param));
        }
       
View Full Code Here

Examples of org.apache.cxf.binding.corba.wsdl.ArgType

        if (outputs.size() > 0) {
            ParamType d2 = (ParamType)outputs.get(0);

            if (d2.getMode().value().equals("out")) {
                ArgType argType = new ArgType();
                argType.setName(d2.getName());
                argType.setIdltype(d2.getIdltype());
                returns.add(argType);
                outputs.remove(0);
            }
        }
    }
View Full Code Here

Examples of org.apache.cxf.binding.corba.wsdl.ArgType

            skipWrap = false;
        }
    }

    protected void setCurrentTypeListener(QName name) throws XMLStreamException {
        ArgType param = params.get(paramCounter);
        QName idlType = param.getIdltype();
        if (!skipWrap || (name.getLocalPart().equals(param.getName()))) {
            currentTypeListener = CorbaHandlerUtils.getTypeListener(name, idlType, typeMap, orb, serviceInfo);
            currentTypeListener.setNamespaceContext(ctx);
            listeners[paramCounter] = currentTypeListener;
            paramCounter++;
        } else {
            throw new XMLStreamException("Expected element not found: " + param.getName()
                                         + " (Found " + name.getLocalPart() + ")");
        }
    }
View Full Code Here

Examples of org.apache.cxf.binding.corba.wsdl.ArgType

            skipWrap = false;
        }
    }

    protected void setCurrentTypeListener(QName name) throws XMLStreamException {
        ArgType param = params.get(paramCounter);
        QName idlType = param.getIdltype();
        if (!skipWrap || (name.getLocalPart().equals(param.getName()))) {
            currentTypeListener = CorbaHandlerUtils.getTypeListener(name, idlType, typeMap, orb, serviceInfo);
            currentTypeListener.setNamespaceContext(ctx);
            listeners[paramCounter] = currentTypeListener;
            paramCounter++;
        } else {
            throw new XMLStreamException("Expected element not found: " + param.getName()
                                         + " (Found " + name.getLocalPart() + ")");
        }
    }
View Full Code Here

Examples of org.apache.cxf.binding.corba.wsdl.ArgType

        if (outputs.size() > 0) {
            ParamType d2 = outputs.get(0);

            if (d2.getMode().value().equals("out")) {
                ArgType argType = new ArgType();
                argType.setName(d2.getName());
                argType.setIdltype(d2.getIdltype());
                returns.add(argType);
                outputs.remove(0);
            }
        }
    }
View Full Code Here

Examples of org.apache.cxf.binding.corba.wsdl.ArgType

        IdlAttribute attr;
        IdlDefn idlDef = intf.lookup(attrNm);

        if (idlDef == null) {
            if (name.startsWith("_get_")) {
                ArgType t = opType.getReturn();
                attr = IdlAttribute.create(intf, attrNm,
                                           findType(t.getIdltype()), true);                              
            } else {
                ParamType arg = opType.getParam().iterator().next();
                attr = IdlAttribute.create(intf, attrNm, findType(arg.getIdltype()), false);               
            }
            intf.addAttribute(attr);
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.