Search in sources :

Example 1 with WOComponentReference

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

the class WOHTMLWebObjectTag method _componentReferenceWithClassNameDeclarationAndTemplate.

private static WOElement _componentReferenceWithClassNameDeclarationAndTemplate(String s, WODeclaration wodeclaration, WOElement woelement, NSArray nsarray) throws ClassNotFoundException {
    WOComponentReference wocomponentreference = null;
    WOComponentDefinition wocomponentdefinition = WOApplication.application()._componentDefinition(s, nsarray);
    if (wocomponentdefinition != null) {
        NSDictionary nsdictionary = wodeclaration.associations();
        wocomponentreference = wocomponentdefinition.componentReferenceWithAssociations(nsdictionary, woelement);
    } else {
        throw new ClassNotFoundException("Cannot find class or component named \'" + s + "\" in runtime or in a loadable bundle");
    }
    return wocomponentreference;
}
Also used : WOComponentDefinition(com.webobjects.appserver._private.WOComponentDefinition) NSDictionary(com.webobjects.foundation.NSDictionary) WOComponentReference(com.webobjects.appserver._private.WOComponentReference)

Example 2 with WOComponentReference

use of com.webobjects.appserver._private.WOComponentReference 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 WOComponentReference

use of com.webobjects.appserver._private.WOComponentReference 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 4 with WOComponentReference

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

the class WOHTMLWebObjectTag method _componentReferenceWithClassNameDeclarationAndTemplate.

private static WOElement _componentReferenceWithClassNameDeclarationAndTemplate(String s, WODeclaration wodeclaration, WOElement woelement, NSArray nsarray) throws ClassNotFoundException {
    WOComponentReference wocomponentreference = null;
    WOComponentDefinition wocomponentdefinition = WOApplication.application()._componentDefinition(s, nsarray);
    if (wocomponentdefinition != null) {
        NSDictionary nsdictionary = wodeclaration.associations();
        wocomponentreference = wocomponentdefinition.componentReferenceWithAssociations(nsdictionary, woelement);
    } else {
        throw new ClassNotFoundException("Cannot find class or component named \'" + s + "\" in runtime or in a loadable bundle");
    }
    return wocomponentreference;
}
Also used : WOComponentDefinition(com.webobjects.appserver._private.WOComponentDefinition) NSDictionary(com.webobjects.foundation.NSDictionary) WOComponentReference(com.webobjects.appserver._private.WOComponentReference)

Aggregations

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