|
intarsys runtime library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.intarsys.tools.attachment.AttachmentTools
public class AttachmentTools
A tool class for implementing a generic attachment feature.
Attachments can be made for an object or a thread context.
| Constructor Summary | |
|---|---|
AttachmentTools()
|
|
| Method Summary | |
|---|---|
static void |
addAttachment(Attachment attachment)
Add a Attachment to the thread context. |
static void |
addAttachment(Object target,
Attachment attachment)
Add a Attachment to the target object. |
static void |
addAttachment(Object target,
String key,
Object value)
Add a Attachment to the target object. |
static void |
addAttachment(String key,
Object value)
Add a Attachment to the thread context. |
static void |
addAttachments(Attachment[] pAttachments)
Add an array of Attachment instances to the thread context. |
static void |
addAttachments(List<Attachment> pAttachments)
Add a list of Attachment instances to the thread context. |
static void |
addAttachments(Object target,
Attachment[] pAttachments)
Add an array of Attachment instances to the target object. |
static void |
addAttachments(Object target,
List<Attachment> pAttachments)
Add a list of Attachment instances to the target object. |
static void |
clearAttachments()
Clear all attachments for the thread context. |
static void |
clearAttachments(Object target)
Clear all attachments for the target object. |
static Attachment |
getAttachment(Object target,
String key)
Get the first Attachment matching "key" within the target object. |
static Attachment |
getAttachment(String key)
Get the first Attachment matching "key" in the thread context. |
static Attachment[] |
getAttachments()
Get all Attachment instances for the thread context. |
static Attachment[] |
getAttachments(Object target)
Get all Attachment instances for the target object. |
static Attachment[] |
getAttachments(Object target,
String key)
Get all attachments matching "key" for the target object. |
static Attachment[] |
getAttachments(String key)
Get all attachments matching "key" in the thread context. |
static boolean |
hasAttachment(Object target,
String key)
true if the target object has an attachment for "key" |
static boolean |
hasAttachment(String key)
true if the thread context has an attachment for "key" |
static boolean |
removeAttached(Object attached)
Remove attachment with attached object in the thread context. |
static boolean |
removeAttached(Object target,
Object attached)
Remove attachment with attached object in the target object. |
static boolean |
removeAttachment(Attachment pAttachment)
Remove attachment in the thread context. |
static boolean |
removeAttachment(Object target,
Attachment pAttachment)
Remove attachment in the target object. |
static void |
removeAttachments(Object target,
String key)
Remove all attachments for key in the target object. |
static void |
removeAttachments(String key)
Remove all attachments for key in the thread context. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AttachmentTools()
| Method Detail |
|---|
public static void addAttachment(Attachment attachment)
Attachment to the thread context.
attachment - The new attachment
public static void addAttachment(Object target,
Attachment attachment)
Attachment to the target object.
target - The target objectattachment - The new attachment
public static void addAttachment(Object target,
String key,
Object value)
Attachment to the target object.
target - The target objectkey - The keyvalue - The attached object
public static void addAttachment(String key,
Object value)
Attachment to the thread context.
key - The keyvalue - The attached objectpublic static void addAttachments(Attachment[] pAttachments)
Attachment instances to the thread context.
pAttachments - public static void addAttachments(List<Attachment> pAttachments)
Attachment instances to the thread context.
pAttachments -
public static void addAttachments(Object target,
Attachment[] pAttachments)
Attachment instances to the target object.
target - The target objectpAttachments -
public static void addAttachments(Object target,
List<Attachment> pAttachments)
Attachment instances to the target object.
target - The target objectpAttachments - public static void clearAttachments()
public static void clearAttachments(Object target)
target - The target object
public static Attachment getAttachment(Object target,
String key)
Attachment matching "key" within the target object.
target - The target objectkey - The key value that is searched
Attachment or nullpublic static Attachment getAttachment(String key)
Attachment matching "key" in the thread context.
key - The key value that is searched
Attachment or nullpublic static Attachment[] getAttachments()
Attachment instances for the thread context.
public static Attachment[] getAttachments(Object target)
Attachment instances for the target object.
target - The target object
public static Attachment[] getAttachments(Object target,
String key)
target - The target objectkey - The key value that is searched
public static Attachment[] getAttachments(String key)
key - The key value that is searched
public static boolean hasAttachment(Object target,
String key)
true if the target object has an attachment for "key"
target - The target objectkey - The key value that is searched
true if object has an attachment for "key"public static boolean hasAttachment(String key)
true if the thread context has an attachment for "key"
key - The key value that is searched
true if object has an attachment for "key"public static boolean removeAttached(Object attached)
attached -
public static boolean removeAttached(Object target,
Object attached)
target - attached -
public static boolean removeAttachment(Attachment pAttachment)
pAttachment -
public static boolean removeAttachment(Object target,
Attachment pAttachment)
target - pAttachment -
public static void removeAttachments(Object target,
String key)
target - The target objectkey - The key value for the attachments to be removedpublic static void removeAttachments(String key)
key - The key value for the attachments to be removed
|
intarsys runtime library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||