public final class EdgeCodeValueImpl extends Object implements EdgeCodeValue, Serializable, XMLSerializable, Cloneable, CommonConstants
Implementation of a value that represents film edge code information. The properties of an edgecode are specified by the AAF edgecode class.
The internal representation of the header is as a byte array. Conversion to and from Java String values
can take place using #setHeaderFromString(String) and #getHeaderAsString().
An edgecode value can be represented in a database by the following columns:
`EdgeCodeFormat` int(11) NOT NULL,
`EdgeCodeFileFormat` int(11) NOT NULL,
`EdgeCodeStart` bigint(20) NOT NULL,
`EdgeCodeHeader` tinyblob
EdgeCodeSegmentImpl,
EdgecodeHeader,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static String |
CODEFORMAT_TAG |
static String |
FILMKIND_TAG |
static String |
HEADER_TAG |
static String |
START_TAG |
AAF_METADICT_NAMESPACE, AAF_METADICT_PREFIX, AAF_XML_NAMESPACE, AAF_XML_PREFIX, ApplicationPluginObjectID, ApplicationPluginsID, MAX_NUM_RGBA_COMPS, MemberOfID, ObjectClassID, ParentClassID, PropertiesID, XMLClassIDAsAttributeName| Constructor and Description |
|---|
EdgeCodeValueImpl()
Create a default edgecode value.
|
EdgeCodeValueImpl(long startFrame,
FilmType filmKind,
EdgeType codeFormat)
Creates and initializes a new edgecode value.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendXMLChildren(Node parent)
Append extra child elements to the given parent node to serialize the value of an object
to an XML fragment.
|
void |
appendXMLGrandchildren(Node edgecodeElement)
Appends the sub-elements of an XML representation of this value to the given XML node, without
the enclosing
EdgecodeValue tag. |
EdgeCodeValue |
clone()
Create a cloned copy of this edgecode value.
|
static String |
convertHeaderToHexCoding(byte[] edgeCodeHeader) |
static byte[] |
convertHexCodingToHeader(String hexCode) |
boolean |
equals(Object o)
Two edgecode values are equals if and only if each of their properties are equals.
|
String |
getComment()
Include a comment when serializing a value to XML.
|
FilmType |
getEdgeCodeFilmFormat()
Returns the film format of the edge code.
|
EdgeType |
getEdgeCodeFormat()
Returns the format of the edge code.
|
byte[] |
getEdgeCodeHeader()
Returns the text prefix that identifies the film.
|
String |
getEdgeCodeHeaderAsString()
Returns the text prefix the identifies the film as a string value.
|
long |
getEdgeCodeStart()
Returns the edge code at the beginning of the corresponding segment.
|
int |
hashCode() |
static EdgeCodeValue |
parseFactory(String edgeCodeAsString)
Creates an edge code value from a pseudo-XML representation, including all those
generated by
toString(). |
void |
setEdgeCodeFilmFormat(FilmType edgeCodeFilmFormat)
Sets the film format for this edge code.
|
void |
setEdgeCodeFormat(EdgeType edgeCodeFormat)
Sets the format of the edge code.
|
void |
setEdgeCodeHeader(byte[] edgeCodeHeader)
Sets the text prefix that identifies the film.
|
void |
setEdgeCodeHeader(String header)
Set the value of the edge code header from the given string.
|
void |
setEdgeCodeStart(long edgeCodeStart)
Sets the edge code at the beginning of the corresponding segment.
|
String |
toString()
Formats this edgecode value in a pseudo-XML representation that is compatible with
the AAF XML schema.
|
public static final String START_TAG
public static final String FILMKIND_TAG
public static final String CODEFORMAT_TAG
public static final String HEADER_TAG
public EdgeCodeValueImpl(@PositionType long startFrame, FilmType filmKind, EdgeType codeFormat) throws NullPointerException
Creates and initializes a new edgecode value.
startFrame - Specifies the edge code at the beginning of the corresponding segment.filmKind - Specifies the type of film.codeFormat - Specifies the edge code format.NullPointerException - One or more of the arguments is/are null.public EdgeCodeValueImpl()
Create a default edgecode value. The newly created edgecode value has the following initial value:
<EdgecodeValue>
<EdgeCodeStart>0</EdgeCodeStart>
<FilmKind>FtNull</FilmKind>
<CodeFormat>EtNull</CodeFormat>
<!-- Header property is omitted -->
</EdgecodeValue>
public EdgeType getEdgeCodeFormat()
EdgeCodeValueReturns the format of the edge code.
getEdgeCodeFormat in interface EdgeCodeValueEdgeTypepublic void setEdgeCodeFormat(EdgeType edgeCodeFormat) throws NullPointerException
EdgeCodeValueSets the format of the edge code.
setEdgeCodeFormat in interface EdgeCodeValueedgeCodeFormat - Format of the edge code.NullPointerException - The given edge code format is null.public FilmType getEdgeCodeFilmFormat()
EdgeCodeValueReturns the film format of the edge code.
getEdgeCodeFilmFormat in interface EdgeCodeValueFilmTypepublic void setEdgeCodeFilmFormat(FilmType edgeCodeFilmFormat) throws NullPointerException
EdgeCodeValueSets the film format for this edge code.
setEdgeCodeFilmFormat in interface EdgeCodeValueedgeCodeFilmFormat - Film format for this edge code.NullPointerException - The given film type for the edge code is null.@EdgecodeHeader public byte[] getEdgeCodeHeader() throws PropertyNotPresentException
EdgeCodeValueReturns the text prefix that identifies the film. Typically, this is a text string of no more than 8 7-bit ISO characters. This is an optional property.
getEdgeCodeHeader in interface EdgeCodeValuePropertyNotPresentException - The optional header property is not present for this edgecode
value.#getHeaderAsString()public void setEdgeCodeHeader(@EdgecodeHeader byte[] edgeCodeHeader)
EdgeCodeValueSets the text prefix that identifies the film. Typically, this is a text string of no
more than 8 7-bit ISO characters. Set the value to null to omit this
optional property.
To convert a String to an array of bytes, use
String.getBytes(String).
setEdgeCodeHeader in interface EdgeCodeValueedgeCodeHeader - Text prefix that identifies the film.#setHeaderFromString(String)public String getEdgeCodeHeaderAsString() throws PropertyNotPresentException
EdgeCodeValueReturns the text prefix the identifies the film as a string value. Typically, this is a text string of no more than 8 7-bit ISO characters. This is an optional property.
getEdgeCodeHeaderAsString in interface EdgeCodeValuePropertyNotPresentException - The optional header property is not present for this edgecode
value.EdgeCodeValue.getEdgeCodeHeader(),
EdgeCodeValue.setEdgeCodeHeader(String)public void setEdgeCodeHeader(String header)
EdgeCodeValueSet the value of the edge code header from the given string. Conversion to bytes takes
place using the platforms default character set, according to
String.String(byte[]).
setEdgeCodeHeader in interface EdgeCodeValueheader - String representation of the edge code header.EdgeCodeValue.setEdgeCodeHeader(byte[])public long getEdgeCodeStart()
EdgeCodeValueReturns the edge code at the beginning of the corresponding segment.
getEdgeCodeStart in interface EdgeCodeValuepublic void setEdgeCodeStart(long edgeCodeStart)
EdgeCodeValueSets the edge code at the beginning of the corresponding segment.
setEdgeCodeStart in interface EdgeCodeValueedgeCodeStart - Edge code the the beginning of the corresponding segment.public boolean equals(Object o)
Two edgecode values are equals if and only if each of their properties are equals.
equals in class ObjectObject.equals(java.lang.Object)public String toString()
Formats this edgecode value in a pseudo-XML representation that is compatible with the AAF XML schema. For example:
<EdgecodeValue>
<EdgeCodeStart>321</EdgeCodeStart>
<FilmKind>Ft35MM</FilmKind>
<CodeFormat>EtKeycode</CodeFormat>
<!--Header as text: 'abcdefgh'-->
<EdgeCodeHeader>6162636465666768</EdgeCodeHeader>
</EdgecodeValue>
toString in interface EdgeCodeValuetoString in class ObjectObject.toString()public static final EdgeCodeValue parseFactory(String edgeCodeAsString) throws NullPointerException, ParseException
Creates an edge code value from a pseudo-XML representation, including all those
generated by toString(). Edge code values are intended to match those generated
for the AAF XML schema.
An example edge code representation that would be parsed by this method is:
<EdgecodeValue>
<EdgeCodeStart>321</EdgeCodeStart>
<FilmKind>Ft35MM</FilmKind>
<CodeFormat>EtKeycode</CodeFormat>
<!--Header as text: 'abcdefgh'-->
<EdgeCodeHeader>6162636465666768</EdgeCodeHeader>
</EdgecodeValue>
Note that any unrecognised values will result in the setting of a default value rather than an error. Parse exceptions are only thrown when the validity of a value can only be determined beyond matching a simple regular expression.
edgeCodeAsString - Pseudo-XML representation of an edge code value.NullPointerException - The given string value is null.ParseException - A problem occurred when trying to decode the given string.toString()public EdgeCodeValue clone()
EdgeCodeValueCreate a cloned copy of this edgecode value.
clone in interface EdgeCodeValueclone in class Objectpublic void appendXMLChildren(Node parent)
XMLSerializableAppend extra child elements to the given parent node to serialize the value of an object
to an XML fragment. Methods of the XMLBuilder class are provided to help with this
process.
appendXMLChildren in interface XMLSerializableparent - XML parent element to append child nodes to.public void appendXMLGrandchildren(Node edgecodeElement)
Appends the sub-elements of an XML representation of this value to the given XML node, without
the enclosing EdgecodeValue tag. This allows the elements of an edgecode to be
appended to the XML representation of an edgecode
segment.
edgecodeElement - XML node to append start time, film kind, code format and header elements
to, which represent this value.public static final String convertHeaderToHexCoding(byte[] edgeCodeHeader)
public static final byte[] convertHexCodingToHeader(String hexCode) throws NumberFormatException
NumberFormatExceptionpublic String getComment()
XMLSerializableInclude a comment when serializing a value to XML. The comment will be inserted as the first child node of the element representing the class.
getComment in interface XMLSerializable(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.