001    /**
002     * Implements the CFML Function structget
003     */
004    package railo.runtime.functions.struct;
005    
006    import railo.runtime.PageContext;
007    import railo.runtime.exp.PageException;
008    import railo.runtime.ext.function.Function;
009    import railo.runtime.type.Struct;
010    import railo.runtime.type.StructImpl;
011    
012    public final class StructGet implements Function {
013            public static Object call(PageContext pc , String string) throws PageException {
014                    try {
015                            Object obj = pc.getVariable(string);
016                            if(obj instanceof Struct)
017                                    return obj;
018                    } 
019                    catch (PageException e) {
020                    }
021                    return pc.setVariable(string,new StructImpl());
022                    
023            }
024    }