public List<Link> getLinks( Link.type linkType ){ List<Link> result= new ArrayList<Link>(); for( Content c: ccl ) result.addAll( c.getLinks( linkType )); return result; }
public List<Link> getLinks(){ List<Link> result = new ArrayList<Link>(); for( Content c: ccl ) result.addAll( c.getLinks() ); return result; }
private static void handleContent( Content c, EnumMap<CIT, Boolean> hp, StringBuilder sb ){ if( hp != null ){ if( hp.get( CIT.TEXT )) sb.append( c.getText()+" " ); else{ if( hp.get( CIT.BOLD ) ) handleSpans( c.getFormatSpans( FormatType.BOLD), c.getText(), sb ); if( hp.get( CIT.ITALIC )) handleSpans( c.getFormatSpans( FormatType.ITALIC), c.getText(), sb ); } if( hp.get( CIT.LINK )) handleLinks( c.getLinks(), !hp.get( CIT.TEXT ), sb ); } }
public List<Link> getLinks( Link.type linkType, Span s){ List<Link> result = new ArrayList<Link>(); Span a = new Span( -1, -1 ); for( Content c: ccl ){ int offset = a.getEnd()+1; a = new Span( offset, offset+ c.length() ); if( a.hits(s) ) result.addAll( c.getLinks( linkType, s.clone().adjust( -offset ) ) ); } return result; }
for (Content curContent : curSection.getContentList()){ for (Link curLink : curContent.getLinks()){ if (curLink.getTarget().isEmpty()){ LOG.debug("Found link with empty target: \t" + xml + "\t text=" + curLink.getText());