protected void writeAttributeExpressions( final WriteableDocumentBundle bundle, final BundleWriterState state,
final Element element, final XmlWriter writer ) throws IOException, BundleWriterException {
if ( bundle == null ) {
throw new NullPointerException();
}
if ( state == null ) {
throw new NullPointerException();
}
if ( element == null ) {
throw new NullPointerException();
}
if ( writer == null ) {
throw new NullPointerException();
}
final String[] attributeNamespaces = element.getAttributeExpressionNamespaces();
for ( int i = 0; i < attributeNamespaces.length; i++ ) {
final String namespace = attributeNamespaces[i];
final String[] attributeNames = element.getAttributeExpressionNames( namespace );
for ( int j = 0; j < attributeNames.length; j++ ) {
final String name = attributeNames[j];
final AttributeList attList = new AttributeList();
attList.setAttribute( BundleNamespaces.LAYOUT, "namespace", namespace );
attList.setAttribute( BundleNamespaces.LAYOUT, "name", name );
final Expression ex = element.getAttributeExpression( namespace, name );
ExpressionWriterUtility.writeExpressionCore( bundle, state, ex, writer, BundleNamespaces.LAYOUT,
"attribute-expression", attList );
}
}
}