本文整理汇总了Java中org.jboss.staxmapper.XMLExtendedStreamReader.getAttributeValue方法的典型用法代码示例。如果您正苦于以下问题:Java XMLExtendedStreamReader.getAttributeValue方法的具体用法?Java XMLExtendedStreamReader.getAttributeValue怎么用?Java XMLExtendedStreamReader.getAttributeValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.staxmapper.XMLExtendedStreamReader
的用法示例。
在下文中一共展示了XMLExtendedStreamReader.getAttributeValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: readElement
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
// The "enabled" attribute is required
ParseUtils.requireAttributes(reader, NEST_ENABLED_ATTR);
// Add the main subsystem 'add' operation
final ModelNode opAdd = new ModelNode();
opAdd.get(OP).set(ADD);
opAdd.get(OP_ADDR).set(PathAddress.pathAddress(SUBSYSTEM_PATH).toModelNode());
String brokerEnabledValue = reader.getAttributeValue(null, NEST_ENABLED_ATTR);
if (brokerEnabledValue != null) {
opAdd.get(NEST_ENABLED_ATTR).set(new ValueExpression(brokerEnabledValue));
}
// Read the children elements
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
String elementName = reader.getLocalName();
if (elementName.equals(CUSTOM_CONFIG_ELEMENT)) {
ModelNode configAttributeNode = opAdd.get(CUSTOM_CONFIG_ELEMENT);
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
if (reader.isStartElement()) {
readCustomConfigurationProperty(reader, configAttributeNode);
}
}
} else if (elementName.equals(NEST_NAME_ELEMENT)) {
opAdd.get(NEST_NAME_ELEMENT).set(new ValueExpression(reader.getElementText()));
} else {
throw ParseUtils.unexpectedElement(reader);
}
}
list.add(opAdd);
}
示例7: readCustomConfigurationProperty
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void readCustomConfigurationProperty(XMLExtendedStreamReader reader, ModelNode configAttributeNode)
throws XMLStreamException {
if (!reader.getLocalName().equals(PROPERTY_ELEMENT)) {
throw ParseUtils.unexpectedElement(reader);
}
ParseUtils.requireAttributes(reader, Attribute.NAME.getLocalName(), Attribute.VALUE.getLocalName());
String attr = reader.getAttributeValue(null, Attribute.NAME.getLocalName());
String val = reader.getAttributeValue(null, Attribute.VALUE.getLocalName());
ParseUtils.requireNoContent(reader);
configAttributeNode.add(attr, val);
}
示例8: parseAuthentication
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private ModelNode parseAuthentication(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.AUTHENTICATION_ELEMENT);
switch(element) {
case AUTHENTICATION_SECURITY_DOMAIN_ATTRIBUTE:
node.get(element.getModelName()).set(attrValue);
break;
case AUTHENTICATION_KRB5_DOMAIN_ATTRIBUTE:
node.get(element.getModelName()).set(attrValue);
break;
case AUTHENTICATION_TYPE_ATTRIBUTE:
node.get(element.getModelName()).set(attrValue);
break;
case AUTHENTICATION_MAX_SESSIONS_ALLOWED_ATTRIBUTE:
node.get(element.getModelName()).set(Integer.parseInt(attrValue));
break;
case AUTHENTICATION_SESSION_EXPIRATION_TIME_LIMIT_ATTRIBUTE:
node.get(element.getModelName()).set(Integer.parseInt(attrValue));
break;
default:
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
}
while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT));
return node;
}
示例9: parseKeystore
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private ModelNode parseKeystore(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_KETSTORE_ELEMENT);
switch(element) {
case SSL_KETSTORE_NAME_ATTRIBUTE:
node.get(element.getModelName()).set(attrValue);
break;
case SSL_KETSTORE_PASSWORD_ATTRIBUTE:
node.get(element.getModelName()).setExpression(attrValue);
break;
case SSL_KETSTORE_TYPE_ATTRIBUTE:
node.get(element.getModelName()).set(attrValue);
break;
case SSL_KETSTORE_ALIAS_ATTRIBUTE:
node.get(element.getModelName()).set(attrValue);
break;
case SSL_KETSTORE_KEY_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;
}
示例10: parseResultsetCacheConfiguration
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private ModelNode parseResultsetCacheConfiguration(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.RESULTSET_CACHE_ELEMENT);
switch(element) {
case RSC_CONTAINER_NAME_ATTRIBUTE:
node.get(element.getModelName()).set(attrValue);
break;
case RSC_ENABLE_ATTRIBUTE:
node.get(element.getModelName()).set(Boolean.parseBoolean(attrValue));
break;
case RSC_MAX_STALENESS_ATTRIBUTE:
node.get(element.getModelName()).set(Integer.parseInt(attrValue));
break;
case RSC_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;
}
示例11: parseSecurityConfigElement
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
void parseSecurityConfigElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
String identifier = null;
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
requireNoNamespaceAttribute(reader, i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case IDENTIFIER:
identifier = reader.getAttributeValue(i);
break;
default:
throw unexpectedAttribute(reader, i);
}
}
if (identifier == null) {
throw missingRequired(reader, Collections.singleton(Attribute.IDENTIFIER));
}
//Add the 'add' operation for each 'security-config' child
ModelNode securityConfigAdd = new ModelNode();
securityConfigAdd.get(OP).set(ModelDescriptionConstants.ADD);
PathAddress addr = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, SwitchYardExtension.SUBSYSTEM_NAME), PathElement.pathElement(SECURITY_CONFIG, identifier));
securityConfigAdd.get(OP_ADDR).set(addr.toModelNode());
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
final Element element1 = Element.forName(reader.getLocalName());
switch (element1) {
case PROPERTIES:
ModelNode properties = parsePropertiesElement(identifier, reader);
if (properties != null) {
securityConfigAdd.get(PROPERTIES).set(properties);
}
break;
default:
throw unexpectedElement(reader);
}
}
list.add(securityConfigAdd);
}
示例12: parseExtensionElement
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
void parseExtensionElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
String identifier = null;
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
requireNoNamespaceAttribute(reader, i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case IDENTIFIER:
identifier = reader.getAttributeValue(i);
break;
default:
throw unexpectedAttribute(reader, i);
}
}
if (identifier == null) {
throw missingRequired(reader, Collections.singleton(Attribute.IDENTIFIER));
}
//Add the 'add' operation for each 'module' child
ModelNode moduleAdd = new ModelNode();
moduleAdd.get(OP).set(ModelDescriptionConstants.ADD);
PathAddress addr = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, SwitchYardExtension.SUBSYSTEM_NAME), PathElement.pathElement(EXTENSION, identifier));
moduleAdd.get(OP_ADDR).set(addr.toModelNode());
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
throw unexpectedElement(reader);
}
list.add(moduleAdd);
}
示例13: parseNativeManagementSocketBinding
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void parseNativeManagementSocketBinding(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException {
// Handle attributes
boolean hasRef = false;
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 NATIVE: {
NativeManagementResourceDefinition.SOCKET_BINDING.parseAndSetParameter(value, addOp, reader);
hasRef = true;
break;
}
default:
throw unexpectedAttribute(reader, i);
}
}
}
if (!hasRef) {
throw missingRequired(reader, Collections.singleton(Attribute.REF.getLocalName()));
}
requireNoContent(reader);
}
示例14: parsePlugIn_Authorization
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void parsePlugIn_Authorization(final XMLExtendedStreamReader reader,
final ModelNode parentAddress, final List<ModelNode> list) throws XMLStreamException {
ModelNode addr = parentAddress.clone().add(PLUG_IN);
ModelNode plugIn = Util.getEmptyOperation(ADD, addr);
list.add(plugIn);
requireSingleAttribute(reader, Attribute.NAME.getLocalName());
// After double checking the name of the only attribute we can retrieve it.
final String plugInName = reader.getAttributeValue(0);
plugIn.get(NAME).set(plugInName);
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
requireNamespace(reader, namespace);
final Element element = Element.forName(reader.getLocalName());
switch (element) {
case PROPERTIES: {
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
requireNamespace(reader, namespace);
final Element propertyElement = Element.forName(reader.getLocalName());
switch (propertyElement) {
case PROPERTY:
parseProperty(reader, addr, list);
break;
default:
throw unexpectedElement(reader);
}
}
break;
}
default: {
throw unexpectedElement(reader);
}
}
}
}
示例15: parseNativeManagementInterfaceAttributes
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void parseNativeManagementInterfaceAttributes(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException {
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 SASL_AUTHENTICATION_FACTORY: {
NativeManagementResourceDefinition.SASL_AUTHENTICATION_FACTORY.parseAndSetParameter(value, addOp, reader);
break;
}
case SASL_PROTOCOL: {
NativeManagementResourceDefinition.SASL_PROTOCOL.parseAndSetParameter(value, addOp, reader);
break;
}
case SECURITY_REALM: {
NativeManagementResourceDefinition.SECURITY_REALM.parseAndSetParameter(value, addOp, reader);
break;
}
case SERVER_NAME: {
NativeManagementResourceDefinition.SERVER_NAME.parseAndSetParameter(value, addOp, reader);
break;
}
case SSL_CONTEXT: {
NativeManagementResourceDefinition.SSL_CONTEXT.parseAndSetParameter(value, addOp, reader);
break;
}
default:
throw unexpectedAttribute(reader, i);
}
}
}
}