Examples of checkType()


Examples of com.itextpdf.text.pdf.PdfDictionary.checkType()

    protected void convertToXObject(StructureObject item) throws IOException, DocumentException {
      PdfDictionary structElem = item.getStructElem();
      if (structElem == null)
        return;
      PdfDictionary dict = item.getObjAsDict();
      if (dict == null || !dict.checkType(PdfName.ANNOT))
        return;
      PdfDictionary ap = dict.getAsDict(PdfName.AP);
      if (ap == null)
        return;
      PdfNumber structParent = dict.getAsNumber(PdfName.STRUCTPARENT);
View Full Code Here

Examples of com.itextpdf.text.pdf.PdfDictionary.checkType()

        processStructElemKids(structElem, array.getAsIndirectObject(i), array.getDirectObject(i));
      }
      break;
    case PdfObject.DICTIONARY:
      PdfDictionary dict = (PdfDictionary)object;
      if (dict.checkType(PdfName.MCR)) {
        item = new StructureMCID(dict);
        add(item);
        LOGGER.info("Added " + item);
      } else if (dict.checkType(PdfName.OBJR)) {
        item = new StructureObject(structElem, ref, dict);
View Full Code Here

Examples of com.itextpdf.text.pdf.PdfDictionary.checkType()

      PdfDictionary dict = (PdfDictionary)object;
      if (dict.checkType(PdfName.MCR)) {
        item = new StructureMCID(dict);
        add(item);
        LOGGER.info("Added " + item);
      } else if (dict.checkType(PdfName.OBJR)) {
        item = new StructureObject(structElem, ref, dict);
        add(item);
        LOGGER.info("Added " + item);
      }
      else {
View Full Code Here

Examples of etch.bindings.java.msg.Message.checkType()

      int timeout = disableTimeout ? 0 : responseType.getTimeout();
      Mailbox.Element mbe = mb.read( timeout);
      if (mbe == null)
        throw new TimeoutException( "timeout waiting for "+responseType );
      Message rmsg = mbe.msg;
      rmsg.checkType( responseType );
      Object r = rmsg.get( responseType.getResponseField() );
      if (r instanceof Exception)
      {
        Exception e = (Exception) r;
        e.fillInStackTrace();
View Full Code Here

Examples of etch.bindings.java.msg.Message.checkType()

      21, 10, 44, -77, // x
      1, // tiny int = 1 (value)
      -127 // NONE
    };
    Message msg = bytes2msg( buf );
    msg.checkType( add );
    Assert.assertEquals( 3, msg.size() );
    Assert.assertEquals( 1, msg.get( x ) );
    Assert.assertEquals( 2, msg.get( y ) );
    Assert.assertEquals( msgid, msg.get( _mf__messageId ) );
   
View Full Code Here

Examples of etch.bindings.java.msg.Message.checkType()

      -122, // INT (value)
      59, -102, -54, 0,
      -127 // NONE
    };
    msg = bytes2msg( buf );
    msg.checkType( add );
    Assert.assertEquals( 3, msg.size() );
    Assert.assertEquals( 1000000000, msg.get( x ) );
    Assert.assertEquals( 2000000000, msg.get( y ) );
    Assert.assertEquals( msgid, msg.get( _mf__messageId ) );
  }
View Full Code Here

Examples of etch.bindings.java.msg.Message.checkType()

    byte[] bufx = msg2bytes( msg, stringTypeAndField );
//    dump( bufx );
    Message msg2 = bytes2msg( bufx );
   
//    System.out.println( "msg2 = "+msg2 );
    msg2.checkType( mt_foo );
    Assert.assertEquals( 1, msg2.size() );
    Assert.assertTrue( msg.containsKey( mf_x ) );
    Object y = msg2.get( mf_x );
   
    assertEquals( x, y );
View Full Code Here

Examples of etch.bindings.java.msg.Message.checkType()

      int timeout = disableTimeout ? 0 : responseType.getTimeout();
      Mailbox.Element mbe = mb.read( timeout);
      if (mbe == null)
        throw new TimeoutException( "timeout waiting for "+responseType );
      Message rmsg = mbe.msg;
      rmsg.checkType( responseType );
      Object r = rmsg.get( responseType.getResponseField() );
      if (r instanceof Exception)
      {
        Exception e = (Exception) r;
        e.fillInStackTrace();
View Full Code Here

Examples of etch.bindings.java.msg.Message.checkType()

  /** @throws Exception */
  @Test
  public void newMessage() throws Exception
  {
    Message msg = remote._newMessage( mt );
    msg.checkType( mt );
    assertSame( vf, msg.vf() );
  }

  /** @throws Exception */
  @Test
 
View Full Code Here

Examples of etch.bindings.java.msg.StructValue.checkType()

  @Test
  public void exportCustomValue_RuntimeException() throws Exception
  {
    Exception value = new NullPointerException();
    StructValue sv = vf.exportCustomValue( value );
    sv.checkType( vf.getType( "_Etch_RuntimeException" ) );
    assertEquals( 1, sv.size() );
    assertEquals( "java.lang.NullPointerException",
      sv.get( DefaultValueFactory._mf_msg ) );
  }
 
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.