本文整理汇总了Java中org.jboss.staxmapper.XMLExtendedStreamReader类的典型用法代码示例。如果您正苦于以下问题:Java XMLExtendedStreamReader类的具体用法?Java XMLExtendedStreamReader怎么用?Java XMLExtendedStreamReader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XMLExtendedStreamReader类属于org.jboss.staxmapper包,在下文中一共展示了XMLExtendedStreamReader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseUsersAuthentication
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseUsersAuthentication(final XMLExtendedStreamReader reader,
final ModelNode realmAddress, final List<ModelNode> list)
throws XMLStreamException {
final ModelNode usersAddress = realmAddress.clone().add(AUTHENTICATION, USERS);
list.add(Util.getEmptyOperation(ADD, usersAddress));
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
requireNamespace(reader, namespace);
final Element element = Element.forName(reader.getLocalName());
switch (element) {
case USER: {
parseUser(reader, usersAddress, list);
break;
}
default: {
throw unexpectedElement(reader);
}
}
}
}
示例2: readElement
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
PathAddress address = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, SmppExtension.SUBSYSTEM_NAME));
final ModelNode subsystem = new ModelNode();
subsystem.get(OP).set(ADD);
subsystem.get(OP_ADDR).set(address.toModelNode());
list.add(subsystem);
// mbean elements
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
switch (Namespace.forUri(reader.getNamespaceURI())) {
case SMPPEXT_1_0: {
final String tagName = reader.getLocalName();
if (tagName.equals(SmppMbeanDefinition.MBEAN)) {
parseMbean(reader, address, list);
}
break;
}
default: {
throw unexpectedElement(reader);
}
}
}
}
示例3: StandaloneXMLParser
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
public StandaloneXMLParser() {
parserDelegate = new StandaloneXml(new ExtensionHandler() {
@Override
public void parseExtensions(XMLExtendedStreamReader reader, ModelNode address, Namespace namespace, List<ModelNode> list) throws XMLStreamException {
reader.discardRemainder(); // noop
}
@Override
public Set<ProfileParsingCompletionHandler> getProfileParsingCompletionHandlers() {
return Collections.emptySet();
}
@Override
public void writeExtensions(XMLExtendedStreamWriter writer, ModelNode modelNode) throws XMLStreamException {
// noop
}
}, ParsingOption.IGNORE_SUBSYSTEM_FAILURES);
xmlMapper = XMLMapper.Factory.create();
addDelegate(new QName(Namespace.CURRENT.getUriString(), SERVER), parserDelegate);
addDelegate(new QName("urn:jboss:domain:4.1", SERVER), parserDelegate);
addDelegate(new QName("urn:jboss:domain:4.0", SERVER), parserDelegate);
addDelegate(new QName("urn:jboss:domain:2.0", SERVER), parserDelegate);
}
示例4: StandaloneXmlParser
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
public StandaloneXmlParser() {
parserDelegate = new StandaloneXml(new ExtensionHandler() {
@Override
public void parseExtensions(XMLExtendedStreamReader reader, ModelNode address, Namespace namespace, List<ModelNode> list) throws XMLStreamException {
reader.discardRemainder(); // noop
}
@Override
public Set<ProfileParsingCompletionHandler> getProfileParsingCompletionHandlers() {
return Collections.EMPTY_SET;
}
@Override
public void writeExtensions(XMLExtendedStreamWriter writer, ModelNode modelNode) throws XMLStreamException {
// noop
}
}, ParsingOption.IGNORE_SUBSYSTEM_FAILURES);
xmlMapper = XMLMapper.Factory.create();
xmlMapper.registerRootElement(new QName("urn:jboss:domain:4.0", "server"), parserDelegate);
}
示例5: parseObjectReplicator
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private ModelNode parseObjectReplicator(XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException {
if (reader.getAttributeCount() > 0) {
for(int i=0; i<reader.getAttributeCount(); i++) {
String attrName = reader.getAttributeLocalName(i);
String attrValue = reader.getAttributeValue(i);
Element element = Element.forName(attrName, Element.DISTRIBUTED_CACHE);
switch(element) {
case DC_STACK_ATTRIBUTE:
node.get(element.getModelName()).set(attrValue);
break;
default:
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
}
while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT));
return node;
}
示例6: parsePg
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private ModelNode parsePg(XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException {
if (reader.getAttributeCount() > 0) {
for(int i=0; i<reader.getAttributeCount(); i++) {
String attrName = reader.getAttributeLocalName(i);
String attrValue = reader.getAttributeValue(i);
Element element = Element.forName(attrName, Element.PG_ELEMENT);
switch(element) {
case PG_MAX_LOB_SIZE_ALLOWED_ELEMENT:
node.get(element.getModelName()).set(attrValue);
break;
default:
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
}
while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT));
return node;
}
示例7: parseTruststore
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private ModelNode parseTruststore(XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException {
if (reader.getAttributeCount() > 0) {
for(int i=0; i<reader.getAttributeCount(); i++) {
String attrName = reader.getAttributeLocalName(i);
String attrValue = reader.getAttributeValue(i);
Element element = Element.forName(attrName, Element.SSL_TRUSTSTORE_ELEMENT);
switch(element) {
case SSL_TRUSTSTORE_NAME_ATTRIBUTE:
node.get(element.getModelName()).set(attrValue);
break;
case SSL_TRUSTSTORE_PASSWORD_ATTRIBUTE:
node.get(element.getModelName()).setExpression(attrValue);
break;
default:
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
}
while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT));
return node;
}
示例8: parsePreparedPlanCacheConfiguration
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private ModelNode parsePreparedPlanCacheConfiguration(XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException {
if (reader.getAttributeCount() > 0) {
for(int i=0; i<reader.getAttributeCount(); i++) {
String attrName = reader.getAttributeLocalName(i);
String attrValue = reader.getAttributeValue(i);
Element element = Element.forName(attrName, Element.PREPAREDPLAN_CACHE_ELEMENT);
switch(element) {
case PPC_CONTAINER_NAME_ELEMENT:
node.get(element.getModelName()).set(attrValue);
break;
case PPC_ENABLE_ATTRIBUTE:
node.get(element.getModelName()).set(Boolean.parseBoolean(attrValue));
break;
case PPC_NAME_ATTRIBUTE:
node.get(element.getModelName()).set(attrValue);
break;
default:
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
}
while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT));
return node;
}
示例9: parseTranslator
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private String parseTranslator(XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException {
String translatorName = null;
if (reader.getAttributeCount() > 0) {
for(int i=0; i<reader.getAttributeCount(); i++) {
String attrName = reader.getAttributeLocalName(i);
String attrValue = reader.getAttributeValue(i);
Element element = Element.forName(attrName);
switch(element) {
case TRANSPORT_NAME_ATTRIBUTE:
case TRANSLATOR_NAME_ATTRIBUTE:
translatorName = attrValue;
break;
case TRANSLATOR_MODULE_ATTRIBUTE:
node.get(element.getModelName()).set(attrValue);
break;
default:
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
}
while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
throw ParseUtils.unexpectedElement(reader);
}
return translatorName;
}
示例10: parseSecurityConfigsElement
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
void parseSecurityConfigsElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
// Handle attributes
requireNoAttributes(reader);
// Handle module elements
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
if (reader.getNamespaceURI().equals(SwitchYardExtension.NAMESPACE)) {
final Element element = Element.forName(reader.getLocalName());
if (element == Element.SECURITY_CONFIG) {
parseSecurityConfigElement(reader, list);
} else {
throw unexpectedElement(reader);
}
}
}
}
示例11: parseModulesElement
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
void parseModulesElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
// Handle attributes
requireNoAttributes(reader);
// Handle module elements
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
if (reader.getNamespaceURI().equals(SwitchYardExtension.NAMESPACE)) {
final Element element = Element.forName(reader.getLocalName());
if (element == Element.MODULE) {
parseModuleElement(reader, list);
} else {
throw unexpectedElement(reader);
}
}
}
}
示例12: parseExtensionsElement
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
void parseExtensionsElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
// Handle attributes
requireNoAttributes(reader);
// Handle module elements
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
if (reader.getNamespaceURI().equals(SwitchYardExtension.NAMESPACE)) {
final Element element = Element.forName(reader.getLocalName());
if (element == Element.EXTENSION) {
parseExtensionElement(reader, list);
} else {
throw unexpectedElement(reader);
}
}
}
}
示例13: parseRemoteDomainController_1_5
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseRemoteDomainController_1_5(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list) throws XMLStreamException {
parseRemoteDomainControllerAttributes_1_5(reader, address, list, false);
Set<String> types = new HashSet<String>();
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
requireNamespace(reader, namespace);
final Element element = Element.forName(reader.getLocalName());
switch (element) {
case IGNORED_RESOURCE: {
parseIgnoredResource(reader, address, list, types);
break;
}
default:
throw unexpectedElement(reader);
}
}
}
示例14: readDefaultProtocol_2_0
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private void readDefaultProtocol_2_0(XMLExtendedStreamReader reader, Namespace expectedNs, CliConfigImpl config)
throws XMLStreamException {
final int attributes = reader.getAttributeCount();
for (int i = 0; i < attributes; i++) {
String namespace = reader.getAttributeNamespace(i);
String localName = reader.getAttributeLocalName(i);
String value = reader.getAttributeValue(i);
if (namespace != null && !namespace.equals("")) {
throw new XMLStreamException("Unexpected attribute '" + namespace + ":" + localName + "'",
reader.getLocation());
} else if (localName.equals(USE_LEGACY_OVERRIDE)) {
config.useLegacyOverride = Boolean.parseBoolean(value);
} else {
throw new XMLStreamException("Unexpected attribute '" + localName + "'", reader.getLocation());
}
}
final String resolved = resolveString(reader.getElementText());
if (resolved != null && resolved.length() > 0) {
config.defaultControllerProtocol = resolved;
}
}
示例15: parseKerberosAuthentication
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseKerberosAuthentication(final XMLExtendedStreamReader reader,
final ModelNode realmAddress, final List<ModelNode> list) throws XMLStreamException {
ModelNode addr = realmAddress.clone().add(AUTHENTICATION, KERBEROS);
ModelNode kerberos = Util.getEmptyOperation(ADD, addr);
list.add(kerberos);
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
if (!isNoNamespaceAttribute(reader, i)) {
throw unexpectedAttribute(reader, i);
} else {
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case REMOVE_REALM:
KerberosAuthenticationResourceDefinition.REMOVE_REALM.parseAndSetParameter(value, kerberos, reader);
break;
default: {
throw unexpectedAttribute(reader, i);
}
}
}
}
requireNoContent(reader);
}