com.ibm.rfid.epcis
Class Extension
java.lang.Object
com.ibm.rfid.epcis.Extension
public class Extension
- extends java.lang.Object
The Extension class is a bean used to create extension elements to add custom content to
the EPCIS event XML messages.
The name of the element to be created is passed in the constructor. Attributes for the
element are passed as a HashMap of String names and String values.
The value of the element can either be a String, or another nested element(s). If nested
(or child) elements are present, the String value will be ignored.
A code sample for constructing different forms of extensions is provided below:
Extension batch = new Extension("batch");
HashMap attribs = new HashMap();
attribs.put("uid", "13213");
attribs.put("cid", "32412");
attribs.put("tid", "23123");
batch.setAttributes(attribs);
batch.setValue("12");
Extension info = new Extension("info");
Extension[] children = {batch};
info.setChildren(children);
Extension lot = new Extension("lot");
lot.setValue("45");
Extension ndc = new Extension("ndc");
ndc.setValue("ndc:1245789.360");
Extension[] exts = {info, lot, ndc};
event.setExtensions(exts);
Field Summary |
static java.lang.String |
COPYRIGHT
|
Constructor Summary |
Extension(java.lang.String name)
Constructor that will assign name |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COPYRIGHT
public static final java.lang.String COPYRIGHT
- See Also:
- Constant Field Values
Extension
public Extension(java.lang.String name)
- Constructor that will assign name
- Parameters:
name
-
getAttributes
public java.util.HashMap getAttributes()
- Returns:
- Returns the attributes.
setAttributes
public void setAttributes(java.util.HashMap attributes)
- Parameters:
attributes
- The attributes to set.
getChildren
public Extension[] getChildren()
- Returns:
- Returns the children.
setChildren
public void setChildren(Extension[] children)
- Parameters:
children
- The children to set.
getName
public java.lang.String getName()
- Returns:
- Returns the name.
setName
public void setName(java.lang.String name)
- Parameters:
name
- The name to set.
getValue
public java.lang.String getValue()
- Returns:
- Returns the value.
setValue
public void setValue(java.lang.String value)
- Parameters:
value
- The value to set.
Copyright © 2005 - 2009 IBM Corp. All Rights Reserved.