Examples of MethodType


Examples of org.apache.xalan.xsltc.compiler.util.MethodType

    /**
     * Add primops and base functions to the symbol table.
     */
    private void initSymbolTable() {
  MethodType I_V  = new MethodType(Type.Int, Type.Void);
  MethodType I_R  = new MethodType(Type.Int, Type.Real);
  MethodType I_S  = new MethodType(Type.Int, Type.String);
  MethodType I_D  = new MethodType(Type.Int, Type.NodeSet);
  MethodType R_I  = new MethodType(Type.Real, Type.Int);
  MethodType R_V  = new MethodType(Type.Real, Type.Void);
  MethodType R_R  = new MethodType(Type.Real, Type.Real);
  MethodType R_D  = new MethodType(Type.Real, Type.NodeSet);
  MethodType R_O  = new MethodType(Type.Real, Type.Reference);
  MethodType I_I  = new MethodType(Type.Int, Type.Int);
   MethodType D_O  = new MethodType(Type.NodeSet, Type.Reference);
  MethodType D_V  = new MethodType(Type.NodeSet, Type.Void);
  MethodType D_S  = new MethodType(Type.NodeSet, Type.String);
  MethodType D_D  = new MethodType(Type.NodeSet, Type.NodeSet);
  MethodType A_V  = new MethodType(Type.Node, Type.Void);
  MethodType S_V  = new MethodType(Type.String, Type.Void);
  MethodType S_S  = new MethodType(Type.String, Type.String);
  MethodType S_A  = new MethodType(Type.String, Type.Node);
  MethodType S_D  = new MethodType(Type.String, Type.NodeSet);
  MethodType S_O  = new MethodType(Type.String, Type.Reference);
  MethodType B_O  = new MethodType(Type.Boolean, Type.Reference);
  MethodType B_V  = new MethodType(Type.Boolean, Type.Void);
  MethodType B_B  = new MethodType(Type.Boolean, Type.Boolean);
  MethodType B_S  = new MethodType(Type.Boolean, Type.String);
  MethodType D_X  = new MethodType(Type.NodeSet, Type.Object);
  MethodType R_RR = new MethodType(Type.Real, Type.Real, Type.Real);
  MethodType I_II = new MethodType(Type.Int, Type.Int, Type.Int);
  MethodType B_RR = new MethodType(Type.Boolean, Type.Real, Type.Real);
  MethodType B_II = new MethodType(Type.Boolean, Type.Int, Type.Int);
  MethodType S_SS = new MethodType(Type.String, Type.String, Type.String);
  MethodType S_DS = new MethodType(Type.String, Type.Real, Type.String);
  MethodType S_SR = new MethodType(Type.String, Type.String, Type.Real);
  MethodType O_SO = new MethodType(Type.Reference, Type.String, Type.Reference);

  MethodType D_SS =
      new MethodType(Type.NodeSet, Type.String, Type.String);
  MethodType D_SD =
      new MethodType(Type.NodeSet, Type.String, Type.NodeSet);
  MethodType B_BB =
      new MethodType(Type.Boolean, Type.Boolean, Type.Boolean);
  MethodType B_SS =
      new MethodType(Type.Boolean, Type.String, Type.String);
  MethodType S_SD =
      new MethodType(Type.String, Type.String, Type.NodeSet);
  MethodType S_DSS =
      new MethodType(Type.String, Type.Real, Type.String, Type.String);
  MethodType S_SRR =
      new MethodType(Type.String, Type.String, Type.Real, Type.Real);
  MethodType S_SSS =
      new MethodType(Type.String, Type.String, Type.String, Type.String);

  /*
   * Standard functions: implemented but not in this table concat().
   * When adding a new function make sure to uncomment
   * the corresponding line in <tt>FunctionAvailableCall</tt>.
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.MethodType

  // Get the left and right operand types
  Type tleft = _left.typeCheck(stable);
  Type tright = _right.typeCheck(stable);

  // Check if the operator supports the two operand types
  MethodType wantType = new MethodType(Type.Void, tleft, tright);
  MethodType haveType = lookupPrimop(stable, Ops[_op], wantType);

  // Yes, the operation is supported
  if (haveType != null) {
      // Check if left-hand side operand must be type casted
      Type arg1 = (Type)haveType.argsType().elementAt(0);
      if (!arg1.identicalTo(tleft))
    _left = new CastExpr(_left, arg1);
      // Check if right-hand side operand must be type casted
      Type arg2 = (Type) haveType.argsType().elementAt(1);
      if (!arg2.identicalTo(tright))
    _right = new CastExpr(_right, arg1);
      // Return the result type for the operator we will use
      return _type = haveType.resultType();
  }
  throw new TypeCheckError(this);
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.MethodType

    public Type typeCheckStandard(SymbolTable stable) throws TypeCheckError {
  _fname.clearNamespace();   // HACK!!!

  final int n = _arguments.size();
  final Vector argsType = typeCheckArgs(stable);
  final MethodType args = new MethodType(Type.Void, argsType);
  final MethodType ptype =
      lookupPrimop(stable, _fname.getLocalPart(), args);

  if (ptype != null) {
      for (int i = 0; i < n; i++) {
    final Type argType = (Type) ptype.argsType().elementAt(i);
    final Expression exp = (Expression)_arguments.elementAt(i);
    if (!argType.identicalTo(exp.getType())) {
        try {
      _arguments.setElementAt(new CastExpr(exp, argType), i);
        }
        catch (TypeCheckError e) {
      throw new TypeCheckError(this)// invalid conversion
        }
    }
      }
      _chosenMethodType = ptype;
      return _type = ptype.resultType();
  }
  throw new TypeCheckError(this);
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.MethodType

    }
   
    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
  final Type tleft = _left.typeCheck(stable);
  final Type tright = _right.typeCheck(stable);
  final MethodType ptype = lookupPrimop(stable, Ops[_op],
                new MethodType(Type.Void,
                   tleft, tright));
  if (ptype != null) {
      final Type arg1 = (Type) ptype.argsType().elementAt(0);
      if (!arg1.identicalTo(tleft)) {
    _left = new CastExpr(_left, arg1);
      }
      final Type arg2 = (Type) ptype.argsType().elementAt(1);
      if (!arg2.identicalTo(tright)) {
    _right = new CastExpr(_right, arg1);
      }
      return _type = ptype.resultType();
  }
  throw new TypeCheckError(this);
    }
View Full Code Here

Examples of org.dmg.pmml._40.MethodType

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setMethod(MethodType newMethod) {
    MethodType oldMethod = method;
    method = newMethod == null ? METHOD_EDEFAULT : newMethod;
    boolean oldMethodESet = methodESet;
    methodESet = true;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, _40Package.NORM_DISCRETE_TYPE__METHOD, oldMethod, method, !oldMethodESet));
View Full Code Here

Examples of org.ogce.schemas.gfac.documents.MethodType

    ServiceMapType serviceMapType = DescriptionUtils.getServiceMapDocument(regService, stringQName);

    if (serviceMapType.getLifeTime() != null) {
      notAfterInactiveMinutes = serviceMapType.getLifeTime().getNotAfterInactiveMinutes();
    }
    MethodType method = GfacUtils.findOperationWithApplication(serviceMapType);
    ApplicationType appType = method.getApplication();
    ApplicationName appxbeanName = method.getApplication().getApplicationName();
    String appName = new QName(appxbeanName.getTargetNamespace(), appxbeanName.getStringValue()).toString();
    MethodBean methodBean = new MethodBean(method.getMethodName(), method.getMethodDescription(),
        method.isSetStageOutputDataFiles(), method.isSetForceFileStagingToWorkDir(),
        appType.isSetUseLEADNameListFile(), appType.isSetUseLEADNameListPropertiesFile());

    // Done to convert the parameter type of enum to string which was not
    // possible in JSF selectOneListbox. For inputText it works without
    // doing this change
    InputParameterType[] inputparams = method.getInputParameterArray();
    ServiceParam[] inparam = new ServiceParam[inputparams.length];

    for (int i = 0; i < inputparams.length; i++) {
      inparam[i] = new ServiceParam();
      InputParameterType inputParameterType = inputparams[i];
      inparam[i].paramName = inputParameterType.getParameterName();
      inparam[i].paramDesc = inputParameterType.getParameterDescription();
      inparam[i].paramValue = inputParameterType.getParameterType().toString();

    }
    // Done to convert the parameter type of enum to string which was not
    // possible in JSF selectOneListbox. For inputText it works without
    // doing this change
    OutputParameterType[] outparams = method.getOutputParameterArray();
    ServiceParam[] outparam = new ServiceParam[outparams.length];
    for (int i = 0; i < outparams.length; i++) {
      outparam[i] = new ServiceParam();
      OutputParameterType outputParameterType = outparams[i];
      outparam[i].paramName = outputParameterType.getParameterName();
View Full Code Here

Examples of org.ogce.schemas.gfac.documents.MethodType

      if (op == null) {
        throw new GfacException("Operation can not be Null", FaultCode.InvaliedLocalArgumnet);
      }

      MethodType[] methods = pt.getMethodArray();
      MethodType method = null;
      if (methods != null) {
        for (MethodType oldMethod : methods) {
          if (op.getMethodName().equals(oldMethod.getMethodName())) {
            method = oldMethod;
          }
        }
      }
      if (method == null) {
        method = pt.addNewMethod();
      }
      method.setMethodName(op.getMethodName());
      method.setMethodDescription(op.getMethodDescription());
      ApplicationType appType = method.getApplication();
      if (appType == null) {
        appType = method.addNewApplication();
      }
      appType.setParamValuesOnly(true);
      ApplicationName appNameType = appType.getApplicationName();
      if (appNameType == null) {
        appNameType = appType.addNewApplicationName();
      }
      QName appName = new QName(serviceInfo.getObjectNamespace(), serviceInfo.getApplicationName());
      appNameType.setStringValue(appName.getLocalPart());
      appNameType.setTargetNamespace(appName.getNamespaceURI());
      appType.setApplicationDescription(op.getMethodDescription());

      // Boolean parameters from Service screen
      if (op.isStageOutputDataFiles()) {
        method.setStageOutputDataFiles(true);
      }

      if (op.isForceFileStagingToWorkDir()) {
        method.setForceFileStagingToWorkDir(true);
      }

      if (op.isUseLEADNameListFile()) {
        appType.setUseLEADNameListFile(true);
      }

      if (op.isUseLEADNameListPropertiesFile()) {
        appType.setUseLEADNameListPropertiesFile(true);
      }

      InputParameterType[] inputs = method.getInputParameterArray();
      HashMap<String, InputParameterType> inputMap = new HashMap<String, InputParameterType>();
      if (inputs != null) {
        for (InputParameterType inputParameterType : inputs) {
          inputMap.put(inputParameterType.getParameterName(), inputParameterType);
        }
      }

      OutputParameterType[] outputs = method.getOutputParameterArray();
      HashMap<String, OutputParameterType> outputMap = new HashMap<String, OutputParameterType>();
      if (inputs != null) {
        for (OutputParameterType outputParameterType : outputs) {
          outputMap.put(outputParameterType.getParameterName(), outputParameterType);
        }
      }

      ArrayList<ParamObject> inputparams = op.getInputParms();
      for (int y = 0; y < inputparams.size(); y++) {
        ParamObject param = (ParamObject) inputparams.get(y);
        InputParameterType inputParm = inputMap.get(param.getName());
        if (inputParm == null) {
          inputParm = method.addNewInputParameter();
        }
        inputParm.setParameterName(param.getName());
        inputParm.setParameterDescription(param.getDesc());
        InputDataType.Enum type = InputDataType.Enum.forString(param.getType());
        inputParm.setParameterType(type);
      }

      ArrayList<ParamObject> outputparams = op.getOutputParms();
      for (int y = 0; y < outputparams.size(); y++) {
        ParamObject param = (ParamObject) outputparams.get(y);
        OutputParameterType outputParm = outputMap.get(param.getName());
        if (outputParm == null) {
          outputParm = method.addNewOutputParameter();
        }
        outputParm.setParameterName(param.getName());
        outputParm.setParameterDescription(param.getDesc());
        OutputDataType.Enum type = OutputDataType.Enum.forString(param.getType());
        outputParm.setParameterType(type);
View Full Code Here

Examples of org.ogce.schemas.gfac.documents.MethodType

      if (op == null) {
        throw new GfacException("Operation can not be Null", FaultCode.InvaliedLocalArgumnet);
      }

      MethodType[] methods = pt.getMethodArray();
      MethodType method = null;
      if (methods != null) {
        for (MethodType oldMethod : methods) {
          if (op.getMethodName().equals(oldMethod.getMethodName())) {
            method = oldMethod;
          }
        }
      }
      if (method == null) {
        method = pt.addNewMethod();
      }
      method.setMethodName(op.getMethodName());
      method.setMethodDescription(op.getMethodDescription());
      ApplicationType appType = method.getApplication();
      if (appType == null) {
        appType = method.addNewApplication();
      }
      appType.setParamValuesOnly(true);
      ApplicationName appNameType = appType.getApplicationName();
      if (appNameType == null) {
        appNameType = appType.addNewApplicationName();
      }
      QName appName = new QName(serviceInfo.getObjectNamespace(), serviceInfo.getApplicationName());
      appNameType.setStringValue(appName.getLocalPart());
      appNameType.setTargetNamespace(appName.getNamespaceURI());
      appType.setApplicationDescription(op.getMethodDescription());

      // Boolean parameters from Service screen
      if (op.isStageOutputDataFiles()) {
        method.setStageOutputDataFiles(true);
      }

      if (op.isForceFileStagingToWorkDir()) {
        method.setForceFileStagingToWorkDir(true);
      }

      if (op.isUseLEADNameListFile()) {
        appType.setUseLEADNameListFile(true);
      }

      if (op.isUseLEADNameListPropertiesFile()) {
        appType.setUseLEADNameListPropertiesFile(true);
      }

      InputParameterType[] inputs = method.getInputParameterArray();
      HashMap<String, InputParameterType> inputMap = new HashMap<String, InputParameterType>();
      if (inputs != null) {
        for (InputParameterType inputParameterType : inputs) {
          inputMap.put(inputParameterType.getParameterName(), inputParameterType);
        }
      }

      OutputParameterType[] outputs = method.getOutputParameterArray();
      HashMap<String, OutputParameterType> outputMap = new HashMap<String, OutputParameterType>();
      if (inputs != null) {
        for (OutputParameterType outputParameterType : outputs) {
          outputMap.put(outputParameterType.getParameterName(), outputParameterType);
        }
      }

      ArrayList<ParamObject> inputparams = op.getInputParms();
      for (int y = 0; y < inputparams.size(); y++) {
        ParamObject param = (ParamObject) inputparams.get(y);
        InputParameterType inputParm = inputMap.get(param.getName());
        if (inputParm == null) {
          inputParm = method.addNewInputParameter();
        }
        inputParm.setParameterName(param.getName());
        inputParm.setParameterDescription(param.getDesc());
        InputDataType.Enum type = InputDataType.Enum.forString(param.getType());
        inputParm.setParameterType(type);
      }

      ArrayList<ParamObject> outputparams = op.getOutputParms();
      for (int y = 0; y < outputparams.size(); y++) {
        ParamObject param = (ParamObject) outputparams.get(y);
        OutputParameterType outputParm = outputMap.get(param.getName());
        if (outputParm == null) {
          outputParm = method.addNewOutputParameter();
        }
        outputParm.setParameterName(param.getName());
        outputParm.setParameterDescription(param.getDesc());
        OutputDataType.Enum type = OutputDataType.Enum.forString(param.getType());
        outputParm.setParameterType(type);
View Full Code Here

Examples of org.ogce.schemas.gfac.documents.MethodType

      if (op == null) {
        throw new GFacSchemaException("Operation can not be Null");
      }

      MethodType[] methods = pt.getMethodArray();
      MethodType method = null;
      if (methods != null) {
        for (MethodType oldMethod : methods) {
          if (op.getMethodName().equals(oldMethod.getMethodName())) {
            method = oldMethod;
          }
        }
      }
      if (method == null) {
        method = pt.addNewMethod();
      }
      method.setMethodName(op.getMethodName());
      method.setMethodDescription(op.getMethodDescription());
      ApplicationType appType = method.getApplication();
      if (appType == null) {
        appType = method.addNewApplication();
      }
      appType.setParamValuesOnly(true);
      ApplicationName appNameType = appType.getApplicationName();
      if (appNameType == null) {
        appNameType = appType.addNewApplicationName();
      }
      QName appName = new QName(serviceInfo.getObjectNamespace(),
          serviceInfo.getApplicationName());
      appNameType.setStringValue(appName.getLocalPart());
      appNameType.setTargetNamespace(appName.getNamespaceURI());
      appType.setApplicationDescription(op.getMethodDescription());

      // Boolean parameters from Service screen
      if (op.isStageOutputDataFiles()) {
        method.setStageOutputDataFiles(true);
      }

      if (op.isForceFileStagingToWorkDir()) {
        method.setForceFileStagingToWorkDir(true);
      }

      if (op.isUseLEADNameListFile()) {
        appType.setUseLEADNameListFile(true);
      }

      if (op.isUseLEADNameListPropertiesFile()) {
        appType.setUseLEADNameListPropertiesFile(true);
      }

      InputParameterType[] inputs = method.getInputParameterArray();
      HashMap<String, InputParameterType> inputMap = new HashMap<String, InputParameterType>();
      if (inputs != null) {
        for (InputParameterType inputParameterType : inputs) {
          inputMap.put(inputParameterType.getParameterName(),
              inputParameterType);
        }
      }

      OutputParameterType[] outputs = method.getOutputParameterArray();
      HashMap<String, OutputParameterType> outputMap = new HashMap<String, OutputParameterType>();
      if (inputs != null) {
        for (OutputParameterType outputParameterType : outputs) {
          outputMap.put(outputParameterType.getParameterName(),
              outputParameterType);
        }
      }

      ArrayList<ParamObject> inputparams = op.getInputParms();
      for (int y = 0; y < inputparams.size(); y++) {
        ParamObject param = (ParamObject) inputparams.get(y);
        InputParameterType inputParm = inputMap.get(param.getName());
        if (inputParm == null) {
          inputParm = method.addNewInputParameter();
        }
        inputParm.setParameterName(param.getName());
        inputParm.setParameterDescription(param.getDesc());
        InputDataType.Enum type = InputDataType.Enum.forString(param
            .getType());
        inputParm.setParameterType(type);
      }

      ArrayList<ParamObject> outputparams = op.getOutputParms();
      for (int y = 0; y < outputparams.size(); y++) {
        ParamObject param = (ParamObject) outputparams.get(y);
        OutputParameterType outputParm = outputMap.get(param.getName());
        if (outputParm == null) {
          outputParm = method.addNewOutputParameter();
        }
        outputParm.setParameterName(param.getName());
        outputParm.setParameterDescription(param.getDesc());
        OutputDataType.Enum type = OutputDataType.Enum.forString(param
            .getType());
View Full Code Here

Examples of org.ogce.schemas.gfac.documents.MethodType

    if (serviceMapType.getLifeTime() != null) {
      notAfterInactiveMinutes = serviceMapType.getLifeTime()
          .getNotAfterInactiveMinutes();
    }
    MethodType method = findOperationWithApplication(serviceMapType);
    ApplicationType appType = method.getApplication();
    ApplicationName appxbeanName = method.getApplication()
        .getApplicationName();
    String appName = new QName(appxbeanName.getTargetNamespace(),
        appxbeanName.getStringValue()).toString();
    MethodBean methodBean = new MethodBean(method.getMethodName(), method
        .getMethodDescription(), method.isSetStageOutputDataFiles(),
        method.isSetForceFileStagingToWorkDir(), appType
            .isSetUseLEADNameListFile(), appType
            .isSetUseLEADNameListPropertiesFile());

    InputParameterType[] inputparams = method.getInputParameterArray();
    for (int index = 0; index < inputparams.length; index++) {

      InputParameterType inputParameterType = inputparams[index];
      methodBean.addInputParms(new ParamObject(inputParameterType
          .getParameterName(), inputParameterType.getParameterType()
          .toString(), index, inputParameterType
          .getParameterDescription()));

    }

    OutputParameterType[] outparams = method.getOutputParameterArray();
    for (int index = 0; index < outparams.length; index++) {

      OutputParameterType outputParameterType = outparams[index];
      methodBean.addOutputParms(new ParamObject(outputParameterType
          .getParameterName(), outputParameterType.getParameterType()
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.