001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.atom;
016    
017    import java.util.List;
018    
019    /**
020     * @author Igor Spasic
021     */
022    public class AtomCollectionAdapterRegistryUtil {
023    
024            public static AtomCollectionAdapter<?> getAtomCollectionAdapter(
025                    String collectionName) {
026    
027                    return getAtomCollectionAdapterRegistry().getAtomCollectionAdapter(
028                            collectionName);
029            }
030    
031            public static AtomCollectionAdapterRegistry
032                    getAtomCollectionAdapterRegistry() {
033    
034                    return _atomCollectionAdapterRegistry;
035            }
036    
037            public static List<AtomCollectionAdapter<?>> getAtomCollectionAdapters() {
038                    return getAtomCollectionAdapterRegistry().getAtomCollectionAdapters();
039            }
040    
041            public static void register(AtomCollectionAdapter<?> atomCollectionAdapter)
042                    throws AtomException {
043    
044                    getAtomCollectionAdapterRegistry().register(atomCollectionAdapter);
045            }
046    
047            public static void register(
048                            List<AtomCollectionAdapter<?>> atomCollectionAdapters)
049                    throws AtomException {
050    
051                    for (AtomCollectionAdapter<?> atomCollectionAdapter :
052                                    atomCollectionAdapters) {
053    
054                            register(atomCollectionAdapter);
055                    }
056            }
057    
058            public static void unregister(
059                    AtomCollectionAdapter<?> atomCollectionAdapter) {
060    
061                    getAtomCollectionAdapterRegistry().unregister(atomCollectionAdapter);
062            }
063    
064            public static void unregister(
065                    List<AtomCollectionAdapter<?>> atomCollectionAdapters) {
066    
067                    for (AtomCollectionAdapter<?> atomCollectionAdapter :
068                                    atomCollectionAdapters) {
069    
070                            unregister(atomCollectionAdapter);
071                    }
072            }
073    
074            public void setAtomCollectionAdapterRegistry(
075                    AtomCollectionAdapterRegistry atomCollectionAdapterRegistry) {
076    
077                    _atomCollectionAdapterRegistry = atomCollectionAdapterRegistry;
078            }
079    
080            private static AtomCollectionAdapterRegistry _atomCollectionAdapterRegistry;
081    
082    }