Package org.nfctools.ndef

Examples of org.nfctools.ndef.RecordType


  private Map<RecordType, WellKnownRecordConfig> recordDecoders = new HashMap<RecordType, WellKnownRecordConfig>();

  @Override
  public boolean canDecode(NdefRecord ndefRecord) {
    if(NdefConstants.TNF_WELL_KNOWN == ndefRecord.getTnf()) {
      return recordDecoders.containsKey(new RecordType(ndefRecord.getType()));
    }
    return false;
  }
View Full Code Here


    return false;
  }

  @Override
  public WellKnownRecord decodeRecord(NdefRecord ndefRecord, NdefMessageDecoder messageDecoder) {
    WellKnownRecordConfig config = recordDecoders.get(new RecordType(ndefRecord.getType()));
    if (config != null) {
      WellKnownRecordPayloadDecoder payloadDecoder = config.getPayloadDecoder();
      WellKnownRecord record = payloadDecoder.decodePayload(ndefRecord.getPayload(), messageDecoder);
      record.setId(ndefRecord.getId());
      return record;
View Full Code Here

TOP

Related Classes of org.nfctools.ndef.RecordType

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.