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