public class ExtensionDescriptor extends Object implements Comparable<ExtensionDescriptor>
Title: CASA Agent Infrastructure
Copyright: Copyright (c) 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Company: Knowledge Science Group, Department of Computer Science, University of Calgary
A simple and generic description if a CASA extension (plug-in).Modifier and Type | Field and Description |
---|---|
(package private) Map<String,Object> |
attributes
The attributes of the extension.
|
(package private) Integer |
index
The index of the extension (largely irrelivant -- suffixed number used in the names of jar sections).
|
(package private) File |
sourceFile
the source file were the exension resides in,
|
(package private) String |
type
the type (code, tab, or Lisp-Script) of the extension.
|
Constructor and Description |
---|
ExtensionDescriptor(String type,
File sourceFile,
Integer index,
Attributes attrs,
String defaultMain)
Defers to
ExtensionDescriptor(String, File, Integer, Map, String) by transforming the forth parameter. |
ExtensionDescriptor(String type,
File sourceFile,
Integer index,
Map<String,Object> attrs,
String defaultMain)
Builds a new ExtensionDescriptor.
|
Modifier and Type | Method and Description |
---|---|
private static Map<String,Object> |
attributes2Map(Attributes attrs) |
int |
compareTo(ExtensionDescriptor o)
Compares on the basis of
type
sourceFilename (existing or not existing and both existing)
index
|
Object |
get(String key)
Retrieves the value for key in the attribute list or null if there is not key in
the attribute list.
|
int |
getIndex() |
File |
getSourceFile() |
String |
getType() |
private String |
makeValueString(Object val) |
(package private) void |
put(String key,
Object o)
Adds a new attribute key with value o.
|
(package private) void |
remove(String key)
Removes a key/value pair from the attribues list.
|
String |
toString() |
String type
File sourceFile
Map<String,Object> attributes
Integer index
public ExtensionDescriptor(String type, File sourceFile, Integer index, Attributes attrs, String defaultMain)
ExtensionDescriptor(String, File, Integer, Map, String)
by transforming the forth parameter.type
- The type of the extension (code, tab, Lisp_Script).sourceFile
- The file in which the extension resides.index
- The index of the extension (largely irrelivant -- suffixed number used in the names of jar sections).attrs
- The attributes of the extension.defaultMain
- The main class named in the main section of the manifest of a jar file. May be null.public ExtensionDescriptor(String type, File sourceFile, Integer index, Map<String,Object> attrs, String defaultMain)
type
- The type of the extension (code, tab, Lisp_Script).sourceFile
- The file in which the extension resides.index
- The index of the extension (largely irrelivant -- suffixed number used in the names of jar sections).attrs
- The attributes of the extension.defaultMain
- The main class named in the main section of the manifest of a jar file. May be null.private static Map<String,Object> attributes2Map(Attributes attrs)
void put(String key, Object o)
key
- The key to the newly added key/value pair.o
- The value to the newly added key/value pair.void remove(String key)
key
- The key of the key/value pair in the attributes list.public Object get(String key)
key
- The key of the key/value pair in the attributes list.public File getSourceFile()
public String getType()
public int getIndex()
public String toString()
public int compareTo(ExtensionDescriptor o)
compareTo
in interface Comparable<ExtensionDescriptor>
Comparable.compareTo(java.lang.Object)