本文整理匯總了Java中org.jboss.dmr.ModelNode.asPropertyList方法的典型用法代碼示例。如果您正苦於以下問題:Java ModelNode.asPropertyList方法的具體用法?Java ModelNode.asPropertyList怎麽用?Java ModelNode.asPropertyList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jboss.dmr.ModelNode
的用法示例。
在下文中一共展示了ModelNode.asPropertyList方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: validateParameter
import org.jboss.dmr.ModelNode; //導入方法依賴的package包/類
@Override
public void validateParameter(String parameterName, ModelNode values) throws OperationFailedException {
for (Property property : values.asPropertyList()) {
if (!VALID_PROPERTIES.containsKey(property.getName())) {
throw new OperationFailedException("Invalid property name: " + property.getName());
}
if (!VALID_PROPERTIES.get(property.getName()).contains(property.getValue().asString().toUpperCase())) {
throw new OperationFailedException(
"Invalid value of property " + property.getName() + ": " + property.getValue());
}
}
}
示例2: writeContent
import org.jboss.dmr.ModelNode; //導入方法依賴的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();
}