// Using our custom HashMap ContactMap NamePhoneType = new ContactMap();
/** * This is used to insert a contact to this contact list. Here if * a <code>Text</code> annotation is declared on a field that * already has an annotation then the other annotation is given * the priority, this is to so text can be processes separately. * * @param key this is the key that uniquely identifies the field * @param contact this is the contact that is to be inserted */ private void insert(Object key, Contact contact) { Contact existing = done.remove(key); if(existing != null) { if(isText(contact)) { contact = existing; } } done.put(key, contact); }
/** * This is used to iterate over the <code>Contact</code> objects * in a for each loop. Iterating over the contacts allows them * to be easily added to a list of unique contacts. * * @return this is used to return the contacts registered */ public Iterator<Contact> iterator(){ return values().iterator(); }
/** * This is used to remove a field from the map of processed fields. * A field is removed with the <code>Transient</code> annotation * is used to indicate that it should not be processed by the * scanner. This is required when default types are used. * * @param field this is the field to be removed from the map * @param label this is the label associated with the field */ private void remove(Field field, Annotation label) { done.remove(new FieldKey(field)); }
/** * This is used to remove a field from the map of processed fields. * A field is removed with the <code>Transient</code> annotation * is used to indicate that it should not be processed by the * scanner. This is required when default types are used. * * @param field this is the field to be removed from the map * @param label this is the label associated with the field */ private void remove(Field field, Annotation label) { done.remove(new FieldKey(field)); }
/** * This is used to insert a contact to this contact list. Here if * a <code>Text</code> annotation is declared on a field that * already has an annotation then the other annotation is given * the priority, this is to so text can be processes separately. * * @param key this is the key that uniquely identifies the field * @param contact this is the contact that is to be inserted */ private void insert(Object key, Contact contact) { Contact existing = done.remove(key); if(existing != null) { if(isText(contact)) { contact = existing; } } done.put(key, contact); }
/** * Constructor for the <code>FieldScanner</code> object. This is * used to perform a scan on the specified class in order to find * all fields that are labeled with an XML annotation. * * @param detail this contains the details for the class scanned * @param support this contains various support functions */ public FieldScanner(Detail detail, Support support) throws Exception { this.factory = new AnnotationFactory(detail, support); this.done = new ContactMap(); this.support = support; this.scan(detail); }
/** * This is used to remove a field from the map of processed fields. * A field is removed with the <code>Transient</code> annotation * is used to indicate that it should not be processed by the * scanner. This is required when default types are used. * * @param field this is the field to be removed from the map * @param label this is the label associated with the field */ private void remove(Field field, Annotation label) { done.remove(new FieldKey(field)); }
/** * This is used to iterate over the <code>Contact</code> objects * in a for each loop. Iterating over the contacts allows them * to be easily added to a list of unique contacts. * * @return this is used to return the contacts registered */ public Iterator<Contact> iterator(){ return values().iterator(); }
/** * This is used to insert a contact to this contact list. Here if * a <code>Text</code> annotation is declared on a field that * already has an annotation then the other annotation is given * the priority, this is to so text can be processes separately. * * @param key this is the key that uniquely identifies the field * @param contact this is the contact that is to be inserted */ private void insert(Object key, Contact contact) { Contact existing = done.remove(key); if(existing != null) { if(isText(contact)) { contact = existing; } } done.put(key, contact); }
/** * Constructor for the <code>FieldScanner</code> object. This is * used to perform a scan on the specified class in order to find * all fields that are labeled with an XML annotation. * * @param detail this contains the details for the class scanned * @param support this contains various support functions */ public FieldScanner(Detail detail, Support support) throws Exception { this.factory = new AnnotationFactory(detail, support); this.done = new ContactMap(); this.support = support; this.scan(detail); }
/** * This is used to iterate over the <code>Contact</code> objects * in a for each loop. Iterating over the contacts allows them * to be easily added to a list of unique contacts. * * @return this is used to return the contacts registered */ public Iterator<Contact> iterator(){ return values().iterator(); }
/** * Constructor for the <code>FieldScanner</code> object. This is * used to perform a scan on the specified class in order to find * all fields that are labeled with an XML annotation. * * @param detail this contains the details for the class scanned * @param support this contains various support functions */ public FieldScanner(Detail detail, Support support) throws Exception { this.factory = new AnnotationFactory(detail, support); this.done = new ContactMap(); this.support = support; this.scan(detail); }