@Override public Comment comment(final int line, final int col, final String str) { Comment c = new Comment(); c.text = str; return c; }
@Override public Comment comment(final int line, final int col, final String text) { return new Comment(text); }
static void logMessage(String message, Element parent) { logMessage(message); parent.addContent(new Comment(message)); } }
private Element writeDatasetScanUserDefined(String userDefName, String className, Object configObj) { Element userDefElem = new Element(userDefName, defNS); userDefElem.setAttribute("className", className); if (configObj != null) { if (configObj instanceof Element) userDefElem.addContent((Element) configObj); else userDefElem.addContent(new Comment("This class <" + className + "> not yet supported. This XML is missing configuration information (of type " + configObj.getClass().getName() + ").")); } return userDefElem; }
private Element writeDatasetScanUserDefined(String userDefName, String className, Object configObj) { Element userDefElem = new Element(userDefName, defNS); userDefElem.setAttribute("className", className); if (configObj != null) { if (configObj instanceof Element) userDefElem.addContent((Element) configObj); else userDefElem.addContent(new Comment("This class <" + className + "> not yet supported. This XML is missing configuration information (of type " + configObj.getClass().getName() + ").")); } return userDefElem; }
private Element writeDatasetScanUserDefined( String userDefName, String className, Object configObj ) { Element userDefElem = new Element( userDefName, defNS ); userDefElem.setAttribute( "className", className ); if ( configObj != null ) { if ( configObj instanceof Element ) userDefElem.addContent( (Element) configObj ); else userDefElem.addContent( new Comment( "This class <" + className + "> not yet supported. This XML is missing configuration information (of type " + configObj.getClass().getName() + ")." ) ); } return userDefElem; }
public void resetAllPasswordValues( final String comment ) { for ( final Iterator<SettingValueRecord> settingValueRecordIterator = new StoredValueIterator( false ); settingValueRecordIterator.hasNext(); ) { final SettingValueRecord settingValueRecord = settingValueRecordIterator.next(); if ( settingValueRecord.getSetting().getSyntax() == PwmSettingSyntax.PASSWORD ) { this.resetSetting( settingValueRecord.getSetting(), settingValueRecord.getProfile(), null ); if ( comment != null && !comment.isEmpty() ) { final XPathExpression xp = XPathBuilder.xpathForSetting( settingValueRecord.getSetting(), settingValueRecord.getProfile() ); final Element settingElement = ( Element ) xp.evaluateFirst( document ); if ( settingElement != null ) { settingElement.addContent( new Comment( comment ) ); } } } } final String pwdHash = this.readConfigProperty( ConfigurationProperty.PASSWORD_HASH ); if ( pwdHash != null && !pwdHash.isEmpty() ) { this.writeConfigProperty( ConfigurationProperty.PASSWORD_HASH, comment ); } }
namerElem.addContent( new Comment( tmpMsg ) );
/** * Creates a JDOM Element as defined in * <a href="http://jpos.org/minigl.dtd">minigl.dtd</a> */ public Element toXML () { Element e = new Element ("user"); e.addContent (new Comment ("id " +Long.toString (getId()))); e.addContent (new Element ("nick").setText (getNick())); e.addContent (new Element ("name").setText (getName())); Iterator iter = getPermissions().iterator(); while (iter.hasNext()) { GLPermission p = (GLPermission) iter.next(); if (p.getJournal() == null) e.addContent (new Element ("grant").setText (p.getName())); } return e; } public boolean equals(Object other) {
@Test public void testSnapshotThrowsNullPointerException1() throws Throwable { try { transactionManager.snapshot(100L, new Comment("testTransactionManagerText")); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { assertNull("ex.getMessage()", ex.getMessage()); assertNull("transactionManager.psp", transactionManager.psp); } }
private Element writeDatasetScanNamer(CrawlableDatasetLabeler namer) { Element namerElem = null; if (namer != null) { namerElem = new Element("namer", defNS); if (namer instanceof MultiLabeler) { for (CrawlableDatasetLabeler curNamer : ((MultiLabeler) namer).getLabelerList()) { Element curNamerElem; if (curNamer instanceof RegExpAndReplaceOnNameLabeler) { curNamerElem = new Element("regExpOnName", defNS); curNamerElem.setAttribute("regExp", ((RegExpAndReplaceOnNameLabeler) curNamer).getRegExp()); curNamerElem.setAttribute("replaceString", ((RegExpAndReplaceOnNameLabeler) curNamer).getReplaceString()); namerElem.addContent(curNamerElem); } else if (curNamer instanceof RegExpAndReplaceOnPathLabeler) { curNamerElem = new Element("regExpOnPath", defNS); curNamerElem.setAttribute("regExp", ((RegExpAndReplaceOnPathLabeler) curNamer).getRegExp()); curNamerElem.setAttribute("replaceString", ((RegExpAndReplaceOnPathLabeler) curNamer).getReplaceString()); namerElem.addContent(curNamerElem); } else { String tmpMsg = "writeDatasetScanNamer(): unsupported namer <" + curNamer.getClass().getName() + ">."; logger.warn(tmpMsg); namerElem.addContent(new Comment(tmpMsg)); } } } else { namerElem.addContent(writeDatasetScanUserDefined("crawlableDatasetLabelerImpl", namer.getClass().getName(), namer.getConfigObject())); } } return namerElem; }
public Document toXmlDocument() { DateFormat df = DateUtil.getDateFormat(DateUtil.IVOA_DATE_FORMAT, DateUtil.UTC); Namespace vosi = Namespace.getNamespace("vosi", VOSI.AVAILABILITY_NS_URI); Element eleAvailability = new Element("availability", vosi); Util.addChild(eleAvailability, vosi, "available", Boolean.toString(_status.isAvailable())); if (_status.getUpSince() != null) { Util.addChild(eleAvailability, vosi, "upSince", df.format(_status.getUpSince())); } if (_status.getDownAt() != null) { Util.addChild(eleAvailability, vosi, "downAt", df.format(_status.getDownAt())); } if (_status.getBackAt() != null) { Util.addChild(eleAvailability, vosi, "backAt", df.format(_status.getBackAt())); } if (_status.getNote() != null) { Util.addChild(eleAvailability, vosi, "note", _status.getNote()); } if (this._clientIP != null) { eleAvailability.addContent(new Comment(String.format("<clientip>%s</clientip>", this._clientIP))); } Document document = new Document(); document.addContent(eleAvailability); return document; }
private Element writeDatasetScanNamer(CrawlableDatasetLabeler namer) { Element namerElem = null; if (namer != null) { namerElem = new Element("namer", defNS); if (namer instanceof MultiLabeler) { for (CrawlableDatasetLabeler curNamer : ((MultiLabeler) namer).getLabelerList()) { Element curNamerElem; if (curNamer instanceof RegExpAndReplaceOnNameLabeler) { curNamerElem = new Element("regExpOnName", defNS); curNamerElem.setAttribute("regExp", ((RegExpAndReplaceOnNameLabeler) curNamer).getRegExp()); curNamerElem.setAttribute("replaceString", ((RegExpAndReplaceOnNameLabeler) curNamer).getReplaceString()); namerElem.addContent(curNamerElem); } else if (curNamer instanceof RegExpAndReplaceOnPathLabeler) { curNamerElem = new Element("regExpOnPath", defNS); curNamerElem.setAttribute("regExp", ((RegExpAndReplaceOnPathLabeler) curNamer).getRegExp()); curNamerElem.setAttribute("replaceString", ((RegExpAndReplaceOnPathLabeler) curNamer).getReplaceString()); namerElem.addContent(curNamerElem); } else { String tmpMsg = "writeDatasetScanNamer(): unsupported namer <" + curNamer.getClass().getName() + ">."; logger.warn(tmpMsg); namerElem.addContent(new Comment(tmpMsg)); } } } else { namerElem.addContent(writeDatasetScanUserDefined("crawlableDatasetLabelerImpl", namer.getClass().getName(), namer.getConfigObject())); } } return namerElem; }
curSelectorElem.addContent( new Comment( "Unknown selector type <" + curSelector.getClass().getName() + ">.") );
curSelectorElem.setAttribute("collection", curSelector.isApplyToCollectionDataset() ? "true" : "false"); } else curSelectorElem.addContent(new Comment("Unknown selector type <" + curSelector.getClass().getName() + ">."));
curSelectorElem.setAttribute("collection", curSelector.isApplyToCollectionDataset() ? "true" : "false"); } else curSelectorElem.addContent(new Comment("Unknown selector type <" + curSelector.getClass().getName() + ">."));
return new Comment(text);
elem.addContent (new Comment("id " + getId()) ); elem.addContent (new Element("name").setText (getName ())); elem.addContent (
public Document getDocument () throws SQLException, HibernateException { Document doc = new Document (); doc.setDocType (new DocType ("minigl", "http://jpos.org/dtd/minigl.dtd")); Element root = new Element ("minigl"); root.addContent ( new Comment ( "jPOS MiniGL export $" ) ); root.addContent (new Element ("create-schema")); addUsers (root); addCurrencies (root); addCharts (root); addJournals (root); addTransactions (root); doc.setRootElement (root); return doc; }
final Comment comment = new Comment( generateCommentText() ); rootElement.addContent( 0, comment );