public class EmbedDescriptor
extends java.lang.Object
implements java.io.Externalizable
Modifier and Type | Field and Description |
---|---|
java.lang.String |
cid
Content ID.
|
java.lang.String |
name
Resource name (required for URL usage).
|
private static int |
nextSerial
Index number used to separate each content ID.
|
private static java.lang.String |
prefix
Unique random text to use as a prefix.
|
java.lang.String |
resource
The resource to embed.
|
ResourceType |
type
Type of embedded image.
|
Constructor and Description |
---|
EmbedDescriptor()
Default constructor, only used for serialization.
|
EmbedDescriptor(ResourceType type,
java.lang.String resource,
java.lang.String name)
Construct an instance with the given state.
|
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
generateContentId()
Generate a unique string that can be used as a content ID.
|
void |
readExternal(java.io.ObjectInput in)
Replacement for the default object reading method.
|
void |
writeExternal(java.io.ObjectOutput out)
Replacement for the default object writing method.
|
private static java.lang.String prefix
private static int nextSerial
public ResourceType type
public java.lang.String resource
public java.lang.String name
public java.lang.String cid
public EmbedDescriptor()
public EmbedDescriptor(ResourceType type, java.lang.String resource, java.lang.String name)
type
- The type of the image being embedded.resource
- The path or URL of the image to be embedded.name
- Name of the URL resource (required for URL case, may be null
for the path case).public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- The input source from which fields will be restored.java.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If payload can't be instantiated.public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- The output destination to which fields will be saved.java.io.IOException
- In case of I/O errors.private static java.lang.String generateContentId()