Search in sources :

Example 1 with WOHTMLBareString

use of com.webobjects.appserver._private.WOHTMLBareString in project wonder-slim by undur.

the class WOHTMLWebObjectTag method template.

public WOElement template() {
    NSMutableArray nsmutablearray = null;
    if (_children == null) {
        return null;
    }
    Enumeration enumeration = _children.objectEnumerator();
    if (enumeration != null) {
        nsmutablearray = new NSMutableArray(_children.count());
        StringBuilder stringbuffer = new StringBuilder(128);
        while (enumeration.hasMoreElements()) {
            Object obj1 = enumeration.nextElement();
            if (obj1 instanceof String) {
                stringbuffer.append((String) obj1);
            } else {
                if (stringbuffer.length() > 0) {
                    WOHTMLBareString wohtmlbarestring1 = new WOHTMLBareString(stringbuffer.toString());
                    nsmutablearray.addObject(wohtmlbarestring1);
                    stringbuffer.setLength(0);
                }
                nsmutablearray.addObject(obj1);
            }
        }
        if (stringbuffer.length() > 0) {
            WOHTMLBareString wohtmlbarestring = new WOHTMLBareString(stringbuffer.toString());
            stringbuffer.setLength(0);
            nsmutablearray.addObject(wohtmlbarestring);
        }
    }
    WOElement obj = null;
    if (nsmutablearray != null && nsmutablearray.count() == 1) {
        Object obj2 = nsmutablearray.objectAtIndex(0);
        if (obj2 instanceof WOComponentReference) {
            obj = new WODynamicGroup(_name, null, (WOElement) obj2);
        } else {
            obj = (WOElement) obj2;
        }
    } else {
        obj = new WODynamicGroup(_name, null, nsmutablearray);
    }
    return obj;
}
Also used : Enumeration(java.util.Enumeration) NSMutableArray(com.webobjects.foundation.NSMutableArray) WODynamicGroup(com.webobjects.appserver._private.WODynamicGroup) WOHTMLBareString(com.webobjects.appserver._private.WOHTMLBareString) WOHTMLBareString(com.webobjects.appserver._private.WOHTMLBareString) WOComponentReference(com.webobjects.appserver._private.WOComponentReference) WOElement(com.webobjects.appserver.WOElement)

Example 2 with WOHTMLBareString

use of com.webobjects.appserver._private.WOHTMLBareString in project wonder-slim by undur.

the class WOHTMLWebObjectTag method template.

public WOElement template() {
    NSMutableArray nsmutablearray = null;
    if (_children == null) {
        return null;
    }
    Enumeration enumeration = _children.objectEnumerator();
    if (enumeration != null) {
        nsmutablearray = new NSMutableArray(_children.count());
        StringBuilder stringbuffer = new StringBuilder(128);
        while (enumeration.hasMoreElements()) {
            Object obj1 = enumeration.nextElement();
            if (obj1 instanceof String) {
                stringbuffer.append((String) obj1);
            } else {
                if (stringbuffer.length() > 0) {
                    WOHTMLBareString wohtmlbarestring1 = new WOHTMLBareString(stringbuffer.toString());
                    nsmutablearray.addObject(wohtmlbarestring1);
                    stringbuffer.setLength(0);
                }
                nsmutablearray.addObject(obj1);
            }
        }
        if (stringbuffer.length() > 0) {
            WOHTMLBareString wohtmlbarestring = new WOHTMLBareString(stringbuffer.toString());
            stringbuffer.setLength(0);
            nsmutablearray.addObject(wohtmlbarestring);
        }
    }
    WOElement obj = null;
    if (nsmutablearray != null && nsmutablearray.count() == 1) {
        Object obj2 = nsmutablearray.objectAtIndex(0);
        if (obj2 instanceof WOComponentReference) {
            obj = new WODynamicGroup(_name, null, (WOElement) obj2);
        } else {
            obj = (WOElement) obj2;
        }
    } else {
        obj = new WODynamicGroup(_name, null, nsmutablearray);
    }
    return obj;
}
Also used : Enumeration(java.util.Enumeration) NSMutableArray(com.webobjects.foundation.NSMutableArray) WODynamicGroup(com.webobjects.appserver._private.WODynamicGroup) WOHTMLBareString(com.webobjects.appserver._private.WOHTMLBareString) WOHTMLBareString(com.webobjects.appserver._private.WOHTMLBareString) WOComponentReference(com.webobjects.appserver._private.WOComponentReference) WOElement(com.webobjects.appserver.WOElement)

Example 3 with WOHTMLBareString

use of com.webobjects.appserver._private.WOHTMLBareString in project wonder-slim by undur.

the class ERXWOSwitch method childCaseInContext.

protected WOElement childCaseInContext(WOContext context) {
    Object value = _case.valueInComponent(context.component());
    value = (value == null ? "default" : value);
    WOElement result = _childCases.objectForKey(value);
    if (result == null) {
        result = _childCases.objectForKey("default");
    }
    if (result == null) {
        result = new WOHTMLBareString("");
    }
    return result;
}
Also used : WOHTMLBareString(com.webobjects.appserver._private.WOHTMLBareString) WOElement(com.webobjects.appserver.WOElement)

Aggregations

WOElement (com.webobjects.appserver.WOElement)3 WOHTMLBareString (com.webobjects.appserver._private.WOHTMLBareString)3 WOComponentReference (com.webobjects.appserver._private.WOComponentReference)2 WODynamicGroup (com.webobjects.appserver._private.WODynamicGroup)2 NSMutableArray (com.webobjects.foundation.NSMutableArray)2 Enumeration (java.util.Enumeration)2