|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jdom.input.SAXBuilder
verinec.util.LocalSAXBuilder
public class LocalSAXBuilder
A SAXBuilder using local copies of the Verinec schemas. The Builder is set to be validating against schemas and sets the parser to use all local .xsd files in /res/schemas/ within the classpath. Use only relative paths in xs:include statements, or you will still need network access.
Because of a bug in Java 1.4 and 1.5 see urlEncode,
this does only work if the path to the jar contains only us-ascii characters (spaces are ok).
The Class is uses a Singleton design pattern to guarantee a single instance of the Builder. The use singleton is reasonable because finding all schemas takes a long time and the build methods are reentrant.
| Field Summary | |
|---|---|
private static LocalSAXBuilder |
instance
|
private Logger |
logger
|
private boolean |
schemaLocal
|
| Constructor Summary | |
|---|---|
private |
LocalSAXBuilder()
This is a singleton, use instance() |
| Method Summary | |
|---|---|
private String |
buildSchemaLocations()
Collect the string for the schemaLocation attribute. |
static LocalSAXBuilder |
instance()
Creates an instance of LocalSAXBuilder if it does not exist or returns the existing one otherwise. |
boolean |
isNetworkNeeded()
Tells if network is needed for schemas. |
String |
urlEncode(String s)
Encode all spaces in the string with their character code. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static LocalSAXBuilder instance
private Logger logger
private boolean schemaLocal
| Constructor Detail |
|---|
private LocalSAXBuilder()
instance()
| Method Detail |
|---|
public boolean isNetworkNeeded()
public static LocalSAXBuilder instance()
private String buildSchemaLocations()
throws VerinecException
see urlEncode,
this does only work if the path to the jar contains no non-us-ascii characters.
VerinecException - If we have a problem with the classpath.public String urlEncode(String s)
s - An URL
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||