Package com.cardence.lawshelf.cfr

Examples of com.cardence.lawshelf.cfr.CfrContentContainer


  @SuppressWarnings("restriction")
  private String getSectionTitleTextFromSection() {
    for (Object obj : section.getSUBJECTOrAUTHOrAPPRO()) {
      if (obj instanceof SUBJECT) {
        final SUBJECT subject = (SUBJECT) obj;
        CfrContentContainer content = new CfrContentContainer();
        content.addContentList(subject.getContent());
        return content.getContentText();
      }
    }
    for (Object obj : section.getSUBJECTOrAUTHOrAPPRO()) {
      if (obj instanceof JAXBElement) {
        final JAXBElement jaxb = (JAXBElement) obj;
        if (StringUtils.equals("RESERVED", jaxb.getName().getLocalPart())) {
          CfrContentContainer content = new CfrContentContainer();
          content.addContent(jaxb.getValue().toString());
          return content.getContentText();
        }
      }
    }
    for (Object obj : section.getSUBJECTOrAUTHOrAPPRO()) {
      if (obj instanceof String) {
        CfrContentContainer content = new CfrContentContainer();
        content.addContent((String) obj);
        return content.getContentText();
      }
    }
    return null;
  }
View Full Code Here


  public CfrSubTitleSectionAdapter(SUBTITLE subTitle, String parentReference) {
    super(findHeading(subTitle), parentReference);
  }

  private static String findHeading(SUBTITLE subTitle) {
    final CfrContentContainer content = new CfrContentContainer();
    final HD hd = subTitle.getHD();
    if (hd == null) {
      final String alternativeText = subTitle.getRESERVED();
      if (alternativeText == null) {
        throw new RuntimeException("Could not find a header text for subtitle");
      }
      content.addContent(alternativeText);
    } else {
      content.addContent(hd);
    }

    return content.getContentText();
  }
View Full Code Here

  public CfrChapterSectionAdapter(CHAPTER chapter, String parentReference) {
    super(findHeading(chapter), parentReference);
  }

  private static String findHeading(CHAPTER chapter) {
    final CfrContentContainer content = new CfrContentContainer();
    final List<Object> unknownObjects = chapter.getContent();
    final HD hd = findHD(unknownObjects);
    if (hd == null) {
      final String alternativeText = findAlternativeToHD(unknownObjects);
      if (alternativeText == null) {
        throw new RuntimeException("Could not find a header text for chapter");
      }
      content.addContent(alternativeText);
    } else {
      content.addContent(hd);
    }

    return content.getContentText();
  }
View Full Code Here

    return null;
  }

  private static HD determineBestCanddiateHD(List<HD> candidates) {
    for (HD hd : candidates) {
      final CfrContentContainer content = new CfrContentContainer();
      content.addContent(hd);
      if (StringUtils.isNotBlank(content.getContentText())) {
        return hd;
      }
    }
    return null;
  }
View Full Code Here

    super(findHeading(subPart), null);
    this.sequenceFromCounting = sequenceFromCounting;
  }

  private static String findHeading(SUBPART subPart) {
    final CfrContentContainer content = new CfrContentContainer();
    final List<Object> unknownObjects = subPart.getSECTIONOrSECTNOOrSUBJECT();
    final HD hd = findHD(unknownObjects);
    if (hd == null) {
      final String alternativeText = findAlternativeToHD(unknownObjects);
      if (alternativeText == null) {
        throw new RuntimeException("Could not find a header text for subpart");
      }
      content.addContent(alternativeText);
    } else {
      content.addContent(hd);
    }

    return content.getContentText();
  }
View Full Code Here

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

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

    super(findHeading(part), null);
  }


  private static String findHeading(PART part){
    final CfrContentContainer content = new CfrContentContainer();
    final List<Object> unknownObjects = part.getContent();
    final HD hd = findHD(unknownObjects);
    if (hd == null) {
      final String alternativeText = findAlternativeToHD(unknownObjects);
      if (alternativeText == null) {
        throw new RuntimeException("Could not find a header text for part");
      }
      content.addContent(alternativeText);
    } else {
      content.addContent(hd);
    }

    return content.getContentText();
  }
View Full Code Here

  public CfrSubChapterSectionAdapter(SUBCHAP subChapter) {
    super(findHeading(subChapter), null);
  }

  private static String findHeading(SUBCHAP subChapter) {
    final CfrContentContainer content = new CfrContentContainer();
    final List<Object> unknownObjects = subChapter.getPRTPAGEOrRESERVEDOrHD();
    final HD hd = findHD(unknownObjects);
    if (hd == null) {
      final String alternativeText = findAlternativeToHD(unknownObjects);
      if (alternativeText == null) {
        throw new RuntimeException("Could not find a header text for subchapter");
      }
      content.addContent(alternativeText);
    } else {
      content.addContent(hd);
    }

    return content.getContentText();
  }
View Full Code Here

TOP

Related Classes of com.cardence.lawshelf.cfr.CfrContentContainer

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.