Example usage for com.google.gwt.uibinder.rebind XMLElement consumeRawArrayAttribute

List of usage examples for com.google.gwt.uibinder.rebind XMLElement consumeRawArrayAttribute

Introduction

In this page you can find the example usage for com.google.gwt.uibinder.rebind XMLElement consumeRawArrayAttribute.

Prototype

public String[] consumeRawArrayAttribute(String name) 

Source Link

Document

Consumes the named attribute and parses it to an unparsed, unescaped array of Strings.

Usage

From source file:com.jhickman.web.gwt.gxtuibinder.elementparsers.util.ElementParserUtil.java

License:Apache License

public static String parseAttributeWithArrayConstructor(XMLElement elem, String attributeName, String typeName,
        UiBinderWriter writer) throws UnableToCompleteException {
    String[] arrayData = elem.consumeRawArrayAttribute(attributeName);

    if (arrayData != null && arrayData.length > 0) {
        JClassType type = writer.getOracle().findType(typeName);
        String fieldName = writer.declareField(typeName, elem);
        writer.setFieldInitializerAsConstructor(fieldName, type, arrayData);
        return fieldName;
    }/*from w ww .  j  ava2 s.  co  m*/

    return null;
}