/** * This is used to acquire the type that this scanner scans for * annotations to be used in a schema. Exposing the class that * this represents allows the schema it creates to be known. * * @return this is the type that this creator will represent */ public Class getType() { return detail.getType(); }
/** * This returns the <code>Default</code> annotation access type * that has been specified by this. If no default annotation has * been declared on the type then this will return null. * * @return this returns the default access type for this type */ public DefaultType getAccess() { return detail.getAccess(); }
/** * This returns the annotations that have been declared for this * type. It is preferable to acquire the declared annotations * from this method as they are cached. Older versions of some * runtime environments, particularly Android, are slow at this. * * @return this returns the annotations associated with this */ public Annotation[] getAnnotations() { return detail.getAnnotations(); }
/** * This method is used to extract the <code>Root</code> annotation * and the <code>Order</code> annotation from the detail provided. * These annotation are taken from the first definition encountered * from the most specialized class up through the base classes. * * @param detail this detail object used to acquire the annotations */ private void definition(Detail detail) throws Exception { if(root == null) { root = detail.getRoot(); } if(order == null) { order = detail.getOrder(); } }
/** * This method is used to scan the class hierarchy for each class * in order to extract fields that contain XML annotations. If * the field is annotated it is converted to a contact so that * it can be used during serialization and deserialization. * * @param detail this contains the details for the class scanned */ private void scan(Detail detail) throws Exception { DefaultType override = detail.getOverride(); DefaultType access = detail.getAccess(); Class base = detail.getSuper(); if(base != null) { extend(base, override); } extract(detail, access); extract(detail); build(); }
/** * This is used to acquire the contacts for the annotated fields * within the specified class. The field contacts are added to * either the attributes or elements map depending on annotation. * * @param detail this contains the details for the class scanned */ private void field(Detail detail) throws Exception { Class type = detail.getType(); DefaultType access = detail.getOverride(); ContactList list = support.getFields(type, access); for(Contact contact : list) { Annotation label = contact.getAnnotation(); if(label != null) { builder.process(contact, label); } } }
/** * Scan the fields and methods such that the given class is scanned * first then all super classes up to the root <code>Object</code>. * All fields and methods from the most specialized classes override * fields and methods from higher up the inheritance hierarchy. This * means that annotated details can be overridden. * * @param detail contains the methods and fields to be examined */ private void scan(Detail detail) throws Exception { DefaultType access = detail.getOverride(); Class type = detail.getType(); while(type != null) { Detail value = support.getDetail(type, access); namespace(value); method(value); definition(value); type = value.getSuper(); } commit(detail); }
/** * This is used to scan the specified class for constructors that * can be used to instantiate the class. Only constructors that * have all parameters annotated will be considered. * * @param detail this is the class detail that is to be scanned */ private void scan(Detail detail) throws Exception { Constructor[] array = detail.getConstructors(); if(!detail.isInstantiable()) { throw new ConstructorException("Can not construct inner %s", detail); } for(Constructor factory: array){ if(!detail.isPrimitive()) { scan(factory); } } }
int listViewItemType = getItemViewType(position); Detail detail = data.get(listViewItemType); if (detail.getType() == Constants.NORMAL) { viewholder.txtRow.setText(detail.getKey()); } else if (detail.getType() == Constants.RECORDING) { viewholder.txt_rec.setText(detail.getRecording());
/** * This returns a list of the methods that belong to this type. * The methods here do not include any methods from the super * types and simply provides a means of caching method data. * * @return returns the list of methods declared for the type */ public List<MethodDetail> getMethods() { return detail.getMethods(); }
/** * This is used to acquire the namespace annotations that apply to * the scanned class. Namespace annotations are added only if they * have not already been extracted from a more specialized class. * When scanned all the namespace definitions are used to qualify * the XML that is produced from serializing the class. * * @param type this is the type to extract the annotations from */ private void namespace(Detail detail) throws Exception { NamespaceList scope = detail.getNamespaceList(); Namespace namespace = detail.getNamespace(); if(namespace != null) { decorator.add(namespace); } if(scope != null) { Namespace[] list = scope.value(); for(Namespace name : list) { decorator.add(name); } } }
/** * This returns the name of the class processed by this scanner. * The name is either the name as specified in the last found * <code>Root</code> annotation, or if a name was not specified * within the discovered root then the Java Bean class name of * the last class annotated with a root annotation. * * @return this returns the name of the object being scanned */ public String getName() { return detail.getName(); }
/** * This returns a list of the fields that belong to this type. * The fields here do not include any fields from the super * types and simply provides a means of caching method data. * * @return returns the list of fields declared for the type */ public List<FieldDetail> getFields() { return detail.getFields(); }
/** * This returns the <code>Namespace</code> annotation that was * declared on the type. If no annotation has been declared on the * type this will return null as not belonging to any. * * @return this returns the namespace this type belongs to, if any */ public Namespace getNamespace() { return detail.getNamespace(); }
/** * This returns the constructors that have been declared for this * type. It is preferable to acquire the declared constructors * from this method as they are cached. Older versions of some * runtime environments, particularly Android, are slow at this. * * @return this returns the constructors associated with this */ public Constructor[] getConstructors() { return detail.getConstructors(); }
/** * This returns the <code>NamespaceList</code> annotation that was * declared on the type. A list of namespaces are used to simply * declare the namespaces without specifically making the type * belong to any of the declared namespaces. * * @return this returns the namespace declarations, if any */ public NamespaceList getNamespaceList() { return detail.getNamespaceList(); }
/** * This returns the order annotation used to determine the order * of serialization of attributes and elements. The order is a * class level annotation that can be used only once per class * XML schema. If none exists then this will return null. * of the class processed by this scanner. * * @return this returns the name of the object being scanned */ public Order getOrder() { return detail.getOrder(); }
/** * This method is used to scan the class hierarchy for each class * in order to extract fields that contain XML annotations. If * the field is annotated it is converted to a contact so that * it can be used during serialization and deserialization. * * @param detail this contains the details for the class scanned */ private void scan(Detail detail) throws Exception { DefaultType override = detail.getOverride(); DefaultType access = detail.getAccess(); Class base = detail.getSuper(); if(base != null) { extend(base, override); } extract(detail, access); extract(detail); build(); }
/** * This is used to acquire the contacts for the annotated fields * within the specified class. The field contacts are added to * either the attributes or elements map depending on annotation. * * @param detail this contains the details for the class scanned */ private void method(Detail detail) throws Exception { Class type = detail.getType(); DefaultType access = detail.getOverride(); ContactList list = support.getMethods(type, access); for(Contact contact : list) { Annotation label = contact.getAnnotation(); if(label != null) { builder.process(contact, label); } } } }
/** * Scan the fields and methods such that the given class is scanned * first then all super classes up to the root <code>Object</code>. * All fields and methods from the most specialized classes override * fields and methods from higher up the inheritance hierarchy. This * means that annotated details can be overridden. * * @param detail contains the methods and fields to be examined */ private void scan(Detail detail) throws Exception { DefaultType access = detail.getOverride(); Class type = detail.getType(); while(type != null) { Detail value = support.getDetail(type, access); namespace(value); method(value); definition(value); type = value.getSuper(); } commit(detail); }