本文整理汇总了Java中org.jboss.staxmapper.XMLExtendedStreamWriter.writeStartElement方法的典型用法代码示例。如果您正苦于以下问题:Java XMLExtendedStreamWriter.writeStartElement方法的具体用法?Java XMLExtendedStreamWriter.writeStartElement怎么用?Java XMLExtendedStreamWriter.writeStartElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.staxmapper.XMLExtendedStreamWriter
的用法示例。
在下文中一共展示了XMLExtendedStreamWriter.writeStartElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeLocalOutboundConnection
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writeLocalOutboundConnection(final XMLExtendedStreamWriter writer, final String connectionName, final ModelNode model) throws XMLStreamException {
// <local-outbound-connection>
writer.writeStartElement(Element.LOCAL_OUTBOUND_CONNECTION.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), connectionName);
final String outboundSocketRef = model.get(OUTBOUND_SOCKET_BINDING_REF).asString();
writer.writeAttribute(Attribute.OUTBOUND_SOCKET_BINDING_REF.getLocalName(), outboundSocketRef);
// write the connection-creation-options if any
if (model.hasDefined(PROPERTY)) {
writeProperties(writer, model.get(PROPERTY));
}
// </local-outbound-connection>
writer.writeEndElement();
}
示例2: writePrincipal
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writePrincipal(XMLExtendedStreamWriter writer, String alias, ModelNode principal) throws XMLStreamException {
String elementName = principal.require(TYPE).asString().equalsIgnoreCase(GROUP) ? Element.GROUP.getLocalName() : Element.USER.getLocalName();
writer.writeStartElement(elementName);
String realm = principal.get(REALM).isDefined() ? principal.require(REALM).asString() : null;
String name = principal.require(NAME).asString();
String expectedAlias = AccessControlXml.generateAlias(elementName, name, realm);
if (alias.equals(expectedAlias)==false) {
writeAttribute(writer, Attribute.ALIAS, alias);
}
PrincipalResourceDefinition.REALM.marshallAsAttribute(principal, writer);
PrincipalResourceDefinition.NAME.marshallAsAttribute(principal, writer);
writer.writeEndElement();
}
示例3: writeConnector
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writeConnector(final XMLExtendedStreamWriter writer, final ModelNode node, final String name) throws XMLStreamException {
writer.writeStartElement(Element.CONNECTOR.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), name);
ConnectorResource.SOCKET_BINDING.marshallAsAttribute(node, writer);
ConnectorResource.SSL_CONTEXT.marshallAsAttribute(node, writer);
if (node.hasDefined(SECURITY_REALM)) {
writer.writeAttribute(Attribute.SECURITY_REALM.getLocalName(), node.require(SECURITY_REALM).asString());
}
ConnectorCommon.SERVER_NAME.marshallAsAttribute(node, writer);
ConnectorCommon.SASL_PROTOCOL.marshallAsAttribute(node, writer);
ConnectorResource.SASL_AUTHENTICATION_FACTORY.marshallAsAttribute(node, writer);
ConnectorResource.AUTHENTICATION_PROVIDER.marshallAsElement(node, writer);
if (node.hasDefined(PROPERTY)) {
writeProperties(writer, node.get(PROPERTY));
}
if (node.hasDefined(SECURITY) && node.get(SECURITY).hasDefined(SASL)) {
writeSasl(writer, node.get(SECURITY, SASL));
}
writer.writeEndElement();
}
示例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: writeExtensions
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
public void writeExtensions(final XMLExtendedStreamWriter writer, final ModelNode modelNode) throws XMLStreamException {
Set<String> keys = modelNode.keys();
if (keys.size() > 0) {
writer.writeStartElement(Element.EXTENSIONS.getLocalName());
for (final String extension : keys) {
writer.writeEmptyElement(Element.EXTENSION.getLocalName());
writer.writeAttribute(Attribute.MODULE.getLocalName(), extension);
}
writer.writeEndElement();
}
}
示例9: writeSyslogHandler
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writeSyslogHandler(final XMLExtendedStreamWriter writer, final ModelNode model, final String name) throws XMLStreamException {
writer.writeStartElement(Element.SYSLOG_HANDLER.getLocalName());
writer.writeAttribute(HANDLER_NAME.getXmlName(), name);
ENABLED.marshallAsAttribute(model, false, writer);
LEVEL.marshallAsElement(model, writer);
SERVER_ADDRESS.marshallAsElement(model, writer);
HOSTNAME.marshallAsElement(model, writer);
PORT.marshallAsElement(model, writer);
APP_NAME.marshallAsElement(model, writer);
SYSLOG_FORMATTER.marshallAsElement(model, writer);
FACILITY.marshallAsElement(model, writer);
writer.writeEndElement();
}
示例10: writeDiscoveryOptionProperties
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writeDiscoveryOptionProperties(XMLExtendedStreamWriter writer, ModelNode discoveryOptionProperties) throws XMLStreamException {
for (String property : discoveryOptionProperties.keys()) {
writer.writeStartElement(Element.PROPERTY.getLocalName());
WriteUtils.writeAttribute(writer, Attribute.NAME, property);
WriteUtils.writeAttribute(writer, Attribute.VALUE, discoveryOptionProperties.get(property).asString());
writer.writeEndElement();
}
}
示例11: writeContent
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
@Override
public void writeContent(XMLExtendedStreamWriter writer, Dependency value) throws XMLStreamException {
if(value != null && this != value) {
throw new IllegalStateException("Wrong target dependency.");
}
writer.writeStartElement(ModuleConfigImpl.MODULE);
writer.writeAttribute(ModuleConfigImpl.NAME, name);
if (export) {
writer.writeAttribute(ModuleConfigImpl.EXPORT, "true");
}
writer.writeEndElement();
}
示例12: writeHostScopedRoles
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writeHostScopedRoles(XMLExtendedStreamWriter writer, ModelNode scopedRoles) throws XMLStreamException {
writer.writeStartElement(Element.HOST_SCOPED_ROLES.getLocalName());
for (Property property : scopedRoles.asPropertyList()) {
writer.writeStartElement(Element.ROLE.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), property.getName());
ModelNode value = property.getValue();
HostScopedRolesResourceDefinition.BASE_ROLE.marshallAsAttribute(value, writer);
HostScopedRolesResourceDefinition.HOSTS.marshallAsElement(value, writer);
writer.writeEndElement();
}
writer.writeEndElement();
}
示例13: writeServerGroup
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writeServerGroup(final XMLExtendedStreamWriter writer, final String groupName, final ModelNode group) throws XMLStreamException {
writer.writeStartElement(Element.SERVER_GROUP.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), groupName);
ServerGroupResourceDefinition.PROFILE.marshallAsAttribute(group, writer);
ServerGroupResourceDefinition.MANAGEMENT_SUBSYSTEM_ENDPOINT.marshallAsAttribute(group, writer);
// JVM
if (group.hasDefined(JVM)) {
for (final Property jvm : group.get(JVM).asPropertyList()) {
JvmXml.writeJVMElement(writer, jvm.getName(), jvm.getValue());
break; // TODO just write the first !?
}
}
// Socket binding ref
if (group.hasDefined(SOCKET_BINDING_GROUP) || group.hasDefined(SOCKET_BINDING_PORT_OFFSET)) {
writer.writeStartElement(Element.SOCKET_BINDING_GROUP.getLocalName());
ServerGroupResourceDefinition.SOCKET_BINDING_GROUP.marshallAsAttribute(group, writer);
ServerGroupResourceDefinition.SOCKET_BINDING_PORT_OFFSET.marshallAsAttribute(group, writer);
ServerGroupResourceDefinition.SOCKET_BINDING_DEFAULT_INTERFACE.marshallAsAttribute(group, writer);
writer.writeEndElement();
}
if (group.hasDefined(DEPLOYMENT)) {
writeServerGroupDeployments(writer, group.get(DEPLOYMENT));
}
if (group.hasDefined(DEPLOYMENT_OVERLAY)) {
writeDeploymentOverlays(writer, group.get(DEPLOYMENT_OVERLAY));
WriteUtils.writeNewLine(writer);
}
// System properties
if (group.hasDefined(SYSTEM_PROPERTY)) {
writeProperties(writer, group.get(SYSTEM_PROPERTY), Element.SYSTEM_PROPERTIES, false);
}
writer.writeEndElement();
}
示例14: writeFileHandler
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writeFileHandler(final XMLExtendedStreamWriter writer, final ModelNode model, final String name) throws XMLStreamException {
writer.writeStartElement(Element.FILE_HANDLER.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), name);
AUTOFLUSH.marshallAsAttribute(model, writer);
ENABLED.marshallAsAttribute(model, false, writer);
writeCommonHandler(writer, model);
FILE.marshallAsElement(model, writer);
APPEND.marshallAsElement(model, writer);
writer.writeEndElement();
}
示例15: writeFileAuditLogHandler
import org.jboss.staxmapper.XMLExtendedStreamWriter; //导入方法依赖的package包/类
private void writeFileAuditLogHandler(XMLExtendedStreamWriter writer, ModelNode auditLog, String name) throws XMLStreamException {
// added ROTATE_AT_STARTUP attribute
if (auditLog.hasDefined(ModelDescriptionConstants.FILE_HANDLER, name)) {
writer.writeStartElement(Element.FILE_HANDLER.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), name);
ModelNode handler = auditLog.get(ModelDescriptionConstants.FILE_HANDLER, name);
FileAuditLogHandlerResourceDefinition.FORMATTER.marshallAsAttribute(handler, writer);
FileAuditLogHandlerResourceDefinition.MAX_FAILURE_COUNT.marshallAsAttribute(handler, writer);
FileAuditLogHandlerResourceDefinition.PATH.marshallAsAttribute(handler, writer);
FileAuditLogHandlerResourceDefinition.RELATIVE_TO.marshallAsAttribute(handler, writer);
FileAuditLogHandlerResourceDefinition.ROTATE_AT_STARTUP.marshallAsAttribute(handler, writer);
writer.writeEndElement();
}
}