Examples of StringEntry


Examples of com.sun.java.util.jar.pack.ConstantPool.StringEntry

                    cp_Double_lo.putInt((int)(x >>> 0));
                }
                break;
            case CONSTANT_String:
                for (int i = 0; i < cpMap.length; i++) {
                    StringEntry e = (StringEntry) cpMap[i];
                    cp_String.putRef(e.ref);
                }
                break;
            case CONSTANT_Class:
                for (int i = 0; i < cpMap.length; i++) {
View Full Code Here

Examples of com.sun.tools.corba.se.idl.StringEntry

      SymtabEntry parmType = Util.typeOf (parm.type ());
      if (parmType instanceof StringEntry)
        if ((parm.passType () == ParameterEntry.In) ||
            (parm.passType () == ParameterEntry.Inout))
        {
          StringEntry string = (StringEntry)parmType;
          if (string.maxSize () != null)
          {
            stream.print (THREE_INDENT + "if (" + parm.name ());
            if (parm.passType () == ParameterEntry.Inout)
              stream.print (".value"); // get from holder
            stream.print (" == null || " + parm.name ());
            if (parm.passType () == ParameterEntry.Inout)
              stream.print (".value"); // get from holder
            stream.println (".length () > (" +
                Util.parseExpression (string.maxSize ()) + "))");
            stream.println (THREE_INDENT +
                "throw new org.omg.CORBA.BAD_PARAM (0," +
                " org.omg.CORBA.CompletionStatus.COMPLETED_NO);");
          }
        }
    }
    // end <d56554> in/inout string bounds check

    // Step 2  Load the parameters into the outputStream
    parms = m.parameters ().elements ();
    while (parms.hasMoreElements ())
    {
      ParameterEntry parm = (ParameterEntry)parms.nextElement ();
      if (parm.passType () == ParameterEntry.In)
        writeOutputStreamWrite(FOUR_INDENT, "$out", parm.name (), parm.type (),
            stream);
      else if (parm.passType () == ParameterEntry.Inout)
        writeOutputStreamWrite(FOUR_INDENT, "$out", parm.name () + ".value",
            parm.type (), stream);
    }

    // Step 2a.  Write the context parameter if necessary. <d59560>
    if (m.contexts ().size () > 0)
    {
      stream.println(FOUR_INDENT + "org.omg.CORBA.ContextList $contextList =" +
         "_orb ().create_context_list ();");

      for (int cnt = 0; cnt < m.contexts ().size (); cnt++)
      {
          stream.println(FOUR_INDENT +
             "$contextList.add (\"" + m.contexts (). elementAt (cnt) + "\");");
      }
      stream.println(FOUR_INDENT +
          "$out.write_Context ($context, $contextList);");
    }

    // Step 3 Invoke the method with the output stream
    stream.println (FOUR_INDENT + "$in = _invoke ($out);");

    SymtabEntry mtype = m.type ();
    if (mtype != null)
      Util.writeInitializer (FOUR_INDENT, "$result", "", mtype,
          writeInputStreamRead ("$in", mtype), stream);

    // Step 4  Read the inout/out values
    parms = m.parameters ().elements ();
    while (parms.hasMoreElements ())
    {
      ParameterEntry parm = (ParameterEntry)parms.nextElement ();
      if (parm.passType () != ParameterEntry.In)
      {
        if (parm.type () instanceof ValueBoxEntry)
        {
          ValueBoxEntry v = (ValueBoxEntry) parm.type ();
          TypedefEntry member =
              ((InterfaceState) v.state ().elementAt (0)).entry;
          SymtabEntry mType = member.type ();
          if (mType instanceof PrimitiveEntry)
            stream.println(FOUR_INDENT +  parm.name () +
                ".value = (" + writeInputStreamRead ("$in", parm.type ()) +
                ").value;");
          else
            stream.println(FOUR_INDENT +  parm.name () +
                ".value = " + writeInputStreamRead ("$in", parm.type ()) +";");
        }
        else
          stream.println (FOUR_INDENT +  parm.name () + ".value = " +
              writeInputStreamRead ("$in", parm.type ()) + ";");
      }
    }
    // Step 4.b.  Check string bounds <d56554 - klr>
    // begin <d56554> out/inout/return string bounds check
    parms = m.parameters ().elements ();
    while (parms.hasMoreElements ())
    {
      ParameterEntry parm = (ParameterEntry)parms.nextElement ();
      SymtabEntry parmType = Util.typeOf (parm.type ());
      if (parmType instanceof StringEntry)
        if ((parm.passType () == ParameterEntry.Out) ||
            (parm.passType () == ParameterEntry.Inout))
        {
          StringEntry string = (StringEntry)parmType;
          if (string.maxSize () != null)
          {
            stream.print (FOUR_INDENT + "if (" + parm.name () +
                ".value.length ()");
            stream.println ("         > (" +
                Util.parseExpression (string.maxSize ()) + "))");
            stream.println (FIVE_INDENT + "throw new org.omg.CORBA.MARSHAL(0,"+
                "org.omg.CORBA.CompletionStatus.COMPLETED_NO);");
          }
        }
    }
    if (mtype instanceof StringEntry)
    {
      StringEntry string = (StringEntry)mtype;
      if (string.maxSize () != null)
      {
        stream.println(FOUR_INDENT + "if ($result.length () > (" +
            Util.parseExpression (string.maxSize ()) + "))");
        stream.println (FIVE_INDENT + "throw new org.omg.CORBA.MARSHAL (0," +
            " org.omg.CORBA.CompletionStatus.COMPLETED_NO);");
      }
    }
    // end <d56554> out/inout/return string bounds check
View Full Code Here

Examples of com.sun.tools.corba.se.idl.StringEntry

      else
        stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_" + type.name () + "));");
    }
    else if (type instanceof StringEntry)
    {
      StringEntry s = (StringEntry)type;
      Expression e  = s.maxSize ();
      if (e == null)
        stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (" + Util.parseExpression (e) + "));");
     else
        stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (0));");
    }
View Full Code Here

Examples of com.sun.tools.corba.se.idl.StringEntry

    return type(index, indent, tcoffsets, name, entry, stream);
  } // helperType

  public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) {
    tcoffsets.set (entry);
    StringEntry stringEntry = (StringEntry)entry;
    String bound;
    if (stringEntry.maxSize () == null)
      bound = "0";
    else
      bound = Util.parseExpression (stringEntry.maxSize ());

    // entry.name() is necessary to determine whether it is a
    // string or wstring

    stream.println (indent
View Full Code Here

Examples of com.sun.tools.corba.se.idl.StringEntry

  {
  } // helperWrite

  public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
  {
    StringEntry string = (StringEntry)entry;
    String entryName = entry.name ();
    if (entryName.equals ("string"))
      stream.println (indent + name + " = istream.read_string ();");
    else if (entryName.equals ("wstring"))
      stream.println (indent + name + " = istream.read_wstring ();");
    if (string.maxSize () != null)
    {
      stream.println (indent + "if (" + name + ".length () > (" + Util.parseExpression (string.maxSize ()) + "))");
      stream.println (indent + "  throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);");
    }
    return index;
  } // read
View Full Code Here

Examples of com.sun.tools.corba.se.idl.StringEntry

    return index;
  } // read

  public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
  {
    StringEntry string = (StringEntry)entry;
    if (string.maxSize () != null)
    {
      stream.print (indent + "if (" + name + ".length () > (" + Util.parseExpression (string.maxSize ()) + "))");
      stream.println (indent + "  throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);");
    }
    String entryName = entry.name ();
    if (entryName.equals ("string"))
      stream.println (indent + "ostream.write_string (" + name + ");");
View Full Code Here

Examples of org.apache.maven.jxr.util.StringEntry

        //go through each word and then match them to the correct class if necessary.
        for ( int i = 0; i < words.length; ++i )
        {
            //each word
            StringEntry word = words[i];

            for ( int j = 0; j < packages.length; ++j )
            {
                //get the package from the PackageManager because this will hold
                //the version with the classes also.

                PackageType currentImport = packageManager.getPackageType( packages[j] );

                //the package here might in fact be null because it wasn't parsed out
                //this might be something that is either not included or is part
                //of another package and wasn't parsed out.

                if ( currentImport == null )
                {
                    continue;
                }

                //see if the current word is within the package

                //at this point the word could be a fully qualified package name
                //(FQPN) or an imported package name.

                String wordName = word.toString();

                if ( wordName.indexOf( "." ) != -1 )
                {
                    //if there is a "." in the string then we have to assume
                    //it is a package.
View Full Code Here

Examples of org.apache.maven.jxr.util.StringEntry

        //go through each word and then match them to the correct class if necessary.
        for ( int i = 0; i < words.length; ++i )
        {
            //each word
            StringEntry word = words[i];

            for ( int j = 0; j < packages.length; ++j )
            {
                //get the package from the PackageManager because this will hold
                //the version with the classes also.

                PackageType currentImport = packageManager.getPackageType( packages[j] );

                //the package here might in fact be null because it wasn't parsed out
                //this might be something that is either not included or is part
                //of another package and wasn't parsed out.

                if ( currentImport == null )
                {
                    continue;
                }

                //see if the current word is within the package

                //at this point the word could be a fully qualified package name
                //(FQPN) or an imported package name.

                String wordName = word.toString();

                if ( wordName.indexOf( "." ) != -1 )
                {
                    //if there is a "." in the string then we have to assume
                    //it is a package.
View Full Code Here

Examples of org.jscsi.target.settings.entry.StringEntry

            // the target must reply with TargetPortalGroupTag and should
            // append TargetAlias
            boolean normalSession = TextKeyword.NORMAL.equals(((StringEntry) getEntry(TextKeyword.SESSION_TYPE)).getStringValue());
            if (normalSession) {
                // check if proposed TargetName is correct
                final StringEntry targetNameEntry = (StringEntry) getEntry(TextKeyword.TARGET_NAME);
                final String targetName = targetNameEntry.getStringValue();
                if (targetName == null || // not declared
                !target.isValidTargetName(targetName)) // wrong name
                everythingOkay = false;

                // send TargetAlias
View Full Code Here

Examples of org.jscsi.target.settings.entry.StringEntry

    protected void initializeEntries () {

        /*
         * Determines type and use of the data digest.
         */
        entries.add(new StringEntry(new KeySet(TextKeyword.DATA_DIGEST),// keySet
        NegotiationType.NEGOTIATED,// negotiationType
        Use.LOPNS,// use
        NegotiationStatus.DEFAULT,// negotiationStatus
        new String[] { TextKeyword.NONE },// supportedValues,
        TextKeyword.NONE));// defaultValue

        /*
         * Determines type and use of the header digest.
         */
        entries.add(new StringEntry(new KeySet(TextKeyword.HEADER_DIGEST),// keySet
        NegotiationType.NEGOTIATED,// negotiationType
        Use.LOPNS,// use
        NegotiationStatus.DEFAULT,// negotiationStatus
        new String[] { TextKeyword.NONE },// supportedValues,
        TextKeyword.NONE));// defaultValue

        /*
         * Turns the target-to-initiator markers on or off.
         */
        entries.add(new BooleanEntry(new KeySet(TextKeyword.IF_MARKER),// keySet
        Use.LOPNS,// use
        NegotiationStatus.DEFAULT,// negotiationStatus
        false,// negotiationValue
        BooleanResultFunction.AND,// resultFunction
        false));// defaultValue

        /*
         * Interval value (in 4-byte words) for target-to-initiator markers. The interval is measured from the end of
         * one marker to the beginning of the next one. The offer can have only a range; the response can have only a
         * single value (picked from the offered range) or Reject. Will always be Irrelevant.
         */
        entries.add(new NumericalRangeEntry(new KeySet(TextKeyword.IF_MARK_INT),// keySet
        Use.LOPNS,// use
        NegotiationStatus.IRRELEVANT,// negotiationStatus
        2048,// negotiationValue
        NumericalValueRange.create(1, 65535),// protocolValueRange
        2048));// defaultValue

        /*
         * The maximum amount of data that either the initiator or the target can receive in any iSCSI PDU. Zero (don't
         * care) can be used. I&T can specify (declare) the Max they can receive. This is a connection- and direction-
         * specific parameter. The actual value used by the target will be min(This value, MaxBurstLength) for data-in
         * and solicited data-out data. Min(This value, FirstBurstLength) for unsolicited data.
         */
        entries.add(new NumericalEntry(new KeySet(TextKeyword.MAX_RECV_DATA_SEGMENT_LENGTH),// keySet
        NegotiationType.DECLARED,// negotiationType
        Use.LOPNS_AND_FFP,// use
        NegotiationStatus.DEFAULT,// negotiationStatus
        8192,// negotiationValue (default value, will be used if I sends
             // 0)
        NumericalValueRange.create(512, 16777215),// protocolValueRange
        // 512 to 2^24 - 1
        NumericalResultFunction.MIN,// resultFunction
        8192,// defaultValue, 8K
        true));// zeroMeansDontCare

        /*
         * Turns the initiator-to-target markers on or off.
         */
        entries.add(new BooleanEntry(new KeySet(TextKeyword.OF_MARKER),// keySet
        Use.LOPNS,// use
        NegotiationStatus.DEFAULT,// negotiationStatus
        false,// negotiationValue
        BooleanResultFunction.AND,// resultFunction
        false));// defaultValue

        /*
         * Interval value (in 4-byte words) for initiator-to-target markers. The interval is measured from the end of
         * one marker to the beginning of the next one. The offer can have only a range; the response can have only a
         * single value (picked from the offered range) or Reject. Will always be Irrelevant.
         */
        entries.add(new NumericalRangeEntry(new KeySet(TextKeyword.OF_MARK_INT),// keySet
        Use.LOPNS,// use
        NegotiationStatus.IRRELEVANT,// negotiationStatus
        2048,// negotiationValue
        NumericalValueRange.create(1, 65535),// protocolValueRange
        2048));// defaultValue

        /*
         * This entry is not used for Settings initialization, TargetName has a session-wide scope. This entry
         * intercepts the TargetName parameter the initiator has to declare at the beginning of normal sessions.
         */
        entries.add(new StringEntry(new KeySet(TextKeyword.TARGET_NAME),// keySet
        NegotiationType.DECLARED,// negotiationType
        Use.INITIAL,// use
        NegotiationStatus.NOT_NEGOTIATED,// negotiationStatus
        null,// supportedValues, anything goes
        null));// defaultValue
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.