//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: @Override public void marshallAsElement(org.jboss.as.controller.AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault, javax.xml.stream.XMLStreamWriter writer) throws javax.xml.stream.XMLStreamException public override void marshallAsElement(AttributeDefinition attribute, ModelNode resourceModel, bool marshallDefault, XMLStreamWriter writer) { resourceModel = resourceModel.get(attribute.XmlName); writer.writeStartElement(attribute.Name); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final java.util.List<org.jboss.dmr.Property> properties = resourceModel.asPropertyList(); IList <Property> properties = resourceModel.asPropertyList(); foreach (Property property in properties) { writer.writeStartElement([email protected]); writer.writeAttribute([email protected], property.Name); writer.writeCharacters(property.Value.asString()); writer.writeEndElement(); } writer.writeEndElement(); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: @Override public void marshallAsElement(org.jboss.as.controller.AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault, javax.xml.stream.XMLStreamWriter writer) throws javax.xml.stream.XMLStreamException public override void marshallAsElement(AttributeDefinition attribute, ModelNode resourceModel, bool marshallDefault, XMLStreamWriter writer) { Debug.Assert(attribute is ObjectListAttributeDefinition); ObjectListAttributeDefinition list = ((ObjectListAttributeDefinition)attribute); ObjectTypeAttributeDefinition objectType = (ObjectTypeAttributeDefinition)CustomMarshaller.getValueType(list, typeof(ObjectListAttributeDefinition)); AttributeDefinition[] valueTypes = CustomMarshaller.getValueTypes(list, typeof(ObjectTypeAttributeDefinition)); if (resourceModel.hasDefined(attribute.Name)) { writer.writeStartElement(attribute.XmlName); foreach (ModelNode element in resourceModel.get(attribute.Name).asList()) { writer.writeStartElement(objectType.XmlName); foreach (AttributeDefinition valueType in valueTypes) { valueType.AttributeMarshaller.marshallAsElement(valueType, element, false, writer); } writer.writeEndElement(); } writer.writeEndElement(); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: @Override public void marshallAsElement(org.jboss.as.controller.AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault, javax.xml.stream.XMLStreamWriter writer) throws javax.xml.stream.XMLStreamException public override void marshallAsElement(AttributeDefinition attribute, ModelNode resourceModel, bool marshallDefault, XMLStreamWriter writer) { if (attribute is ObjectListAttributeDefinition) { attribute = getValueType(attribute, typeof(ObjectListAttributeDefinition)); } if (!(attribute is ObjectTypeAttributeDefinition)) { throw new XMLStreamException(string.Format("Attribute of class {0} is expected, but {1} received", "ObjectTypeAttributeDefinition", attribute.GetType().Name)); } AttributeDefinition[] valueTypes; valueTypes = CustomMarshaller.getValueTypes(attribute, typeof(ObjectTypeAttributeDefinition)); writer.writeStartElement(attribute.XmlName); foreach (AttributeDefinition valueType in valueTypes) { valueType.marshallAsElement(resourceModel, marshallDefault, writer); } writer.writeEndElement(); }