001    /*
002     * JBoss DNA (http://www.jboss.org/dna)
003     * See the COPYRIGHT.txt file distributed with this work for information
004     * regarding copyright ownership.  Some portions may be licensed
005     * to Red Hat, Inc. under one or more contributor license agreements.
006     * See the AUTHORS.txt file in the distribution for a full listing of 
007     * individual contributors. 
008     *
009     * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
010     * is licensed to you under the terms of the GNU Lesser General Public License as
011     * published by the Free Software Foundation; either version 2.1 of
012     * the License, or (at your option) any later version.
013     *
014     * JBoss DNA is distributed in the hope that it will be useful,
015     * but WITHOUT ANY WARRANTY; without even the implied warranty of
016     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017     * Lesser General Public License for more details.
018     *
019     * You should have received a copy of the GNU Lesser General Public
020     * License along with this software; if not, write to the Free
021     * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
022     * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
023     */
024    package org.jboss.dna.sequencer.java.metadata;
025    
026    import java.util.ArrayList;
027    import java.util.List;
028    
029    /**
030     * Exposes meta data of a top level type.
031     * 
032     * @author Serge Pagop
033     */
034    public class TypeMetadata {
035    
036        public static final int PUBLIC_MODIFIER = 0;
037    
038        /** The name. */
039        private String name;
040    
041        /** All modifiers of a top level type */
042        private List<ModifierMetadata> modifiers = new ArrayList<ModifierMetadata>();
043    
044        /** All annotations of a top level type */
045        private List<AnnotationMetadata> annotations = new ArrayList<AnnotationMetadata>();
046    
047        /** All fields of a top level type */
048        private List<FieldMetadata> fields = new ArrayList<FieldMetadata>();
049    
050        /** All methods of a top level type */
051        private List<MethodMetadata> methods = new ArrayList<MethodMetadata>();
052    
053        /**
054         * Get the name.
055         * 
056         * @return the name.
057         */
058        public String getName() {
059            return name;
060        }
061    
062        /**
063         * Set the name.
064         * 
065         * @param name Sets name to the specified value.
066         */
067        public void setName( String name ) {
068            this.name = name;
069        }
070    
071        /**
072         * @return annotations
073         */
074        public List<AnnotationMetadata> getAnnotations() {
075            return annotations;
076        }
077    
078        /**
079         * @param annotations Sets annotations to the specified value.
080         */
081        public void setAnnotations( List<AnnotationMetadata> annotations ) {
082            this.annotations = annotations;
083        }
084    
085        /**
086         * @return modifiers
087         */
088        public List<ModifierMetadata> getModifiers() {
089            return modifiers;
090        }
091    
092        /**
093         * @param modifiers Sets modifiers to the specified value.
094         */
095        public void setModifiers( List<ModifierMetadata> modifiers ) {
096            this.modifiers = modifiers;
097        }
098    
099        /**
100         * Gets a ordered lists of {@link FieldMetadata} from the unit.
101         * 
102         * @return all fields of this unit if there is one.
103         */
104        public List<FieldMetadata> getFields() {
105            return this.fields;
106        }
107    
108        /**
109         * @param fields Sets fields to the specified value.
110         */
111        public void setFields( List<FieldMetadata> fields ) {
112            this.fields = fields;
113        }
114    
115        /**
116         * Gets all {@link MethodMetadata} from the unit.
117         * 
118         * @return all methods from the units.
119         */
120        public List<MethodMetadata> getMethods() {
121            return methods;
122        }
123    
124        /**
125         * @param methods Sets methods to the specified value.
126         */
127        public void setMethods( List<MethodMetadata> methods ) {
128            this.methods = methods;
129        }
130    
131    }