本文整理了Java中org.jdom2.Element.getChildTextTrim()
方法的一些代码示例,展示了Element.getChildTextTrim()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getChildTextTrim()
方法的具体详情如下:
包路径:org.jdom2.Element
类名称:Element
方法名:getChildTextTrim
[英]Returns the trimmed textual content of the named child element, or null if there's no such child. See #getTextTrim()
for details of text trimming.
[中]返回命名子元素的修剪文本内容,如果没有这样的子元素,则返回null。有关文本修剪的详细信息,请参见#getTextTrim()
。
代码示例来源:origin: gocd/gocd
private void parseDOMTree(Document document) throws UnsupportedEncodingException {
Element infoElement = document.getRootElement();
Element entryElement = infoElement.getChild("entry");
String encodedUrl = entryElement.getChildTextTrim("url");
Element repositoryElement = entryElement.getChild("repository");
String root = repositoryElement.getChildTextTrim("root");
String encodedPath = StringUtils.replace(encodedUrl, root, "");
this.path = URLDecoder.decode(encodedPath, ENCODING);
this.root = root;
this.encodedUrl = encodedUrl;
}
代码示例来源:origin: jwpttcg66/NettyGameServer
public void load(Element element) throws DataConversionException {
name = element.getChildTextTrim("name");
id = element.getChildTextTrim("id");
ip = element.getChildTextTrim("ip");
port = Integer.valueOf(element.getChildTextTrim("port"));
}
}
代码示例来源:origin: jwpttcg66/NettyGameServer
public void load(Element element) throws DataConversionException {
super.load(element);
transferIp = element.getChildTextTrim("transfer-ip");
transferPort = Integer.valueOf(element.getChildTextTrim("transfer-port"));
// bossThreadSize = Integer.valueOf(element.getChildTextTrim("gate-thread-bosss"));
// workerThreadSize = Integer.valueOf(element.getChildTextTrim("gate-thread-worker"));
}
代码示例来源:origin: jwpttcg66/NettyGameServer
public void load(Element element) throws DataConversionException {
super.load(element);
updQueueMessageProcessWorkerSize = Integer.valueOf(element.getChildTextTrim("updQueueMessageProcessWorkerSize"));
udpMessageOrderQueueFlag = Boolean.valueOf(element.getChildTextTrim("udpMessageOrderQueueFlag"));
}
}
代码示例来源:origin: jwpttcg66/NettyGameServer
public void load(Element element) throws DataConversionException {
super.load(element);
handleThreadSize = Integer.valueOf(element.getChildTextTrim("handleThreadSize"));
ssl = Boolean.valueOf(element.getChildTextTrim("ssl"));
}
代码示例来源:origin: jwpttcg66/NettyGameServer
public void load(Element element) throws DataConversionException {
super.load(element);
handleThreadSize = Integer.valueOf(element.getChildTextTrim("handleThreadSize"));
}
代码示例来源:origin: org.codehaus.plexus/plexus-component-metadata
/**
* @param name The name of the child.
* @param ns {@link Namespace}
* @return the child text.
* @see org.jdom2.Element#getChildTextTrim(java.lang.String,org.jdom2.Namespace)
*/
public String getChildTextTrim( String name, Namespace ns )
{
return element.getChildTextTrim( name, ns );
}
代码示例来源:origin: org.codehaus.plexus/plexus-component-metadata
/**
* @param name The name of the child.
* @return the child text.
* @see org.jdom2.Element#getChildTextTrim(java.lang.String)
*/
public String getChildTextTrim( String name )
{
return element.getChildTextTrim( name );
}
代码示例来源:origin: NationalSecurityAgency/emissary
/**
* Like Element.getChildTextTrim but for a boolean
*/
public static boolean getChildBooleanValue(final Element el, final String childName) {
final String val = el.getChildTextTrim(childName);
return Boolean.parseBoolean(val);
}
代码示例来源:origin: jpos/jPOS
public void initAdaptor() {
Element persist = getPersist ();
sp = grabSpace (persist.getChild ("space"));
in = persist.getChildTextTrim ("in");
out = persist.getChildTextTrim ("out");
delay = 5000;
String s = persist.getChildTextTrim ("max-connections");
maxConnections = s!=null ? Integer.parseInt(s) : 1; // reasonable default
s = persist.getChildTextTrim ("max-connect-attempts");
maxConnectAttempts = s!=null ? Integer.parseInt(s) : 15; // reasonable default
}
public void startService () {
代码示例来源:origin: org.mycore/mycore-mods
private void setFromDisplayForm(Element element) {
String displayForm = element.getChildTextTrim("displayForm", MCRConstants.MODS_NAMESPACE);
if (displayForm != null) {
setFromCombinedName(displayForm.replaceAll("\\s+", " "));
}
}
代码示例来源:origin: jpos/jPOS-EE
/**
* Parses a JDOM Element as defined in
* <a href="http://jpos.org/minigl.dtd">minigl.dtd</a>
*/
public void fromXML (Element elem) {
setNick (elem.getChildTextTrim ("nick"));
setName (elem.getChildTextTrim ("name"));
}
/**
代码示例来源:origin: NationalSecurityAgency/emissary
/**
* Build an entry from the supplied xml fragment
*
* @param e a JDOM Element
*/
public static DirectoryEntry fromXML(final Element e) {
final String key = e.getChildTextTrim(KEY);
final String desc = e.getChildTextTrim(DESC);
final int cost = JDOMUtil.getChildIntValue(e, COST);
final int quality = JDOMUtil.getChildIntValue(e, QUALITY);
final DirectoryEntry d = new DirectoryEntry(key, desc, cost, quality);
return d;
}
代码示例来源:origin: jpos/jPOS
@Override
protected void initSpaceAndQueues () throws ConfigurationException {
super.initSpaceAndQueues();
Element persist = getPersist ();
String s = persist.getChildTextTrim("sessions");
setSessions(s != null && s.length() > 0 ? Integer.parseInt(s) : 1);
}
代码示例来源:origin: jpos/jPOS-EE
/**
* Parses a JDOM Element as defined in
* <a href="http://jpos.org/minigl.dtd">minigl.dtd</a>
*/
public void fromXML (Element elem) throws ParseException {
setId (elem.getAttributeValue ("id"));
setSymbol (elem.getChildTextTrim ("symbol"));
setName (elem.getChildTextTrim ("name"));
}
/**
代码示例来源:origin: jpos/jPOS-EE
/**
* Parses a JDOM Element as defined in
* <a href="http://jpos.org/minigl.dtd">minigl.dtd</a>
*/
public void fromXML (Element elem) throws ParseException {
setClazz (elem.getAttributeValue ("clazz"));
setDescription (elem.getText().trim());
setLayers (elem.getChildTextTrim ("layers"));
setParam (elem.getChildTextTrim ("param"));
}
/**
代码示例来源:origin: jpos/jPOS-EE
/**
* Parses a JDOM Element as defined in
* <a href="http://jpos.org/minigl.dtd">minigl.dtd</a>
*/
public void fromXML (Element elem) throws ParseException {
setDetail (elem.getChildTextTrim ("detail"));
setTags (new Tags(elem.getChildTextTrim ("tags")));
setCredit ("credit".equals (elem.getAttributeValue("type")));
setLayer(toShort(elem.getAttributeValue("layer")));
setAmount(new BigDecimal (elem.getChild ("amount").getText()));
}
/**
代码示例来源:origin: jpos/jPOS
protected void initService () throws Exception {
QFactory factory = getServer().getFactory();
Element e = getPersist ();
task = (Runnable) factory.newInstance (e.getChildTextTrim ("class"));
factory.setLogger (task, e);
}
protected void startService () throws Exception {
代码示例来源:origin: jpos/jPOS
protected void initService () throws Exception {
QFactory factory = getServer().getFactory();
Element e = getPersist ();
task = factory.newInstance (e.getChildTextTrim ("class"));
factory.setLogger (task, e);
}
protected void startService () throws Exception {
代码示例来源:origin: jpos/jPOS-EE
private Interpreter initBSH () throws UtilEvalError, EvalError {
Interpreter bsh = new Interpreter ();
BshClassManager bcm = bsh.getClassManager();
bcm.setClassPath(getServer().getLoader().getURLs());
bcm.setClassLoader(getServer().getLoader());
bsh.set ("qbean", this);
bsh.set ("log", getLog());
bsh.eval (getPersist().getChildTextTrim ("init"));
return bsh;
}
private ISOMsg applyRequestProps (ISOMsg m, Interpreter bsh)
内容来源于网络,如有侵权,请联系作者删除!