本文整理了Java中org.jdom.Text.<init>()
方法的一些代码示例,展示了Text.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Text.<init>()
方法的具体详情如下:
包路径:org.jdom.Text
类名称:Text
方法名:<init>
[英]This is the protected, no-args constructor standard in all JDOM classes. It allows subclassers to get a raw instance with no initialization.
[中]这是所有JDOM类中受保护的无参数构造函数标准。它允许子类程序在不初始化的情况下获取原始实例。
代码示例来源:origin: org.jdom/jdom-legacy
public Text text(String str) {
Text t = new Text();
t.value = str;
return t;
}
代码示例来源:origin: org.jdom/jdom-legacy
public Text text(String text) {
return new Text(text);
}
代码示例来源:origin: org.jdom/jdom-legacy
/**
* This adds text content to this element. It does not replace the
* existing content as does <code>setText()</code>.
*
* @param str <code>String</code> to add
* @return this element modified
* @throws IllegalDataException if <code>str</code> contains an
* illegal character such as a vertical tab (as determined
* by {@link org.jdom.Verifier#checkCharacterData})
*/
public Element addContent(final String str) {
return addContent(new Text(str));
}
代码示例来源:origin: org.jibx/jibx-extras
public void writeTextContent(String text) throws IOException {
this.currentElement.addContent(new Text(text));
}
代码示例来源:origin: edu.ucar/opendap
public static Element getVersionElement() {
Element lib = new Element("lib");
Element name = new Element("name");
Element ver = new Element("version");
name.addContent(new Text("java-opendap"));
lib.addContent(name);
ver.addContent(new Text(version));
lib.addContent(ver);
return (lib);
}
代码示例来源:origin: de.smartics.ci/smartics-ci-commons-hudson-config
@Override
public Element create(final String scmUrl)
{
final Element locations = new Element("locations");
final Element scmLocation =
new Element("hudson.scm.SubversionSCM_-ModuleLocation");
final Element remote = new Element("remote");
final Text text = new Text(scmUrl);
locations.addContent(scmLocation);
scmLocation.addContent(remote);
remote.addContent(text);
return locations;
}
};
代码示例来源:origin: org.openwfe/openwfe-engine
/**
* Returns the tag name of the given element (null if the parameter
* is not an element).
*/
public static Text xar (final Content c)
{
final Element elt = toElement(c);
return new Text(elt.getName());
}
代码示例来源:origin: bcdev/beam
private static String encode(String text) {
if (text != null) {
text = _xmlOutputter.outputString(new Text(text.trim()));
}
return text;
}
代码示例来源:origin: geosolutions-it/geoserver-manager
protected void add(final String nodename, final String nodetext) {
add(nodename,new Text(nodetext));
}
代码示例来源:origin: geosolutions-it/geoserver-manager
protected void set(final String nodename, final String nodetext) {
set(nodename,new Text(nodetext));
}
代码示例来源:origin: org.wildfly.camel/wildfly-camel-config
private static void addProperty(Element systemProperties, Map<String, Element> propertiesByName, String name, String value) {
Namespace namespace = systemProperties.getNamespace();
if (!propertiesByName.containsKey(name)) {
systemProperties.addContent(new Text(" "));
systemProperties.addContent(new Element("property", namespace).setAttribute("name", name).setAttribute("value", value));
systemProperties.addContent(new Text("\n "));
}
}
代码示例来源:origin: wildfly-extras/wildfly-camel
private static void addProperty(Element systemProperties, Map<String, Element> propertiesByName, String name, String value) {
Namespace namespace = systemProperties.getNamespace();
if (!propertiesByName.containsKey(name)) {
systemProperties.addContent(new Text(" "));
systemProperties.addContent(new Element("property", namespace).setAttribute("name", name).setAttribute("value", value));
systemProperties.addContent(new Text("\n "));
}
}
代码示例来源:origin: org.wildfly.camel/wildfly-camel-config
private static void updateSubsystem(ConfigContext context, boolean enable) {
List<Element> profiles = ConfigSupport.findProfileElements(context.getDocument(), NS_DOMAINS);
for (Element profile : profiles) {
Element element = profile.getChild("subsystem", NS_CAMEL);
if (enable && element == null) {
URL resource = WildFlyCamelConfigPlugin.class.getResource("/camel-subsystem.xml");
profile.addContent(new Text(" "));
profile.addContent(ConfigSupport.loadElementFrom(resource));
profile.addContent(new Text("\n "));
}
if (!enable && element != null) {
element.getParentElement().removeContent(element);
}
}
}
代码示例来源:origin: wildfly-extras/wildfly-camel
private static void updateSubsystem(ConfigContext context, boolean enable) {
List<Element> profiles = ConfigSupport.findProfileElements(context.getDocument(), NS_DOMAINS);
for (Element profile : profiles) {
Element element = profile.getChild("subsystem", NS_CAMEL);
if (enable && element == null) {
URL resource = WildFlyCamelConfigPlugin.class.getResource("/camel-subsystem.xml");
profile.addContent(new Text(" "));
profile.addContent(ConfigSupport.loadElementFrom(resource));
profile.addContent(new Text("\n "));
}
if (!enable && element != null) {
element.getParentElement().removeContent(element);
}
}
}
代码示例来源:origin: org.wildfly.camel/wildfly-camel-config
private static void updateExtension(ConfigContext context, boolean enable) {
Element extensions = ConfigSupport.findChildElement(context.getDocument().getRootElement(), "extensions", NS_DOMAINS);
ConfigSupport.assertExists(extensions, "Did not find the <extensions> element");
Namespace namespace = extensions.getNamespace();
Element element = ConfigSupport.findElementWithAttributeValue(extensions, "extension", "module", "org.wildfly.extension.camel", NS_DOMAINS);
if (enable && element == null) {
extensions.addContent(new Text(" "));
extensions.addContent(new Element("extension", namespace).setAttribute("module", "org.wildfly.extension.camel"));
extensions.addContent(new Text("\n "));
}
if (!enable && element != null) {
element.getParentElement().removeContent(element);
}
}
代码示例来源:origin: wildfly-extras/wildfly-camel
private static void updateExtension(ConfigContext context, boolean enable) {
Element extensions = ConfigSupport.findChildElement(context.getDocument().getRootElement(), "extensions", NS_DOMAINS);
ConfigSupport.assertExists(extensions, "Did not find the <extensions> element");
Namespace namespace = extensions.getNamespace();
Element element = ConfigSupport.findElementWithAttributeValue(extensions, "extension", "module", "org.wildfly.extension.camel", NS_DOMAINS);
if (enable && element == null) {
extensions.addContent(new Text(" "));
extensions.addContent(new Element("extension", namespace).setAttribute("module", "org.wildfly.extension.camel"));
extensions.addContent(new Text("\n "));
}
if (!enable && element != null) {
element.getParentElement().removeContent(element);
}
}
代码示例来源:origin: com.redhat.fuse.eap/fuse-eap-config
private void updateExtension(ConfigContext context, boolean enable) {
Namespace[] domainNamespaces = registry.getNamespaces(NS_DOMAIN);
Element extensions = ConfigSupport.findChildElement(context.getDocument().getRootElement(), "extensions", domainNamespaces);
ConfigSupport.assertExists(extensions, "Did not find the <extensions> element");
Element element = ConfigSupport.findElementWithAttributeValue(extensions, "extension", "module", "org.switchyard", domainNamespaces);
Namespace domainNamespace = context.getDocument().getRootElement().getNamespace();
if (enable && element == null) {
extensions.addContent(new Text(" "));
extensions.addContent(new Element("extension", domainNamespace).setAttribute("module", "org.switchyard"));
extensions.addContent(new Text("\n "));
}
if (!enable && element != null) {
element.getParentElement().removeContent(element);
}
}
代码示例来源:origin: org.codehaus.enunciate/enunciate-docs
protected void generateExampleXml(Value value, org.jdom.Element parent) {
DocumentationExample exampleInfo = value.getAnnotation(DocumentationExample.class);
if (exampleInfo == null || !exampleInfo.exclude()) {
parent.setContent(new Text(exampleInfo == null || "##default".equals(exampleInfo.value()) ? "..." : exampleInfo.value()));
}
}
代码示例来源:origin: cytoscape.coreplugins/psi-mi
/**
* Extracts Interactor Name
*/
private void extractInteractorName(InteractorElementType cProtein, Interactor interactor)
throws MapperException {
NamesType names = cProtein.getNames();
if (names != null) {
String name = MapperUtil.extractName(cProtein, interactor.getExternalRefs());
// Remove all surrounding and internal white space.
Text jdomText = new Text(name);
name = jdomText.getTextNormalize();
interactor.setName(name);
String fullName = names.getFullName();
interactor.addAttribute(InteractorVocab.FULL_NAME, fullName);
}
}
代码示例来源:origin: cytoscape.coreplugins/psi-mi
/**
* Extracts Interactor Name
*/
private void extractInteractorName(ProteinInteractorType cProtein, Interactor interactor)
throws MapperException {
NamesType names = cProtein.getNames();
if (names != null) {
String name = MapperUtil.extractName(cProtein, interactor.getExternalRefs());
// Remove all surrounding and internal white space.
Text jdomText = new Text(name);
name = jdomText.getTextNormalize();
interactor.setName(name);
String fullName = names.getFullName();
interactor.addAttribute(InteractorVocab.FULL_NAME, fullName);
}
}
内容来源于网络,如有侵权,请联系作者删除!