/** * Removes empty lines before and after the content. * Called before every announcement. */ private void setTrimmedPreface(OrgFile file, String preface) { file.setPreface(OrgStringUtils.trimLines(preface)); } }
/** * Content (body). Text after the heading. * * @return the content text */ public String getContent() { return getContentObject().toString(); }
/** * Removes empty lines before and after the content. * Called before every announcement. */ private void trimContent(OrgHead head) { head.setContent(OrgStringUtils.trimLines(head.getContent())); }
public String toString(OrgParserSettings settings) { StringBuilder str = new StringBuilder(); OrgParserWriter parserWriter = new OrgParserWriter(settings); str.append(parserWriter.whiteSpacedFilePreface(file.getPreface())); for (OrgNodeInList nodeInList : headsInList) { str.append(parserWriter.whiteSpacedHead(nodeInList, file.getSettings().isIndented())); } return str.toString(); } }
public List<OrgRange> getTimestamps() { return getContentObject().getTimestamps(); }
public void setContent(String s) { getContentObject().set(s); }
public void appendContent(String s) { getContentObject().append(s); }
public boolean hasTimestamps() { return getContentObject().hasTimestamps(); }
private OrgContent getContentObject() { if (content == null) { content = new OrgContent(); } return content; }
public void addProperty(String name, String value) { if (properties == null) { properties = new OrgProperties(); } properties.put(name, value); }
/** * Closed time. * * @return closed time or {@code null} if not set */ public OrgRange getClosed() { if (hasClosed()) { return closed; } return null; }
/** * CLOCK time. * * @return clock time or {@code null} if not set */ public OrgRange getClock() { if (hasClock()) { return clock; } return null; }
/** * Scheduled time. * * @return scheduled time or {@code null} if not set */ public OrgRange getScheduled() { if (hasScheduled()) { return scheduled; } return null; }
/** * Deadline time. * * @return deadline time or {@code null} if not set */ public OrgRange getDeadline() { if (hasDeadline()) { return deadline; } return null; }
/** * Properties. * * @return list of properties */ public OrgProperties getProperties() { if (properties == null) { properties = new OrgProperties(); } return properties; }
public OrgFileSettings getSettings() { if (settings == null) { settings = new OrgFileSettings(); } return settings; }
/** * @return {@code true} if there is a text below heading, {@code false} otherwise */ public boolean hasContent() { return content != null && !content.isEmpty(); }
public String toString() { return OrgStringUtils.join(this, DELIMITER); } }
public boolean hasProperties() { return properties != null && !properties.isEmpty(); }
/** * @return the list of plain timestamps in this content text */ public List<OrgRange> getTimestamps() { if (timestamps == null) { timestamps = new ArrayList<>(); } if (dirty) { reparse(); } return timestamps; }