org.ccnx.ccn.impl.repo.PolicyXML Class Reference

Represents repo policy data. More...

Inheritance diagram for org.ccnx.ccn.impl.repo.PolicyXML:

org.ccnx.ccn.impl.encoding.GenericXMLEncodable org.ccnx.ccn.impl.encoding.XMLEncodable org.ccnx.ccn.impl.encoding.XMLEncodable

List of all members.

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


Detailed Description

Represents repo policy data.

Member Function Documentation

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.

Parameters:
buf input stream to read from
Exceptions:
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.
Parameters:
buf input stream to read from
codec the codec to use; must be recognized by XMLCodecFactory
Exceptions:
ContentDecodingException if there is an error decoding the content
See also:
XMLCodecFactory Decode this object during an ongoing decoding pass; this is what subclasses generally need to know how to implement. Reads just the object itself, higher-level processes have handled start and end document if need be. Allows object to be read using the same code whether it is a top-level element written alone, or nested inside another element.
Parameters:
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.

Parameters:
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.

Returns:
the element label to use, as a key in a loaded encoding dictionary

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.

Returns:
true if object is valid and can be encoded, false if there is a problem; for example mandatory fields are uninitialized

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).

Parameters:
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

Parameters:
name - the test name
Returns:


The documentation for this class was generated from the following file:

Generated on Thu Feb 16 00:44:53 2012 for Content-Centric Networking in Java by  doxygen 1.5.6