本文整理了Java中org.dom4j.Attribute.getStringValue()
方法的一些代码示例,展示了Attribute.getStringValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attribute.getStringValue()
方法的具体详情如下:
包路径:org.dom4j.Attribute
类名称:Attribute
方法名:getStringValue
暂无
代码示例来源:origin: igniterealtime/Openfire
/**
* Removes an extra Disco identity from the list of identities returned for the conference service.
* @param name Name of identity to remove.
*/
public void removeExtraIdentity(String name) {
final Iterator<Element> iter = extraDiscoIdentities.iterator();
while (iter.hasNext()) {
Element elem = iter.next();
if (name.equals(elem.attribute("name").getStringValue())) {
iter.remove();
break;
}
}
}
代码示例来源:origin: webx/citrus
targetNamespace = trimToNull(attr.getStringValue());
代码示例来源:origin: webx/citrus
targetNamespace = trimToNull(attr.getStringValue());
代码示例来源:origin: webx/citrus
targetNamespace = trimToNull(attr.getStringValue());
代码示例来源:origin: org.igniterealtime.openfire/xmppserver
/**
* Removes an extra Disco identity from the list of identities returned for the conference service.
* @param name Name of identity to remove.
*/
public void removeExtraIdentity(String name) {
final Iterator<Element> iter = extraDiscoIdentities.iterator();
while (iter.hasNext()) {
Element elem = iter.next();
if (name.equals(elem.attribute("name").getStringValue())) {
iter.remove();
break;
}
}
}
代码示例来源:origin: com.atlassian.webhooks/atlassian-webhooks-plugin
private static Optional<String> getAttribute(Element element, String name) {
Attribute attribute = element.attribute(name);
return attribute == null ? empty() : Optional.ofNullable(attribute.getStringValue());
}
代码示例来源:origin: OpenAS2/OpenAs2App
public static Map<String, String> mapAttributes(Element element) {
Map<String,String> attributeMap = new HashMap<String,String>();
for (Iterator<Attribute> it = element.attributeIterator(); it.hasNext();) {
Attribute attribute = it.next();
attributeMap.put(attribute.getName(), attribute.getStringValue());
}
return attributeMap;
}
代码示例来源:origin: org.alfresco/alfresco-repository
public void initialise(Element element, NamespacePrefixResolver nspr, PermissionModel permissionModel)
{
Attribute authorityAttribute = element.attribute(AUTHORITY);
if(authorityAttribute != null)
{
authority = authorityAttribute.getStringValue();
}
Attribute permissionAttribute = element.attribute(PERMISSION);
if(permissionAttribute != null)
{
permissionReference = permissionModel.getPermissionReference(null, permissionAttribute.getStringValue());
}
}
代码示例来源:origin: net.sf.sido/sido
private String getAttString(Element e, QName name, boolean required, String defaultValue) {
Attribute att = e.attribute(name);
if (att != null) {
return att.getStringValue();
} else if (required) {
throw new DOXmlAttributeNotFoundException(name, e.getName());
} else {
return defaultValue;
}
}
代码示例来源:origin: Alfresco/alfresco-repository
public void initialise(Element element, NamespacePrefixResolver nspr, PermissionModel permissionModel)
{
Attribute authorityAttribute = element.attribute(AUTHORITY);
if(authorityAttribute != null)
{
authority = authorityAttribute.getStringValue();
}
Attribute permissionAttribute = element.attribute(PERMISSION);
if(permissionAttribute != null)
{
permissionReference = permissionModel.getPermissionReference(null, permissionAttribute.getStringValue());
}
}
代码示例来源:origin: com.atlassian.jira/jira-core
public void init(Plugin plugin, Element element) throws PluginParseException
{
super.init(plugin, element);
fileExtension = element.attribute("fileExtension").getStringValue();
contentType = element.attribute("contentType").getStringValue();
order = ModuleDescriptorXMLUtils.getOrder(element);
this.element = element;
}
代码示例来源:origin: com.atlassian.jira/jira-core
public void init(Plugin plugin, Element element) throws PluginParseException
{
super.init(plugin, element);
fileExtension = element.attribute("fileExtension").getStringValue();
contentType = element.attribute("contentType").getStringValue();
Attribute basicAuthAttribute = element.attribute("basicAuthenticationRequired");
if(basicAuthAttribute != null)
{
String basicAuthenticationRequired = basicAuthAttribute.getStringValue();
//if attribute was provided, set requiresAuthentication. Otherwise set it to false.
this.basicAuthenticationRequired = StringUtils.isNotEmpty(basicAuthenticationRequired) && Boolean.valueOf(basicAuthenticationRequired);
}
else
{
this.basicAuthenticationRequired = false;
}
Attribute excludeFromLimitFilterAttr = element.attribute("excludeFromLimitFilter");
if (excludeFromLimitFilterAttr != null)
{
excludeFromLimitFilter = Boolean.valueOf(excludeFromLimitFilterAttr.getStringValue());
}
order = ModuleDescriptorXMLUtils.getOrder(element);
this.element = element;
}
代码示例来源:origin: org.alfresco/alfresco-repository
public void initialise(Element element, NamespacePrefixResolver nspr, PermissionModel permissionModel)
{
Attribute nodeRefAttribute = element.attribute(NODE_REF);
if(nodeRefAttribute != null)
{
nodeRef = new NodeRef(nodeRefAttribute.getStringValue());
}
Attribute inheritFromParentAttribute = element.attribute(INHERIT_FROM_PARENT);
if(inheritFromParentAttribute != null)
{
inheritPermissionsFromParent = Boolean.parseBoolean(inheritFromParentAttribute.getStringValue());
}
else
{
inheritPermissionsFromParent = true;
}
// Node Permissions Entry
for (Iterator npit = element.elementIterator(NODE_PERMISSION); npit.hasNext(); /**/)
{
Element permissionEntryElement = (Element) npit.next();
ModelPermissionEntry permissionEntry = new ModelPermissionEntry(nodeRef);
permissionEntry.initialise(permissionEntryElement, nspr, permissionModel);
permissionEntries.add(permissionEntry);
}
}
代码示例来源:origin: org.alfresco/alfresco-repository
if(exposeAttribute != null)
exposeAll = exposeAttribute.getStringValue().equalsIgnoreCase(EXPOSE_ALL);
代码示例来源:origin: Alfresco/alfresco-repository
if(exposeAttribute != null)
exposeAll = exposeAttribute.getStringValue().equalsIgnoreCase(EXPOSE_ALL);
代码示例来源:origin: org.rundeck/rundeck-core
/**
* Parse the DOM attributes as properties for the particular entity node type
*
* @param ent Entity object
* @param node entity DOM node
*
* @throws ResourceXMLParserException if the DOM node is an unexpected tag name
*/
private void parseEntProperties(final Entity ent, final Node node) throws ResourceXMLParserException {
if (null == entityProperties.get(node.getName())) {
throw new ResourceXMLParserException(
"Unexpected entity declaration: " + node.getName() + ": " + reportNodeErrorLocation(node));
}
final Element node1 = (Element) node;
//load all element attributes as properties
for (final Object o : node1.attributes()) {
final Attribute attr = (Attribute) o;
ent.properties.setProperty(attr.getName(), attr.getStringValue());
}
}
代码示例来源:origin: org.nakedobjects/nos-objectstore-hibernate
private void bindProperty(final NakedObjectField field, final Element classElement, final boolean valueFieldAccess) {
LOG.debug("Binding persistent property [" + field.getId() + "]");
final Element property = classElement.addElement("property");
setType(field, property, "type", true, valueFieldAccess);
final Attribute access = property.attribute("access");
final boolean fieldAccess = access != null && access.getStringValue().equals("field");
property.addAttribute("name", getPropertyName(field, fieldAccess));
final org.hibernate.type.Type type = TypeFactory.heuristicType(property.attribute("type").getValue(), null);
if (type instanceof CompositeCustomType) {
final String[] names = ((CompositeCustomType) type).getPropertyNames();
for (int i = 0; i < names.length; i++) {
final String compositeColumnName = deconflictColumnName(columnName(field.getId()) + "_" + names[i]);
property.addElement("column").addAttribute("name", compositeColumnName);
}
} else {
addColumnAttribute(property, columnName(field.getId()));
}
}
代码示例来源:origin: net.gltd.gtms/gtmsutil
/**
* Given a GTMS system element <system id="asterisk">...</system> returns a collection of
* trunks.
*
* @param element GTMS system element.
* @return collection of found trunks or empty collection if nothing found.
*/
public static TrunkCollection getTrunksFromElement(Element element) {
TrunkCollection trunks = new TrunkCollection();
Node node = (Node) element;
if (node != null) {
String findString = "//gtx:trunk";
XPath xpath = DocumentHelper.createXPath(findString);
xpath.setNamespaceContext(new SimpleNamespaceContext(XmlUtil.getGtxNamespaceMap()));
List<Node> trunkNodes = xpath.selectNodes(node);
for (Node tmpNode : trunkNodes) {
Element tmpElem = (Element) tmpNode;
Attribute attrib = tmpElem.attribute("id");
String id = attrib.getStringValue();
String regex = tmpElem.getStringValue();
trunks.add(new Trunk(id, regex));
}
}
return trunks;
}
代码示例来源:origin: net.gltd.gtms/gtmsutil
/**
* Given a gtx-profile element <gtx-profile>...</gtx-profile> returns a collection of trunks.
*
* @param element GTMS system element.
* @param profile profile to look for.
* @param systemType system to look for.
* @return collection of found trunks or empty collection if nothing found.
*/
public static TrunkCollection getTrunksFromElement(Element element, String profile, GtmsSystemType systemType) {
TrunkCollection trunks = new TrunkCollection();
Node node = (Node) element;
if (node != null) {
String findString = "//gtx:profiles//gtx:profile//gtx:systems//gtx:system[@id='" + systemType.name()
+ "']//gtx:trunk";
XPath xpath = DocumentHelper.createXPath(findString);
xpath.setNamespaceContext(new SimpleNamespaceContext(XmlUtil.getGtxNamespaceMap()));
List<Node> trunkNodes = xpath.selectNodes(node);
for (Node tmpNode : trunkNodes) {
Element tmpElem = (Element) tmpNode;
Attribute attrib = tmpElem.attribute("id");
String id = attrib.getStringValue();
String regex = tmpElem.getStringValue();
trunks.add(new Trunk(id, regex));
}
}
return trunks;
}
代码示例来源:origin: net.gltd.gtms/gtmsutil
Element tmpElem = (Element) tmpNode;
Attribute attrib = tmpElem.attribute("id");
String id = attrib.getStringValue();
String regex = tmpElem.getStringValue();
prefixes.add(new DialPrefixRule(id, regex));
内容来源于网络,如有侵权,请联系作者删除!