本文整理汇总了Java中org.jboss.staxmapper.XMLExtendedStreamWriter.writeEndElement方法的典型用法代码示例。如果您正苦于以下问题:Java XMLExtendedStreamWriter.writeEndElement方法的具体用法?Java XMLExtendedStreamWriter.writeEndElement怎么用?Java XMLExtendedStreamWriter.writeEndElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.staxmapper.XMLExtendedStreamWriter
的用法示例。
在下文中一共展示了XMLExtendedStreamWriter.writeEndElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeSecurityRealm
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writeSecurityRealm(XMLExtendedStreamWriter writer, ModelNode management) throws XMLStreamException {
ModelNode securityRealms = management.get(SECURITY_REALM);
writer.writeStartElement(Element.SECURITY_REALMS.getLocalName());
for (String variableName : securityRealms.keys()) {
writer.writeStartElement(Element.SECURITY_REALM.getLocalName());
writeAttribute(writer, Attribute.NAME, variableName);
ModelNode realm = securityRealms.get(variableName);
if (realm.hasDefined(PLUG_IN)) {
writePlugIns(writer, realm.get(PLUG_IN));
}
if (realm.hasDefined(SERVER_IDENTITY)) {
writeServerIdentities(writer, realm);
}
if (realm.hasDefined(AUTHENTICATION)) {
writeAuthentication(writer, realm);
}
writeAuthorization(writer, realm);
writer.writeEndElement();
}
writer.writeEndElement();
}
示例2: writeIgnoredResources
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writeIgnoredResources(XMLExtendedStreamWriter writer, ModelNode ignoredTypes) throws XMLStreamException {
for (String ignoredName : ignoredTypes.keys()) {
ModelNode ignored = ignoredTypes.get(ignoredName);
ModelNode names = ignored.hasDefined(NAMES) ? ignored.get(NAMES) : null;
boolean hasNames = names != null && names.asInt() > 0;
if (hasNames) {
writer.writeStartElement(Element.IGNORED_RESOURCE.getLocalName());
} else {
writer.writeEmptyElement(Element.IGNORED_RESOURCE.getLocalName());
}
writer.writeAttribute(Attribute.TYPE.getLocalName(), ignoredName);
IgnoredDomainTypeResourceDefinition.WILDCARD.marshallAsAttribute(ignored, writer);
if (hasNames) {
for (ModelNode name : names.asList()) {
writer.writeEmptyElement(Element.INSTANCE.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), name.asString());
}
writer.writeEndElement();
}
}
}
示例3: writeNativeManagementProtocol
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
@Override
public boolean writeNativeManagementProtocol(XMLExtendedStreamWriter writer, ModelNode protocol) throws XMLStreamException {
writer.writeStartElement(Element.NATIVE_INTERFACE.getLocalName());
NativeManagementResourceDefinition.SASL_AUTHENTICATION_FACTORY.marshallAsAttribute(protocol, writer);
NativeManagementResourceDefinition.SSL_CONTEXT.marshallAsAttribute(protocol, writer);
NativeManagementResourceDefinition.SECURITY_REALM.marshallAsAttribute(protocol, writer);
NativeManagementResourceDefinition.SASL_PROTOCOL.marshallAsAttribute(protocol, writer);
NativeManagementResourceDefinition.SERVER_NAME.marshallAsAttribute(protocol, writer);
writer.writeEmptyElement(Element.SOCKET.getLocalName());
NativeManagementResourceDefinition.INTERFACE.marshallAsAttribute(protocol, writer);
NativeManagementResourceDefinition.NATIVE_PORT.marshallAsAttribute(protocol, writer);
writer.writeEndElement();
return true;
}
示例4: writeContent
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException {
context.startSubsystemElement(Namespace.CURRENT.getUriString(), false);
final ModelNode node = context.getModelNode();
final ModelNode mbean = node.get(SmppMbeanDefinition.MBEAN);
for (Property mbeanProp : mbean.asPropertyList()) {
writer.writeStartElement(SmppMbeanDefinition.MBEAN);
final ModelNode mbeanEntry = mbeanProp.getValue();
SmppMbeanDefinition.NAME_ATTR.marshallAsAttribute(mbeanEntry, true, writer);
SmppMbeanDefinition.TYPE_ATTR.marshallAsAttribute(mbeanEntry, true, writer);
final ModelNode property = mbeanEntry.get(SmppMbeanPropertyDefinition.PROPERTY);
if (property != null && property.isDefined()) {
for (Property propertyProp : property.asPropertyList()) {
writer.writeStartElement(SmppMbeanPropertyDefinition.PROPERTY);
final ModelNode propertyEntry = propertyProp.getValue();
SmppMbeanPropertyDefinition.NAME_ATTR.marshallAsAttribute(propertyEntry, true, writer);
SmppMbeanPropertyDefinition.TYPE_ATTR.marshallAsAttribute(propertyEntry, true, writer);
SmppMbeanPropertyDefinition.VALUE_ATTR.marshallAsAttribute(propertyEntry, true, writer);
writer.writeEndElement();
}
}
writer.writeEndElement();
}
writer.writeEndElement();
}
示例5: writeContent
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
@Override
public void writeContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context)
throws XMLStreamException {
ModelNode node = context.getModelNode();
// <subsystem>
context.startSubsystemElement(NestSubsystemExtension.NAMESPACE, false);
writer.writeAttribute(NEST_ENABLED_ATTR, node.get(NEST_ENABLED_ATTR).asString());
// our config elements
writeElement(writer, node, NEST_NAME_ELEMENT);
// <custom-configuration>
writer.writeStartElement(CUSTOM_CONFIG_ELEMENT);
ModelNode configNode = node.get(CUSTOM_CONFIG_ELEMENT);
if (configNode != null && configNode.isDefined()) {
for (Property property : configNode.asPropertyList()) {
// <propery>
writer.writeStartElement(PROPERTY_ELEMENT);
writer.writeAttribute(Attribute.NAME.getLocalName(), property.getName());
writer.writeAttribute(Attribute.VALUE.getLocalName(), property.getValue().asString());
// </property>
writer.writeEndElement();
}
}
// </custom-configuration>
writer.writeEndElement();
// </subsystem>
writer.writeEndElement();
}
示例6: writeElement
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writeElement(final XMLExtendedStreamWriter writer, ModelNode node, String attribName)
throws XMLStreamException {
ModelNode attribNode = node.get(attribName);
if (attribNode.isDefined()) {
writer.writeStartElement(attribName);
writer.writeCharacters(attribNode.asString());
writer.writeEndElement();
}
}
示例7: writeProperties
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private static void writeProperties(final ModelNode node, final XMLExtendedStreamWriter writer) throws XMLStreamException {
if (node.hasDefined(CommonAttributes.PROPERTIES)) {
ModelNode properties = node.get(CommonAttributes.PROPERTIES);
writer.writeStartElement(Element.PROPERTIES.getLocalName());
Set<String> keys = properties.keys();
for (String current : keys) {
writer.writeStartElement(current);
writer.writeCharacters(properties.get(current).asString());
writer.writeEndElement();
}
writer.writeEndElement();
}
}
示例8: writeContent
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void writeContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context)
throws XMLStreamException {
context.startSubsystemElement(Namespace.CURRENT.getUriString(), false);
ModelNode node = context.getModelNode();
writeThreadsElement(writer, node);
writer.writeEndElement();
}
示例9: writeProperties
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writeProperties(final XMLExtendedStreamWriter writer, final ModelNode node) throws XMLStreamException {
writer.writeStartElement(Element.PROPERTIES.getLocalName());
for (Property prop : node.asPropertyList()) {
writer.writeStartElement(Element.PROPERTY.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), prop.getName());
PropertyResource.VALUE.marshallAsAttribute(prop.getValue(), writer);
writer.writeEndElement();
}
writer.writeEndElement();
}
示例10: writeServerDeployments
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writeServerDeployments(final XMLExtendedStreamWriter writer, final ModelNode modelNode)
throws XMLStreamException {
boolean deploymentWritten = false;
for (String deploymentName : modelNode.keys()) {
final ModelNode deployment = modelNode.get(deploymentName);
if (!deployment.isDefined()) {
continue;
}
if (!deploymentWritten) {
writer.writeStartElement(Element.DEPLOYMENTS.getLocalName());
deploymentWritten = true;
}
writer.writeStartElement(Element.DEPLOYMENT.getLocalName());
WriteUtils.writeAttribute(writer, Attribute.NAME, deploymentName);
DeploymentAttributes.RUNTIME_NAME.marshallAsAttribute(deployment, writer);
DeploymentAttributes.ENABLED.marshallAsAttribute(deployment, writer);
final List<ModelNode> contentItems = deployment.require(CONTENT).asList();
for (ModelNode contentItem : contentItems) {
writeContentItem(writer, contentItem);
}
writer.writeEndElement();
}
if (deploymentWritten) {
writer.writeEndElement();
}
}
示例11: writeDiscoveryOptions
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writeDiscoveryOptions(XMLExtendedStreamWriter writer, ModelNode discoveryOptions) throws XMLStreamException {
writer.writeStartElement(Element.DISCOVERY_OPTIONS.getLocalName());
for (Property property : discoveryOptions.asPropertyList()) {
final String type = property.getName().equals(STATIC_DISCOVERY) ? STATIC_DISCOVERY : DISCOVERY_OPTION;
final Element element = Element.forName(type);
final String optionName = property.getValue().get(ModelDescriptionConstants.NAME).asString();
switch (element) {
case STATIC_DISCOVERY: {
final ModelNode staticDiscoveryOption = property.getValue();
writer.writeStartElement(element.getLocalName());
WriteUtils.writeAttribute(writer, Attribute.NAME, optionName);
StaticDiscoveryResourceDefinition.PROTOCOL.marshallAsAttribute(staticDiscoveryOption, writer);
StaticDiscoveryResourceDefinition.HOST.marshallAsAttribute(staticDiscoveryOption, writer);
StaticDiscoveryResourceDefinition.PORT.marshallAsAttribute(staticDiscoveryOption, writer);
writer.writeEndElement();
break;
}
case DISCOVERY_OPTION: {
final ModelNode discoveryOption = property.getValue();
writer.writeStartElement(element.getLocalName());
WriteUtils.writeAttribute(writer, Attribute.NAME, optionName);
DiscoveryOptionResourceDefinition.CODE.marshallAsAttribute(discoveryOption, writer);
DiscoveryOptionResourceDefinition.MODULE.marshallAsAttribute(discoveryOption, writer);
if (discoveryOption.hasDefined(PROPERTIES)) {
writeDiscoveryOptionProperties(writer, discoveryOption.get(PROPERTIES));
}
writer.writeEndElement();
break;
}
default:
throw new RuntimeException(ControllerLogger.ROOT_LOGGER.unknownChildType(element.getLocalName()));
}
}
writer.writeEndElement();
}
示例12: writePeriodicSizeRotatingFileHandler
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writePeriodicSizeRotatingFileHandler(final XMLExtendedStreamWriter writer, final ModelNode model, final String name) throws XMLStreamException {
writer.writeStartElement(Element.PERIODIC_SIZE_ROTATING_FILE_HANDLER.getLocalName());
writer.writeAttribute(HANDLER_NAME.getXmlName(), name);
AUTOFLUSH.marshallAsAttribute(model, writer);
ENABLED.marshallAsAttribute(model, false, writer);
ROTATE_ON_BOOT.marshallAsAttribute(model, false, writer);
writeCommonHandler(writer, model);
FILE.marshallAsElement(model, writer);
ROTATE_SIZE.marshallAsElement(model, writer);
MAX_BACKUP_INDEX.marshallAsElement(model, writer);
SUFFIX.marshallAsElement(model, writer);
APPEND.marshallAsElement(model, writer);
writer.writeEndElement();
}
示例13: writeContent
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
@Override
public void writeContent(XMLExtendedStreamWriter writer, Resource value) throws XMLStreamException {
if(value != null && this != value) {
throw new IllegalStateException("Wrong target resource.");
}
writer.writeStartElement(ModuleConfigImpl.RESOURCE_ROOT);
writer.writeAttribute(ModuleConfigImpl.PATH, path);
writer.writeEndElement();
}
示例14: writeIncludeExclude
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writeIncludeExclude(XMLExtendedStreamWriter writer, String elementName, ModelNode includeExclude)
throws XMLStreamException {
List<Property> list = includeExclude.asPropertyList();
if (list.isEmpty()) {
return;
}
writer.writeStartElement(elementName);
for (Property current : list) {
// The names where only arbitrary to allow unique referencing.
writePrincipal(writer, current.getName(), current.getValue());
}
writer.writeEndElement();
}
示例15: writeSizeRotatingFileHandler
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writeSizeRotatingFileHandler(final XMLExtendedStreamWriter writer, final ModelNode model, final String name) throws XMLStreamException {
writer.writeStartElement(Element.SIZE_ROTATING_FILE_HANDLER.getLocalName());
writer.writeAttribute(HANDLER_NAME.getXmlName(), name);
AUTOFLUSH.marshallAsAttribute(model, writer);
ENABLED.marshallAsAttribute(model, false, writer);
ROTATE_ON_BOOT.marshallAsAttribute(model, false, writer);
writeCommonHandler(writer, model);
FILE.marshallAsElement(model, writer);
ROTATE_SIZE.marshallAsElement(model, writer);
MAX_BACKUP_INDEX.marshallAsElement(model, writer);
APPEND.marshallAsElement(model, writer);
SizeRotatingHandlerResourceDefinition.SUFFIX.marshallAsElement(model, writer);
writer.writeEndElement();
}