JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.io
Class LoadProperties

java.lang.Object
  |
  +--com.klg.jclass.util.io.Properties
        |
        +--com.klg.jclass.util.io.LoadProperties
All Implemented Interfaces:
Cloneable, Serializable

public class LoadProperties
extends Properties

Encapsulate the user properties that may be needed during the creation of a JClass object (such as JCChart, JCServerChart, or JCDocument) from loaded files. These properties include classes used to resolve files and a user-specified object that will be associated with the created JClass object.

See Also:
Serialized Form

Field Summary
protected  String localEntitySystemId
          System ID used for local (to JClass) external entities, such as DTDs.
protected  String relativeURLPrefix
          Prefix pre-pended to relative URLs
protected  Class resolvingClass
          Class used to resolve files relative to the classpath.
protected  boolean storeUserObject
          If true, user object will be stored on created JClass object.
protected  Object userObject
          User-specified object.
protected  ErrorHandler xmlErrorHandler
          Error handler for XML
 
Fields inherited from class com.klg.jclass.util.io.Properties
ABSOLUTE, CHARSET_ASCII, CHARSET_ISO, CHARSET_UTF_8, charsets, DEFAULT_ACCESS, DEFAULT_CHARSET_NAME, fileAccess_i18n_strings, fileAccess_strings, fileAccess_values, ignoreExternalResourceExceptions, RELATIVE_URL, RESOLVING_CLASS, SERVLET, URL
 
Constructor Summary
LoadProperties()
          Default constructor.
LoadProperties(Class resolvingClass, String relativeURLPrefix, Object userObject, boolean storeUserObject)
           
 
Method Summary
 InputStream getInputStreamByAccessType(String fileName, int accessType)
          Given a file name string and an access type, return an InputStream based on these two values.
 String getLocalEntitySystemId()
          Get System ID used for local (to jclass) external entities, such as DTDs.
 String getRelativeURLPrefix()
          Get the prefix that will be prepended to relative urls
 Class getResolvingClass()
          Get the Class object that will be used to resolve files relative to the classpath.
 boolean getStoreUserObject()
          Determine whether the object specified in the UserObject property will be stored on the created JClass object.
 URL getURLByAccessType(String fileName, int accessType)
          Given a file name string and an access type, return an InputStream based on these two values.
 Object getUserObject()
          Get the user-specified object.
 ErrorHandler getXmlErrorHandler()
          Return the current XML handler.
 void setLocalEntitySystemId(String id)
          Set System ID used for local (to jclass) external entities, such as DTDs.
 void setRelativeURLPrefix(String prefix)
          Set the prefix that will be prepended to relative urls
 void setResolvingClass(Class resolvingClass)
          Set a Class object that will be used to resolve files relative to the classpath.
 void setStoreUserObject(boolean storeUserObject)
          Note whether the object specified in the UserObject property should be stored on the created JClass object.
 void setUserObject(Object userObject)
          Set a user-specified object.
 void setXmlErrorHandler(ErrorHandler xmlErrorHandler)
          Set the current XML handler.
 
Methods inherited from class com.klg.jclass.util.io.Properties
clone, getDefaultAccess, getFileAccessEnumFromString, getFileAccessStringFromEnum, ignoreExternalResourceExceptions, setIgnoreExternalResourceExceptions
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resolvingClass

protected Class resolvingClass
Class used to resolve files relative to the classpath.


relativeURLPrefix

protected String relativeURLPrefix
Prefix pre-pended to relative URLs


userObject

protected Object userObject
User-specified object. Will be set on the created JClass object if storeUserObject is true.


storeUserObject

protected boolean storeUserObject
If true, user object will be stored on created JClass object.


localEntitySystemId

protected String localEntitySystemId
System ID used for local (to JClass) external entities, such as DTDs.


xmlErrorHandler

protected ErrorHandler xmlErrorHandler
Error handler for XML

Constructor Detail

LoadProperties

public LoadProperties()
Default constructor. Use default values for all properties.


LoadProperties

public LoadProperties(Class resolvingClass,
                      String relativeURLPrefix,
                      Object userObject,
                      boolean storeUserObject)
Method Detail

setResolvingClass

public void setResolvingClass(Class resolvingClass)
Set a Class object that will be used to resolve files relative to the classpath. Such files are resolved using the getResource() method of Class.

Parameters:
resolvingClass - Class object to be used to resolve files

getResolvingClass

public Class getResolvingClass()
Get the Class object that will be used to resolve files relative to the classpath. Such files are resolved using the getResource() method of Class.

Returns:
The Class object to be used to resolve files

setRelativeURLPrefix

public void setRelativeURLPrefix(String prefix)
Set the prefix that will be prepended to relative urls

Parameters:
prefix - The prefix that will be prepended to any relative urls

getRelativeURLPrefix

public String getRelativeURLPrefix()
Get the prefix that will be prepended to relative urls

Returns:
The prefix that will be prepended to any relative urls

setUserObject

public void setUserObject(Object userObject)
Set a user-specified object. If the StoreUserObject property is true, the object will be stored in the created JClass object's UserObject property.

Parameters:
userObject - Any user-specified object

getUserObject

public Object getUserObject()
Get the user-specified object. If the StoreUserObject property is true, the object will be stored in the created JClass object's UserObject property.

Returns:
The user-specified object

setStoreUserObject

public void setStoreUserObject(boolean storeUserObject)
Note whether the object specified in the UserObject property should be stored on the created JClass object. The default value is true.

Parameters:
storeUserObject - true if the UserObject property should be stored on the created JClass object; false otherwise.

getStoreUserObject

public boolean getStoreUserObject()
Determine whether the object specified in the UserObject property will be stored on the created JClass object. The default value is true.

Returns:
true if the UserObject property should be stored on the created JClass object; false otherwise.

getURLByAccessType

public URL getURLByAccessType(String fileName,
                              int accessType)
                       throws MalformedURLException
Given a file name string and an access type, return an InputStream based on these two values.

Parameters:
fileName - The file name string
accessType - The type of access to file name. Either an absolute filename, a url, a relative url to a url prefix, or a relatiave to a class.
Returns:
Throws:
MalformedURLException

getInputStreamByAccessType

public InputStream getInputStreamByAccessType(String fileName,
                                              int accessType)
                                       throws IOException,
                                              MalformedURLException
Given a file name string and an access type, return an InputStream based on these two values.

Parameters:
fileName - The file name string
accessType - The type of access to file name. Either an absolute filename, a url, a relative url to a url prefix, or a relatiave to a class.
Returns:
Throws:
IOException
MalformedURLException

setLocalEntitySystemId

public void setLocalEntitySystemId(String id)
Set System ID used for local (to jclass) external entities, such as DTDs. Default is empty string. Other valid values include "file:/".


getLocalEntitySystemId

public String getLocalEntitySystemId()
Get System ID used for local (to jclass) external entities, such as DTDs. Default is empty string. Other valid values include "file:/".


getXmlErrorHandler

public ErrorHandler getXmlErrorHandler()
Return the current XML handler. If null the default handler (com.klg.jclass.util.xml.JCXMLErrorPrinter) will be used.

Returns:
The current error handler.
See Also:
JCXMLErrorPrinter

setXmlErrorHandler

public void setXmlErrorHandler(ErrorHandler xmlErrorHandler)
Set the current XML handler. If null, the default handler (com.klg.jclass.util.xml.JCXMLErrorPrinter) will be used.

Parameters:
xmlErrorHandler - The new error handler.
See Also:
JCXMLErrorPrinter

Copyright © 2004 Quest Software Inc..
All rights reserved.