org.jboss.as.controller.parsing.Element.getLocalName()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(10.7k)|赞(0)|评价(0)|浏览(292)

本文整理了Java中org.jboss.as.controller.parsing.Element.getLocalName()方法的一些代码示例,展示了Element.getLocalName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getLocalName()方法的具体详情如下:
包路径:org.jboss.as.controller.parsing.Element
类名称:Element
方法名:getLocalName

Element.getLocalName介绍

[英]Get the local name of this element.
[中]获取此元素的本地名称。

代码示例

代码示例来源:origin: wildfly/wildfly

  1. @Override
  2. public void marshallAsElement(AttributeDefinition attribute, ModelNode model, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException {
  3. if (model.hasDefined(attribute.getName())) {
  4. for (Property property : model.get(attribute.getName()).asPropertyList()) {
  5. writer.writeStartElement(Element.PROPERTY.getLocalName());
  6. writer.writeAttribute(Element.NAME.getLocalName(), property.getName());
  7. writer.writeCharacters(property.getValue().asString());
  8. writer.writeEndElement();
  9. }
  10. }
  11. }
  12. };

代码示例来源:origin: org.wildfly.core/wildfly-controller

  1. public static void writeElement(final XMLExtendedStreamWriter writer, final Element element) throws XMLStreamException {
  2. writer.writeStartElement(element.getLocalName());
  3. }

代码示例来源:origin: org.wildfly.core/wildfly-domain-management

  1. private void writeConfigurationChanges(XMLExtendedStreamWriter writer, ModelNode configurationChanges) throws XMLStreamException {
  2. writer.writeStartElement(Element.CONFIGURATION_CHANGES.getLocalName());
  3. LegacyConfigurationChangeResourceDefinition.MAX_HISTORY.marshallAsAttribute(configurationChanges, writer);
  4. writer.writeEndElement();
  5. }

代码示例来源:origin: org.wildfly.core/wildfly-host-controller

  1. private void writeServerGroupDeployments(final XMLExtendedStreamWriter writer, final ModelNode modelNode) throws XMLStreamException {
  2. final Set<String> deploymentNames = modelNode.keys();
  3. if (deploymentNames.size() > 0) {
  4. writer.writeStartElement(Element.DEPLOYMENTS.getLocalName());
  5. for (String uniqueName : deploymentNames) {
  6. final ModelNode deployment = modelNode.get(uniqueName);
  7. writer.writeStartElement(Element.DEPLOYMENT.getLocalName());
  8. WriteUtils.writeAttribute(writer, Attribute.NAME, uniqueName);
  9. DeploymentAttributes.RUNTIME_NAME.marshallAsAttribute(deployment, writer);
  10. DeploymentAttributes.ENABLED.marshallAsAttribute(deployment, writer);
  11. writer.writeEndElement();
  12. }
  13. writer.writeEndElement();
  14. }
  15. }

代码示例来源:origin: org.wildfly.core/wildfly-host-controller

  1. private void writeDiscoveryOptionProperties(XMLExtendedStreamWriter writer, ModelNode discoveryOptionProperties) throws XMLStreamException {
  2. for (String property : discoveryOptionProperties.keys()) {
  3. writer.writeStartElement(Element.PROPERTY.getLocalName());
  4. WriteUtils.writeAttribute(writer, Attribute.NAME, property);
  5. WriteUtils.writeAttribute(writer, Attribute.VALUE, discoveryOptionProperties.get(property).asString());
  6. writer.writeEndElement();
  7. }
  8. }

代码示例来源:origin: org.wildfly.core/wildfly-domain-management

  1. private void writeIdentity(XMLExtendedStreamWriter writer, ModelNode identity) throws XMLStreamException {
  2. writer.writeStartElement(Element.IDENTITY.getLocalName());
  3. AccessIdentityResourceDefinition.SECURITY_DOMAIN.marshallAsAttribute(identity, writer);
  4. writer.writeEndElement();
  5. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. @Override
  2. public void marshallAsElement(AttributeDefinition attribute, ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException {
  3. resourceModel = resourceModel.get(attribute.getXmlName());
  4. writer.writeStartElement(attribute.getName());
  5. final List<Property> properties = resourceModel.asPropertyList();
  6. for (Property property: properties) {
  7. writer.writeStartElement(org.jboss.as.controller.parsing.Element.PROPERTY.getLocalName());
  8. writer.writeAttribute(org.jboss.as.controller.parsing.Attribute.NAME.getLocalName(), property.getName());
  9. writer.writeCharacters(property.getValue().asString());
  10. writer.writeEndElement();
  11. }
  12. writer.writeEndElement();
  13. }

代码示例来源:origin: org.jboss.as/jboss-as-server

  1. protected static void writeElement(final XMLExtendedStreamWriter writer, final Element element) throws XMLStreamException {
  2. writer.writeStartElement(element.getLocalName());
  3. }

代码示例来源:origin: org.wildfly.core/wildfly-host-controller

  1. private void writeServerGroupDeployments(final XMLExtendedStreamWriter writer, final ModelNode modelNode) throws XMLStreamException {
  2. final Set<String> deploymentNames = modelNode.keys();
  3. if (deploymentNames.size() > 0) {
  4. writer.writeStartElement(Element.DEPLOYMENTS.getLocalName());
  5. for (String uniqueName : deploymentNames) {
  6. final ModelNode deployment = modelNode.get(uniqueName);
  7. writer.writeStartElement(Element.DEPLOYMENT.getLocalName());
  8. WriteUtils.writeAttribute(writer, Attribute.NAME, uniqueName);
  9. DeploymentAttributes.RUNTIME_NAME.marshallAsAttribute(deployment, writer);
  10. DeploymentAttributes.ENABLED.marshallAsAttribute(deployment, writer);
  11. writer.writeEndElement();
  12. }
  13. writer.writeEndElement();
  14. }
  15. }

代码示例来源:origin: wildfly/wildfly-core

  1. private void writeConfigurationChanges(XMLExtendedStreamWriter writer, ModelNode configurationChanges) throws XMLStreamException {
  2. writer.writeStartElement(Element.CONFIGURATION_CHANGES.getLocalName());
  3. LegacyConfigurationChangeResourceDefinition.MAX_HISTORY.marshallAsAttribute(configurationChanges, writer);
  4. writer.writeEndElement();
  5. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. @Override
  2. public void marshallAsElement(AttributeDefinition attribute, ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException {
  3. resourceModel = resourceModel.get(attribute.getXmlName());
  4. writer.writeStartElement(attribute.getName());
  5. final List<Property> properties = resourceModel.asPropertyList();
  6. for (Property property: properties) {
  7. writer.writeStartElement(org.jboss.as.controller.parsing.Element.PROPERTY.getLocalName());
  8. writer.writeAttribute(org.jboss.as.controller.parsing.Attribute.NAME.getLocalName(), property.getName());
  9. writer.writeCharacters(property.getValue().asString());
  10. writer.writeEndElement();
  11. }
  12. writer.writeEndElement();
  13. }

代码示例来源:origin: org.jboss.as/jboss-as-host-controller

  1. private void writeServerGroupDeployments(final XMLExtendedStreamWriter writer, final ModelNode modelNode) throws XMLStreamException {
  2. final Set<String> deploymentNames = modelNode.keys();
  3. if (deploymentNames.size() > 0) {
  4. writer.writeStartElement(Element.DEPLOYMENTS.getLocalName());
  5. for (String uniqueName : deploymentNames) {
  6. final ModelNode deployment = modelNode.get(uniqueName);
  7. writer.writeStartElement(Element.DEPLOYMENT.getLocalName());
  8. writeAttribute(writer, Attribute.NAME, uniqueName);
  9. DeploymentAttributes.RUNTIME_NAME.marshallAsAttribute(deployment, writer);
  10. DeploymentAttributes.ENABLED.marshallAsAttribute(deployment, writer);
  11. writer.writeEndElement();
  12. }
  13. writer.writeEndElement();
  14. }
  15. }

代码示例来源:origin: wildfly/wildfly-core

  1. private void writeIdentity(XMLExtendedStreamWriter writer, ModelNode identity) throws XMLStreamException {
  2. writer.writeStartElement(Element.IDENTITY.getLocalName());
  3. AccessIdentityResourceDefinition.SECURITY_DOMAIN.marshallAsAttribute(identity, writer);
  4. writer.writeEndElement();
  5. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. @Override
  2. public void marshallAsElement(AttributeDefinition attribute, ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException {
  3. resourceModel = resourceModel.get(attribute.getXmlName());
  4. writer.writeStartElement(attribute.getName());
  5. final List<Property> properties = resourceModel.asPropertyList();
  6. for (Property property: properties) {
  7. writer.writeStartElement(org.jboss.as.controller.parsing.Element.PROPERTY.getLocalName());
  8. writer.writeAttribute(org.jboss.as.controller.parsing.Attribute.NAME.getLocalName(), property.getName());
  9. writer.writeCharacters(property.getValue().asString());
  10. writer.writeEndElement();
  11. }
  12. writer.writeEndElement();
  13. }
  14. }

代码示例来源:origin: wildfly/wildfly-core

  1. private void writeDiscoveryOptionProperties(XMLExtendedStreamWriter writer, ModelNode discoveryOptionProperties) throws XMLStreamException {
  2. for (String property : discoveryOptionProperties.keys()) {
  3. writer.writeStartElement(Element.PROPERTY.getLocalName());
  4. WriteUtils.writeAttribute(writer, Attribute.NAME, property);
  5. WriteUtils.writeAttribute(writer, Attribute.VALUE, discoveryOptionProperties.get(property).asString());
  6. writer.writeEndElement();
  7. }
  8. }

代码示例来源:origin: org.jboss.as/jboss-as-controller

  1. public void writeExtensions(final XMLExtendedStreamWriter writer, final ModelNode modelNode) throws XMLStreamException {
  2. Set<String> keys = modelNode.keys();
  3. if (keys.size() > 0) {
  4. writer.writeStartElement(Element.EXTENSIONS.getLocalName());
  5. for (final String extension : keys) {
  6. writer.writeEmptyElement(Element.EXTENSION.getLocalName());
  7. writer.writeAttribute(Attribute.MODULE.getLocalName(), extension);
  8. }
  9. writer.writeEndElement();
  10. }
  11. }

代码示例来源:origin: org.infinispan.server/infinispan-server-commons

  1. @Override
  2. public void marshallAsElement(AttributeDefinition attribute, ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException {
  3. ModelNode properties = resourceModel.get(attribute.getName());
  4. if (properties.isDefined()) {
  5. for (Property property : properties.asPropertyList()) {
  6. writer.writeStartElement(org.jboss.as.controller.parsing.Element.PROPERTY.getLocalName());
  7. writer.writeAttribute(org.jboss.as.controller.parsing.Element.NAME.getLocalName(), property.getName());
  8. writer.writeCharacters(property.getValue().asString());
  9. writer.writeEndElement();
  10. }
  11. }
  12. }
  13. };

代码示例来源:origin: wildfly/wildfly-core

  1. private void writeServerGroupDeployments(final XMLExtendedStreamWriter writer, final ModelNode modelNode) throws XMLStreamException {
  2. final Set<String> deploymentNames = modelNode.keys();
  3. if (deploymentNames.size() > 0) {
  4. writer.writeStartElement(Element.DEPLOYMENTS.getLocalName());
  5. for (String uniqueName : deploymentNames) {
  6. final ModelNode deployment = modelNode.get(uniqueName);
  7. writer.writeStartElement(Element.DEPLOYMENT.getLocalName());
  8. WriteUtils.writeAttribute(writer, Attribute.NAME, uniqueName);
  9. DeploymentAttributes.RUNTIME_NAME.marshallAsAttribute(deployment, writer);
  10. DeploymentAttributes.ENABLED.marshallAsAttribute(deployment, writer);
  11. writer.writeEndElement();
  12. }
  13. writer.writeEndElement();
  14. }
  15. }

代码示例来源:origin: org.wildfly/wildfly-controller

  1. public void writeExtensions(final XMLExtendedStreamWriter writer, final ModelNode modelNode) throws XMLStreamException {
  2. Set<String> keys = modelNode.keys();
  3. if (keys.size() > 0) {
  4. writer.writeStartElement(Element.EXTENSIONS.getLocalName());
  5. for (final String extension : keys) {
  6. writer.writeEmptyElement(Element.EXTENSION.getLocalName());
  7. writer.writeAttribute(Attribute.MODULE.getLocalName(), extension);
  8. }
  9. writer.writeEndElement();
  10. }
  11. }

代码示例来源:origin: org.jboss.eap/wildfly-clustering-common

  1. @Override
  2. public void marshallAsElement(AttributeDefinition attribute, ModelNode model, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException {
  3. if (model.hasDefined(attribute.getName())) {
  4. for (Property property : model.get(attribute.getName()).asPropertyList()) {
  5. writer.writeStartElement(Element.PROPERTY.getLocalName());
  6. writer.writeAttribute(Element.NAME.getLocalName(), property.getName());
  7. writer.writeCharacters(property.getValue().asString());
  8. writer.writeEndElement();
  9. }
  10. }
  11. }
  12. };

相关文章