|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.orchestranetworks.schema.SchemaLocation
Identifies a schema location, which can be either based on a URL (standard notation) or based on a EBX.Platform module.
When a location is based on a module, this implies that the schema is packaged in an EBX.Platform module (which is commonly a Web Application). This approach has several benefits:
| Method Summary | |
static SchemaLocation |
forLocation(String aBaseOrNull,
String aURI)
Returns a reference to a schema that is not packaged inside an EBX.Platform module. |
static SchemaLocation |
forPathInModule(String aPathInModule,
String aModuleName)
Returns a reference to a schema that is packaged inside an EBX.Platform module. |
abstract File |
getFileOrNull()
If this location is able to be resolved to a file, returns this file, otherwise returns null.
|
abstract InputStream |
getInputStream()
Returns a stream for reading the content of the corresponding schema. |
abstract String |
getModuleName()
Returns the name of the module that contains the resource or, if this instance is URI based, returns the default module name. |
abstract boolean |
isPackagedInModule()
Returns true if this instance is a module-based location. |
abstract boolean |
isReserved()
Returns true for schemas that are specifically managed by
EBX.Platform. |
abstract boolean |
isURI()
Returns true if this instance is a URL-based location. |
abstract SchemaLocation |
resolve(String aURI)
Given the current instance that serves as the base name, this method returns the most accurate locator that constitutes the real target. |
abstract String |
toStringInfo(Locale aLocale)
Returns a information string that identifies the location. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static final SchemaLocation forLocation(String aBaseOrNull,
String aURI)
throws IllegalArgumentException
Warning : beyond simple test cases, it is generally recommended to use schemas
that are packaged inside EBX.Platform modules (see forPathInModule(String, String)).
The actual location of the schema will be :
aURI is absolute, it will be aURI.aURI is relative, it takes aBaseOrNull as the base URI for
resolving the location. If aBaseOrNull is null, then the base URI
used is current user directory, as defined by File.
aBaseOrNull - used only if aURI is relativeaURI - an absolute or relative URI
IllegalArgumentException - if an argument is not a well-formed URI
public static final SchemaLocation forPathInModule(String aPathInModule,
String aModuleName)
Example:
SchemaLocator sname = SchemaLocator.forPathInModule(
"/WEB-INF/schemas/main.xsd",
"sample");
where "sample" is the module name.
aPathInModule - path of the schema inside the module (see example above)aModuleName - identifies the module that contains the schema (the
name of a module is defined in the document /WEB-INF/ebx/module.xml,
at element /module/name).public abstract File getFileOrNull()
null.
Generally, a location is able to resolve to a file if this location is URL-based
with protocol file://, or if this location is module-based and
the application server is able to translate the module location to an actual file.
ServletContext.getRealPath(java.lang.String)
public abstract InputStream getInputStream()
throws Exception
Exceptionpublic abstract String getModuleName()
/WEB-INF/ebx/module.xml,
at element /module/name.
public abstract boolean isReserved()
true for schemas that are specifically managed by
EBX.Platform.
public abstract boolean isPackagedInModule()
true if this instance is a module-based location.
public abstract boolean isURI()
true if this instance is a URL-based location.
public abstract SchemaLocation resolve(String aURI)
throws IllegalArgumentException
IllegalArgumentException - If the given string violates RFC 2396public abstract String toStringInfo(Locale aLocale)
aLocale - if null, use the default locale (english).
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
(report a bug)
EBX.Platform 4.5.2 [0601:0004]
Copyright Orchestra Networks 2000-2008. All rights reserved.