本文整理了Java中org.jdom2.Element.getChildTextNormalize()
方法的一些代码示例,展示了Element.getChildTextNormalize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getChildTextNormalize()
方法的具体详情如下:
包路径:org.jdom2.Element
类名称:Element
方法名:getChildTextNormalize
[英]Returns the normalized textual content of the named child element, or null if there's no such child. See #getTextNormalize()
for details of text normalizing.
[中]
代码示例来源:origin: org.codehaus.plexus/plexus-component-metadata
/**
* @param name The name of the child.
* @return the child text.
* @see org.jdom2.Element#getChildTextNormalize(java.lang.String)
*/
public String getChildTextNormalize( String name )
{
return element.getChildTextNormalize( name );
}
代码示例来源: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#getChildTextNormalize(java.lang.String,org.jdom2.Namespace)
*/
public String getChildTextNormalize( String name, Namespace ns )
{
return element.getChildTextNormalize( name, ns );
}
代码示例来源:origin: net.sf.cuf/cuf-swing
private FormLayout createFormLayout(Element pElement)
{
String columns= pElement.getChildTextNormalize(SwingXMLBuilder.COLUMNS_ELEMENT);
String rows = pElement.getChildTextNormalize(SwingXMLBuilder.ROWS_ELEMENT);
if (rows == null)
{
rows = ""; // to support the builder better
}
FormLayout formLayout = new FormLayout(columns, rows);
String columnGroups= pElement.getChildTextNormalize(SwingXMLBuilder.COLUMNGROUPS_ELEMENT);
String rowGroups = pElement.getChildTextNormalize(SwingXMLBuilder.ROWGROUPS_ELEMENT);
if (columnGroups != null)
{
formLayout.setColumnGroups(getGroups(columnGroups));
}
if (rowGroups != null)
{
formLayout.setRowGroups(getGroups(rowGroups));
}
return formLayout;
}
代码示例来源:origin: edu.ucar/netcdf
for (Element elem : featList) {
if (version.type == 1) {
String line = elem.getChildTextNormalize("No");
String code = elem.getChildTextNormalize(elems[0]);
String code2 = (elems[1] != null) ? elem.getChildTextNormalize(elems[1]) : null;
String value = elem.getChildTextNormalize(elems[2]);
String line = elem.getChildTextNormalize("No");
String code = elem.getChildTextNormalize(elems[0]);
String value = elem.getChildTextNormalize(elems[1]);
String code2 = elem.getChildTextNormalize(elems[2]);
String value2 = elem.getChildTextNormalize(elems[3]);
Element statusElem = elem.getChild("Status");
String status = (statusElem == null) ? null : statusElem.getTextNormalize();
代码示例来源:origin: edu.ucar/cdm
for (Element elem : featList) {
if (version.type == 1) {
String line = elem.getChildTextNormalize("No");
String code = elem.getChildTextNormalize(elems[0]);
String code2 = (elems[1] != null) ? elem.getChildTextNormalize(elems[1]) : null;
String value = elem.getChildTextNormalize(elems[2]);
String line = elem.getChildTextNormalize("No");
String code = elem.getChildTextNormalize(elems[0]);
String value = elem.getChildTextNormalize(elems[1]);
String code2 = (elems[2] == null) ? null : elem.getChildTextNormalize(elems[2]);
String value2 = elem.getChildTextNormalize(elems[3]);
Element statusElem = elem.getChild("Status");
String status = (statusElem == null) ? null : statusElem.getTextNormalize();
代码示例来源:origin: Unidata/thredds
String name = feature.getChild("annotation").getChildTextNormalize("documentation");
int f = Integer.parseInt(feature.getChildText("F"));
int x = Integer.parseInt(feature.getChildText("X"));
String units = bufrElem.getChildTextNormalize("BUFR_units");
int scale = 0, reference = 0, width = 0;
s = bufrElem.getChildTextNormalize("BUFR_scale");
scale = Integer.parseInt(clean(s));
} catch (NumberFormatException e) {
s = bufrElem.getChildTextNormalize("BUFR_reference");
reference = Integer.parseInt(clean(s));
} catch (NumberFormatException e) {
s = bufrElem.getChildTextNormalize("BUFR_width");
width = Integer.parseInt(clean(s));
} catch (NumberFormatException e) {
代码示例来源:origin: Unidata/thredds
for (Element elem : featList) {
if (version.type == 1) {
String line = elem.getChildTextNormalize("No");
String code = elem.getChildTextNormalize(elems[0]);
String code2 = (elems[1] != null) ? elem.getChildTextNormalize(elems[1]) : null;
String value = elem.getChildTextNormalize(elems[2]);
String line = elem.getChildTextNormalize("No");
String code = elem.getChildTextNormalize(elems[0]);
String value = elem.getChildTextNormalize(elems[1]);
String code2 = (elems[2] == null) ? null : elem.getChildTextNormalize(elems[2]);
String value2 = elem.getChildTextNormalize(elems[3]);
Element statusElem = elem.getChild("Status");
String status = (statusElem == null) ? null : statusElem.getTextNormalize();
代码示例来源:origin: Unidata/thredds
if (ce == null) continue;
String name = Util.cleanName(elem.getChildTextNormalize(elems[1]));
String units = cleanUnit(elem.getChildTextNormalize("BUFR_Unit"));
int x = 0, y = 0, scale = 0, reference = 0, width = 0;
String s = null;
try {
fxy = elem.getChildTextNormalize("FXY");
int xy = Integer.parseInt(cleanNumber(fxy));
x = xy / 1000;
s = elem.getChildTextNormalize("BUFR_Scale");
scale = Integer.parseInt(cleanNumber(s));
} catch (NumberFormatException e) {
s = elem.getChildTextNormalize("BUFR_ReferenceValue");
reference = Integer.parseInt(cleanNumber(s));
} catch (NumberFormatException e) {
s = elem.getChildTextNormalize("BUFR_DataWidth_Bits");
width = Integer.parseInt(cleanNumber(s));
} catch (NumberFormatException e) {
代码示例来源:origin: Unidata/thredds
for (Element elem : featList) {
String line = elem.getChildTextNormalize("No");
String tableName = elem.getChildTextNormalize(elems[1]); // 1 = table name
String code = elem.getChildTextNormalize("CodeFlag");
String value = elem.getChildTextNormalize("Value"); // Flag table only
String meaning = elem.getChildTextNormalize(elems[3]); // 3 = meaning
代码示例来源:origin: Unidata/thredds
if (ce == null) continue;
String seqs = elem.getChildTextNormalize("FXY1");
int seq = Integer.parseInt(seqs);
int w = seq / 1000;
int x = w % 100;
String seqName = Util.cleanName(elem.getChildTextNormalize(elems[1]));
currDesc = tableD.addDescriptor((short) x, (short) y, seqName, new ArrayList<Short>());
currSeqno = seq;
String fnos = elem.getChildTextNormalize("FXY2");
int fno = Integer.parseInt(fnos);
int y = fno % 1000;
代码示例来源:origin: Unidata/thredds
List<Element> featList = root.getChildren(elems[0]); // 0 = main element
for (Element elem : featList) {
String desc = elem.getChildTextNormalize(elems[1]); // 1 = title
String octet = elem.getChildTextNormalize("OctetNo");
String content = elem.getChildTextNormalize(elems[3]); // 3 = content
String status = elem.getChildTextNormalize("Status");
String note = elem.getChildTextNormalize(elems[2]); // 2 == note
代码示例来源:origin: Unidata/thredds
String name = feature.getChild("annotation").getChildTextNormalize("documentation");
int f = Integer.parseInt(feature.getChildText("F"));
int x = Integer.parseInt(feature.getChildText("X"));
String units = bufrElem.getChildTextNormalize("BUFR_units");
int scale = 0, reference = 0, width = 0;
s = bufrElem.getChildTextNormalize("BUFR_scale");
scale = Integer.parseInt(clean(s));
} catch (NumberFormatException e) {
s = bufrElem.getChildTextNormalize("BUFR_reference");
reference = Integer.parseInt(clean(s));
} catch (NumberFormatException e) {
s = bufrElem.getChildTextNormalize("BUFR_width");
width = Integer.parseInt(clean(s));
} catch (NumberFormatException e) {
代码示例来源:origin: Unidata/thredds
public int makeBmtTable(List<Element> featureCatList) {
int count = 0;
for (Element featureCat : featureCatList) {
List<Element> featureCollectList = featureCat.getChildren("featureCollection");
count += featureCollectList.size();
for (Element featureCollect : featureCollectList) {
int f = Integer.parseInt(featureCollect.getChildText("F"));
int x = Integer.parseInt(featureCollect.getChildText("X"));
int y = Integer.parseInt(featureCollect.getChildText("Y"));
String name = featureCollect.getChild("annotation").getChildTextNormalize("documentation");
int fxy = (f << 16) + (x << 8) + y;
Sequence seq = new Sequence(x, y, name);
bmTable.put(fxy, seq);
List<Element> features = featureCollect.getChildren("feature");
for (Element feature : features) {
f = Integer.parseInt(feature.getChildText("F"));
x = Integer.parseInt(feature.getChildText("X"));
y = Integer.parseInt(feature.getChildText("Y"));
name = feature.getChild("annotation").getChildTextNormalize("documentation");
fxy = (f << 16) + (x << 8) + y;
Feature feat = new Feature(fxy, name);
seq.features.add(feat);
}
}
}
return count;
}
代码示例来源:origin: Unidata/thredds
public int makeTable(List<Element> seqList) {
int count = 0;
for (Element seqElem : seqList) {
int f = Integer.parseInt(seqElem.getAttributeValue("F"));
int x = Integer.parseInt(seqElem.getAttributeValue("X"));
int y = Integer.parseInt(seqElem.getAttributeValue("Y"));
String name = ""; // seqElem.getChildTextNormalize("name");
int fxy = (f << 16) + (x << 8) + y;
Sequence seq = new Sequence(x, y, name);
map.put(fxy, seq);
List<Element> elemList = seqElem.getChildren("element");
for (Element elem : elemList) {
f = Integer.parseInt(elem.getAttributeValue("F"));
x = Integer.parseInt(elem.getAttributeValue("X"));
y = Integer.parseInt(elem.getAttributeValue("Y"));
name = elem.getChildTextNormalize("name");
fxy = (f << 16) + (x << 8) + y;
Feature feat = new Feature(fxy, name);
seq.features.add(feat);
}
count++;
}
return count;
}
代码示例来源:origin: org.mycore/mycore-restapi
private static void createXMLForSubdirectories(MCRPath mcrPath, Element currentElement, int currentDepth,
int maxDepth) {
if (currentDepth < maxDepth) {
XPathExpression<Element> xp = XPathFactory.instance().compile("./children/child[@type='directory']",
Filters.element());
for (Element e : xp.evaluate(currentElement)) {
String name = e.getChildTextNormalize("name");
try {
MCRPath pChild = (MCRPath) mcrPath.resolve(name);
Document doc = MCRPathXML.getDirectoryXML(pChild);
Element eChildren = doc.getRootElement().getChild("children");
if (eChildren != null) {
e.addContent(eChildren.detach());
createXMLForSubdirectories(pChild, e, currentDepth + 1, maxDepth);
}
} catch (IOException ex) {
//ignore
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!