Package org.jzkit.a2j.gen.AsnUseful

Examples of org.jzkit.a2j.gen.AsnUseful.EXTERNAL_type


        log.debug("Processing OtherInformationItem43_type");

        switch ( oit.information.which )
        {
          case information_inline44_type.externallydefinedinfo_CID:
            EXTERNAL_type et = (EXTERNAL_type)(oit.information.o);
            if ( et.direct_reference != null )
            {
              OIDRegisterEntry ent = reg.lookupByOID(et.direct_reference);
              log.debug("External with direct reference, oid="+ent.getName());
View Full Code Here


  private EXTERNAL_type encodeRecordForZ3950(InformationFragment fragment) {

    log.debug("encodeRecordForZ3950... encoding="+fragment.getFormatSpecification().getEncoding()+", schema="+fragment.getFormatSpecification().getSchema().toString());

    EXTERNAL_type rec = null;

    if ( fragment.getOriginalObject() instanceof Document ) {
      rec = new EXTERNAL_type();
      rec.direct_reference = reg.oidByName("xml");
      rec.encoding = new encoding_inline0_type();
      rec.encoding.which = encoding_inline0_type.octet_aligned_CID;
      try {
        Document d = (Document) fragment.getOriginalObject();
        log.debug("serialize "+d);
        OutputFormat format  = new OutputFormat( "xml","utf-8",false );
        format.setOmitXMLDeclaration(true);
        java.io.StringWriter  stringOut = new java.io.StringWriter();
        XMLSerializer serial = new XMLSerializer( stringOut,format );
        serial.setNamespaces(true);
        serial.asDOMSerializer();
        serial.serialize( d.getDocumentElement() );
        rec.encoding.o = stringOut.toString().getBytes("UTF-8");
      }
      catch( Exception e ) {
         e.printStackTrace();
         rec.encoding.o = new String(e.toString()).getBytes();
      }
    }
    else if ( fragment.getFormatSpecification().getEncoding().toString().equals("iso2709") ) {
      rec = new EXTERNAL_type();
      rec.direct_reference = reg.oidByName(fragment.getFormatSpecification().getSchema().toString());
      rec.encoding = new encoding_inline0_type();
      rec.encoding.which = encoding_inline0_type.octet_aligned_CID;
      rec.encoding.o = (byte[])(fragment.getOriginalObject());
    }
    else if ( fragment.getOriginalObject() instanceof String )
    {
      rec = new EXTERNAL_type();
      rec.direct_reference = reg.oidByName("sutrs");
      rec.encoding = new encoding_inline0_type();
      rec.encoding.which = encoding_inline0_type.single_asn1_type_CID;
      rec.encoding.o = fragment.toString();
    }
View Full Code Here

            CharSetandLanguageNegotiation_type charsetAndLangNegotiation = new CharSetandLanguageNegotiation_type();
            charsetAndLangNegotiation.which = CharSetandLanguageNegotiation_type.proposal_CID;
            charsetAndLangNegotiation.o = proposal;

            EXTERNAL_type externalType = new EXTERNAL_type();
            externalType.direct_reference = ProtocolOIDRegister.getInstance().oidByName("z_charset_neg_3");
            externalType.encoding = new encoding_inline0_type();
            externalType.encoding.which = encoding_inline0_type.single_asn1_type_CID;
            externalType.encoding.o = charsetAndLangNegotiation;
View Full Code Here

    public boolean decodes(NamePlusRecord_type record)
    {
        if (record.record.which == record_inline13_type.retrievalrecord_CID)
        {
            EXTERNAL_type externalType = (EXTERNAL_type) record.record.o;
            OIDRegisterEntry typeEntry = ProtocolOIDRegister.getInstance().lookupByOID(externalType.direct_reference);

            if (typeEntry != null)
            {
                String name = typeEntry.getName();
View Full Code Here

TOP

Related Classes of org.jzkit.a2j.gen.AsnUseful.EXTERNAL_type

Copyright © 2018 www.massapicom. 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.