/** * This method is used to extract the annotations associated with * the type. Annotations extracted include the <code>Root</code> * annotation and the <code>Namespace</code> annotation as well as * other annotations that are used to describe the type. * * @param type this is the type to extract the annotations from */ private void extract(Class type) { for(Annotation label : labels) { if(label instanceof Namespace) { namespace(label); } if(label instanceof NamespaceList) { scope(label); } if(label instanceof Root) { root(label); } if(label instanceof Order) { order(label); } if(label instanceof Default) { access(label); } } }
/** * This is used to set the optional <code>Default</code> annotation for * the class. The default can only be set once, so if a super type also * has a default annotation define it must be ignored. * * @param label this is the label used to define the defaults */ private void access(Annotation label) { if(label != null) { Default value = (Default)label; required = value.required(); access = value.value(); } }