Package freemarker.template.utility

Examples of freemarker.template.utility.UndeclaredThrowableException


                final TemplateModelIterator i;
                try {
                     i = getModelEx().keys().iterator();
                }
                catch(TemplateModelException e) {
                    throw new UndeclaredThrowableException(e);
                }
                return new Iterator() {
                    public boolean hasNext() {
                        try {
                            return i.hasNext();
                        }
                        catch(TemplateModelException e) {
                            throw new UndeclaredThrowableException(e);
                        }
                    }
                   
                    public Object next() {
                        final Object key;
                        try {
                            key = wrapper.unwrap(i.next());
                        }
                        catch(TemplateModelException e) {
                            throw new UndeclaredThrowableException(e);
                        }
                        return new Map.Entry() {
                            public Object getKey() {
                                return key;
                            }
                           
                            public Object getValue() {
                                return get(key);
                            }
                           
                            public Object setValue(Object value) {
                                throw new UnsupportedOperationException();
                            }
                           
                            public boolean equals(Object o) {
                                if (!(o instanceof Map.Entry))
                                    return false;
                                Map.Entry e = (Map.Entry)o;
                                Object k1 = getKey();
                                Object k2 = e.getKey();
                                if (k1 == k2 || (k1 != null && k1.equals(k2))) {
                                    Object v1 = getValue();
                                    Object v2 = e.getValue();
                                    if (v1 == v2 || (v1 != null && v1.equals(v2)))
                                        return true;
                                }
                                return false;
                            }
                       
                            public int hashCode() {
                                Object value = getValue();
                                return (key==null ? 0 : key.hashCode()) ^
                                       (value==null ? 0 : value.hashCode());
                            }
                        };
                    }
                   
                    public void remove() {
                        throw new UnsupportedOperationException();
                    }
                };
            }
           
            public int size() {
                try {
                    return getModelEx().size();
                }
                catch(TemplateModelException e) {
                    throw new UndeclaredThrowableException(e);
                }
            }
        };
    }
View Full Code Here


   
    static public Map newMaybeConcurrentHashMap() {
        try {
            return (Map) bestHashMapClass.newInstance();
        } catch(Exception e) {
            throw new UndeclaredThrowableException(e);
        }
    }
View Full Code Here

                        new Integer(initialCapacity), new Float(loadFactor) });
            } else {
                throw new BugException();
            }
        } catch(Exception e) {
            throw new UndeclaredThrowableException(e);
        }
    }
View Full Code Here

        }
        try {
            return ((Boolean)isVarArgsMethod.invoke(member, (Object[]) null)).booleanValue();
        }
        catch(Exception e) {
            throw new UndeclaredThrowableException(e);
        }
    }
View Full Code Here

                public boolean hasNext() {
                    try {
                        return i.hasNext();
                    }
                    catch(TemplateModelException e) {
                        throw new UndeclaredThrowableException(e);
                    }
                }
               
                public Object next() {
                    try {
                        return wrapper.unwrap(i.next());
                    }
                    catch(TemplateModelException e) {
                        throw new UndeclaredThrowableException(e);
                    }
                }
               
                public void remove() {
                    throw new UnsupportedOperationException();
                }
            };
        }
        catch(TemplateModelException e) {
            throw new UndeclaredThrowableException(e);
        }
    }
View Full Code Here

        }
        catch(IllegalAccessException e) {
            throw new IllegalAccessError(e.getMessage());
        }
        catch(InstantiationException e) {
            throw new UndeclaredThrowableException(e);
        }
    }
View Full Code Here

        {
            throw e;
        }
        catch(Exception e)
        {
            throw new UndeclaredThrowableException(e);
        }
    }
View Full Code Here

            try {
                INIT_CAUSE.invoke(ioe, new Object[] { e });
            } catch(RuntimeException ex) {
                throw ex;
            } catch(Exception ex) {
                throw new UndeclaredThrowableException(ex);
            }
        }
        else {
            ioe = new IOException("There was an error loading the " +
            "template on an earlier attempt: " + e.getClass().getName() +
View Full Code Here

        public CachedTemplate cloneCachedTemplate() {
            try {
                return (CachedTemplate)super.clone();
            }
            catch(CloneNotSupportedException e) {
                throw new UndeclaredThrowableException(e);
            }
        }
View Full Code Here

            if(concurrent) {
                try {
                    atomicRemove.invoke(map, new Object[] { key, ref });
                }
                catch(IllegalAccessException e) {
                    throw new UndeclaredThrowableException(e);
                }
                catch(InvocationTargetException e) {
                    throw new UndeclaredThrowableException(e);
                }
            }
            else if(map.get(key) == ref) {
                map.remove(key);
            }
View Full Code Here

TOP

Related Classes of freemarker.template.utility.UndeclaredThrowableException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.