本文整理汇总了Java中org.jboss.as.controller.parsing.ParseUtils.unexpectedAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java ParseUtils.unexpectedAttribute方法的具体用法?Java ParseUtils.unexpectedAttribute怎么用?Java ParseUtils.unexpectedAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.as.controller.parsing.ParseUtils
的用法示例。
在下文中一共展示了ParseUtils.unexpectedAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseObjectReplicator
import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的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.as.controller.parsing.ParseUtils; //导入方法依赖的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.as.controller.parsing.ParseUtils; //导入方法依赖的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.as.controller.parsing.ParseUtils; //导入方法依赖的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.as.controller.parsing.ParseUtils; //导入方法依赖的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: parseChild
import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
private ModelNode parseChild(XMLExtendedStreamReader reader) throws XMLStreamException {
ModelNode add = null;
int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
final String attribute = reader.getAttributeLocalName(i);
switch (attribute) {
case "name": {
add = Util.createAddOperation(PathAddress.pathAddress(
PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, SUBSYSTEM_NAME),
PathElement.pathElement("child", value)));
break;
}
default: {
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
}
if (add == null) {
throw ParseUtils.missingRequired(reader, Collections.singleton("child"));
}
// Require no content
ParseUtils.requireNoContent(reader);
return add;
}
示例7: parseHostRelease
import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
private void parseHostRelease(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException {
boolean sawId = false;
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
if (!isNoNamespaceAttribute(reader, i)) {
throw ParseUtils.unexpectedAttribute(reader, i);
}
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
if (attribute == Attribute.ID) {
sawId = true;
HostExcludeResourceDefinition.HOST_RELEASE.parseAndSetParameter(value, addOp, reader);
} else {
throw unexpectedAttribute(reader, i);
}
}
if (!sawId) {
throw missingRequired(reader, Attribute.ID.getLocalName());
}
requireNoContent(reader);
}
示例8: parseAuthentication
import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的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.as.controller.parsing.ParseUtils; //导入方法依赖的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.as.controller.parsing.ParseUtils; //导入方法依赖的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: readMetricsGroups
import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
private void readMetricsGroups(XMLExtendedStreamReader reader, PathAddress parentAddress, List<ModelNode> list) throws XMLStreamException {
final ModelNode addScheduleOperation = Util.getEmptyOperation(ADD, null);
String schedule = null;
for (int i = 0; i < reader.getAttributeCount(); i++) {
String attr = reader.getAttributeLocalName(i);
String value = reader.getAttributeValue(i);
if(Constants.CRON.equals(attr)) {
schedule = com.openshift.metrics.extension.Util.encodeCronExpression(value);
} else if(Constants.ENABLED.equals(attr)) {
MetricsGroupDefinition.ENABLED.parseAndSetParameter(value, addScheduleOperation, reader);
} else {
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
final PathAddress address = parentAddress.append(PathElement.pathElement(Constants.METRICS_GROUP, schedule));
addScheduleOperation.get(OP_ADDR).set(address.toModelNode());
list.add(addScheduleOperation);
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
if(!reader.getLocalName().equals(Constants.SOURCE)) {
throw ParseUtils.unexpectedElement(reader);
}
readSource(reader, address, list);
}
}
示例12: parseLaunchCommand
import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
private static void parseLaunchCommand(final XMLExtendedStreamReader reader, ModelNode addOp)
throws XMLStreamException {
// Handle attributes
boolean valueSet = false;
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
if (!isNoNamespaceAttribute(reader, i)) {
throw ParseUtils.unexpectedAttribute(reader, i);
} else {
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case PREFIX: {
if (checkParseAndSetParameter(JvmAttributes.LAUNCH_COMMAND, value, addOp, reader)) {
throw ParseUtils.duplicateNamedElement(reader, reader.getLocalName());
}
valueSet = true;
break;
}
default:
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
}
if (!valueSet) {
throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.PREFIX));
}
// Handle elements
requireNoContent(reader);
}
示例13: parseStack
import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
private static void parseStack(final XMLExtendedStreamReader reader, ModelNode addOp)
throws XMLStreamException {
// Handle attributes
boolean sizeSet = false;
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
if (!isNoNamespaceAttribute(reader, i)) {
throw ParseUtils.unexpectedAttribute(reader, i);
} else {
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case SIZE: {
sizeSet = true;
if (checkParseAndSetParameter(JvmAttributes.STACK_SIZE, value, addOp, reader)){
throw ParseUtils.duplicateNamedElement(reader, reader.getLocalName());
}
break;
}
default:
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
}
if (!sizeSet) {
throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.SIZE));
}
// Handle elements
requireNoContent(reader);
}
示例14: parseConnector
import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
void parseConnector(XMLExtendedStreamReader reader) throws XMLStreamException {
JmxLogger.ROOT_LOGGER.jmxConnectorNotSupported();
String serverBinding = null;
String registryBinding = null;
int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
final String attribute = reader.getAttributeLocalName(i);
switch (attribute) {
case CommonAttributes.SERVER_BINDING: {
serverBinding = value;
break;
}
case CommonAttributes.REGISTRY_BINDING: {
registryBinding = value;
break;
}
default: {
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
}
// Require no content
ParseUtils.requireNoContent(reader);
if (serverBinding == null) {
throw ParseUtils.missingRequired(reader, Collections.singleton(CommonAttributes.SERVER_BINDING));
}
if (registryBinding == null) {
throw ParseUtils.missingRequired(reader, Collections.singleton(CommonAttributes.REGISTRY_BINDING));
}
}
示例15: parseJavaagent
import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
private static void parseJavaagent(final XMLExtendedStreamReader reader, ModelNode addOp)
throws XMLStreamException {
// Handle attributes
boolean valueSet = false;
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
if (!isNoNamespaceAttribute(reader, i)) {
throw ParseUtils.unexpectedAttribute(reader, i);
} else {
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case VALUE: {
if (checkParseAndSetParameter(JvmAttributes.JAVA_AGENT, value, addOp, reader)) {
throw ParseUtils.duplicateNamedElement(reader, reader.getLocalName());
}
valueSet = true;
break;
}
default:
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
}
if (!valueSet) {
throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.VALUE));
}
// Handle elements
requireNoContent(reader);
}