Package com.cardence.lawshelf.cfr.adapters

Source Code of com.cardence.lawshelf.cfr.adapters.CfrTitleCodeAdapter

package com.cardence.lawshelf.cfr.adapters;

import com.cardence.lawshelf.cfr.CfrBaseCode;
import com.cardence.lawshelf.cfr.CfrContentContainer;
import com.cardence.lawshelf.cfr.jaxb.TITLE;

public class CfrTitleCodeAdapter extends CfrBaseCode {

  public CfrTitleCodeAdapter(TITLE title) {
    super(findHeading(title));
  }

  private static String findHeading(TITLE title) {
    CfrContentContainer hd = new CfrContentContainer();
    hd = findTitleText(hd, title);
    return hd.getContentText();
  }

  private static CfrContentContainer findTitleText(CfrContentContainer hd, TITLE title) {
    try {
      hd.addContent(title.getCFRTITLE().getTITLEHD().getHD());
    } catch (Exception e) {
      hd.addContent(title.getLRH());
    }
    return hd;
  }
}
TOP

Related Classes of com.cardence.lawshelf.cfr.adapters.CfrTitleCodeAdapter

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.