Public Member Functions | |
void | decode (XMLDecoder decoder) throws ContentDecodingException |
Decode this object as the top-level item in a new XML document, reading it from a network buffer. | |
void | encode (XMLEncoder encoder) throws ContentEncodingException |
Encode this object during an ongoing encoding pass; this is what subclasses generally need to know how to implement. | |
int | hashCode () |
boolean | equals (Object obj) |
long | getElementLabel () |
Allow the encoder/decoder to retrieve the top-level element name programmatically. | |
boolean | validate () |
Make sure all of the necessary fields are filled in prior to attempting to encode. | |
synchronized ArrayList < ContentName > | getNamespace () |
synchronized void | setNamespace (ArrayList< ContentName > namespace) |
synchronized void | addNamespace (ContentName name) |
synchronized void | removeNamespace (ContentName name) |
synchronized void | setLocalName (String localName) |
synchronized String | getLocalName () |
synchronized void | setGlobalPrefix (String globalPrefix) throws MalformedContentNameStringException |
synchronized void | setGlobalPrefixOnly (ContentName globalPrefix) |
This is a special case for transferring one policyXML to another (so we already have the namespace setup correctly). | |
synchronized ContentName | getGlobalPrefix () |
synchronized void | setVersion (String version) |
synchronized String | getVersion () |
Static Public Member Functions | |
static String | fixSlash (String name) |
Global prefix names are not required to start with a slash. | |
Protected Attributes | |
String | _version = null |
ContentName | _globalPrefix = null |
String | _localName = null |
ArrayList< ContentName > | _namespace = new ArrayList<ContentName>() |
Classes | |
interface | ElementPutter |
The following interface and enumeration allow user created policy files with the data in any order. | |
class | GlobalPrefixPutter |
class | LocalNamePutter |
class | NameSpacePutter |
class | PolicyObject |
class | VersionPutter |
void org.ccnx.ccn.impl.repo.PolicyXML.decode | ( | XMLDecoder | decoder | ) | throws ContentDecodingException [virtual] |
Decode this object as the top-level item in a new XML document, reading it from a network buffer.
Reads document start and end. Assumes default encoding.
buf | input stream to read from |
ContentDecodingException | if there is an error decoding the content Decode this object as the top-level item in a new XML document, reading it from a network buffer. Reads document start and end. |
buf | input stream to read from | |
codec | the codec to use; must be recognized by XMLCodecFactory |
ContentDecodingException | if there is an error decoding the content |
decoder | the decoder being used; encapsulates state including the codec being used as well as the input source and current offset |
Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.
void org.ccnx.ccn.impl.repo.PolicyXML.encode | ( | XMLEncoder | encoder | ) | throws ContentEncodingException [virtual] |
Encode this object during an ongoing encoding pass; this is what subclasses generally need to know how to implement.
Writes just the object itself, higher-level processes have handled start and end document if need be. Allows object to be written using the same code whether it is a top-level element written alone, or nested inside another element.
encoder | the encoder being used; encapsulates state including the codec being used as well as the output destination and current offset |
Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.
long org.ccnx.ccn.impl.repo.PolicyXML.getElementLabel | ( | ) | [virtual] |
Allow the encoder/decoder to retrieve the top-level element name programmatically.
This allows subclasses to rename elements without changing their encoder/decoders.
Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.
boolean org.ccnx.ccn.impl.repo.PolicyXML.validate | ( | ) | [virtual] |
Make sure all of the necessary fields are filled in prior to attempting to encode.
All implementations of encode(XMLEncoder) should call this for their classes prior to encoding.
Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.
synchronized void org.ccnx.ccn.impl.repo.PolicyXML.setGlobalPrefixOnly | ( | ContentName | globalPrefix | ) |
This is a special case for transferring one policyXML to another (so we already have the namespace setup correctly).
globalPrefix |
static String org.ccnx.ccn.impl.repo.PolicyXML.fixSlash | ( | String | name | ) | [static] |
Global prefix names are not required to start with a slash.
Just add one here if it doesn't
name | - the test name |