FileDocCategorySizeDatePackage
MLetContent.javaAPI DocJava SE 6 API6018Tue Jun 10 00:26:14 BST 2008javax.management.loading

MLetContent

public class MLetContent extends Object
This class represents the contents of the MLET tag. It can be consulted by a subclass of {@link MLet} that overrides the {@link MLet#check MLet.check} method.
since
1.6

Fields Summary
private Map
attributes
A map of the attributes of the MLET tag and their values.
private List
types
An ordered list of the TYPE attributes that appeared in nested <PARAM> tags.
private List
values
An ordered list of the VALUE attributes that appeared in nested <PARAM> tags.
private URL
documentURL
The MLet text file's base URL.
private URL
baseURL
The base URL.
Constructors Summary
public MLetContent(URL url, Map attributes, List types, List values)
Creates an MLet instance initialized with attributes read from an MLET tag in an MLet text file.

param
url The URL of the MLet text file containing the MLET tag.
param
attributes A map of the attributes of the MLET tag. The keys in this map are the attribute names in lowercase, for example codebase. The values are the associated attribute values.
param
types A list of the TYPE attributes that appeared in nested <PARAM> tags.
param
values A list of the VALUE attributes that appeared in nested <PARAM> tags.

	this.documentURL = url;
	this.attributes = Collections.unmodifiableMap(attributes);
	this.types = Collections.unmodifiableList(types);
	this.values = Collections.unmodifiableList(values);

	// Initialize baseURL
	//
	String att = getParameter("codebase");
	if (att != null) {
	    if (!att.endsWith("/")) {
		att += "/";
	    }
	    try {
		baseURL = new URL(documentURL, att);
	    } catch (MalformedURLException e) {
		// OK : Move to next block as baseURL could not be initialized.
	    }
	}
	if (baseURL == null) {
	    String file = documentURL.getFile();
	    int i = file.lastIndexOf('/");
	    if (i > 0 && i < file.length() - 1) {
		try {
		    baseURL = new URL(documentURL, file.substring(0, i + 1));
		} catch (MalformedURLException e) {
		    // OK : Move to next block as baseURL could not be initialized.
		}
	    }
	}
	if (baseURL == null)
	    baseURL = documentURL;

    
Methods Summary
public java.util.MapgetAttributes()
Gets the attributes of the MLET tag. The keys in the returned map are the attribute names in lowercase, for example codebase. The values are the associated attribute values.

return
A map of the attributes of the MLET tag and their values.

	return attributes;
    
public java.lang.StringgetCode()
Gets the value of the CODE attribute of the MLET tag.

return
The value of the CODE attribute of the MLET tag.

	return getParameter("code");
    
public java.net.URLgetCodeBase()
Gets the code base URL.

return
The code base URL.

	return baseURL;
    
public java.net.URLgetDocumentBase()
Gets the MLet text file's base URL.

return
The MLet text file's base URL.

	return documentURL;
    
public java.lang.StringgetJarFiles()
Gets the list of .jar files specified by the ARCHIVE attribute of the MLET tag.

return
A comma-separated list of .jar file names.

	return getParameter("archive");
    
public java.lang.StringgetName()
Gets the value of the NAME attribute of the MLET tag.

return
The value of the NAME attribute of the MLET tag.

	return getParameter("name");
    
private java.lang.StringgetParameter(java.lang.String name)
Gets the value of the specified attribute of the MLET tag.

param
name A string representing the name of the attribute.
return
The value of the specified attribute of the MLET tag.

	return attributes.get(name.toLowerCase());
    
public java.util.ListgetParameterTypes()
Gets the list of values of the TYPE attribute in each nested <PARAM> tag within the MLET tag.

return
the list of types.

	return types;
    
public java.util.ListgetParameterValues()
Gets the list of values of the VALUE attribute in each nested <PARAM> tag within the MLET tag.

return
the list of values.

	return values;
    
public java.lang.StringgetSerializedObject()
Gets the value of the OBJECT attribute of the MLET tag.

return
The value of the OBJECT attribute of the MLET tag.

	return getParameter("object");
    
public java.lang.StringgetVersion()
Gets the value of the VERSION attribute of the MLET tag.

return
The value of the VERSION attribute of the MLET tag.

	return getParameter("version");