sboag 00/11/22 20:59:27
Modified: java/src/org/apache/xalan/extensions ExtensionHandler.java
ExtensionHandlerGeneral.java
ExtensionHandlerJavaClass.java
ExtensionHandlerJavaPackage.java
XSLProcessorContext.java
java/src/org/apache/xalan/lib/sql Row.java
StreamableNode.java
java/src/org/apache/xalan/processor
CompiledStylesheetBundle.java CompiledTemplate.java
CompilingStylesheetHandler.java
ProcessorCharacters.java ProcessorImport.java
ProcessorInclude.java ProcessorLRE.java
StylesheetHandler.java StylesheetPIHandler.java
TransformerFactoryImpl.java XSLTAttributeDef.java
java/src/org/apache/xalan/res XSLMessages.java
XSLTErrorResources.java
java/src/org/apache/xalan/serialize FormatterToHTML.java
FormatterToXML.java
java/src/org/apache/xalan/stree CDATASectionImpl.java
Child.java CommentImpl.java
DOMImplementationImpl.java DocumentImpl.java
ElementImpl.java EntityImpl.java LevelIndexer.java
Parent.java SourceTreeHandler.java
StreeDOMBuilder.java TextImpl.java
java/src/org/apache/xalan/templates AVT.java AVTPart.java
AVTPartSimple.java AVTPartXPath.java Constants.java
DecimalFormatProperties.java ElemApplyImport.java
ElemApplyTemplates.java ElemAttribute.java
ElemAttributeSet.java ElemCallTemplate.java
ElemChoose.java ElemComment.java ElemCopy.java
ElemCopyOf.java ElemElement.java
ElemExtensionCall.java ElemExtensionDecl.java
ElemFallback.java ElemForEach.java ElemIf.java
ElemLiteralResult.java ElemMessage.java
ElemNumber.java ElemPI.java ElemParam.java
ElemTemplate.java ElemTemplateElement.java
ElemTextLiteral.java ElemUnknown.java ElemUse.java
ElemValueOf.java ElemVariable.java
ElemWithParam.java FuncDocument.java
FuncFormatNumb.java FuncKey.java
KeyDeclaration.java OutputFormatExtended.java
Stylesheet.java StylesheetComposed.java
StylesheetRoot.java TemplateList.java
TemplateSubPatternAssociation.java
WhitespaceList.java
java/src/org/apache/xalan/trace GenerateEvent.java
TraceManager.java TracerEvent.java
java/src/org/apache/xalan/transformer Counter.java
KeyIterator.java KeyManager.java KeyTable.java
KeyWalker.java NodeSortKey.java NodeSorter.java
QueuedEvents.java QueuedStartElement.java
ResultTreeFrag.java ResultTreeHandler.java
TransformerImpl.java TreeWalker2Result.java
java/src/org/apache/xalan/xslt Process.java
java/src/org/apache/xpath Arg.java DOM2Helper.java
DOMHelper.java Expression.java NodeSet.java
SourceTreeManager.java VariableStack.java
XPath.java XPathAPI.java XPathContext.java
XPathFactory.java
java/src/org/apache/xpath/axes AxesWalker.java
ChildTestIterator.java FilterExprWalker.java
LocPathIterator.java UnionPathIterator.java
java/src/org/apache/xpath/compiler Compiler.java
Keywords.java Lexer.java OpMap.java
XPathParser.java
java/src/org/apache/xpath/functions
FuncExtElementAvailable.java
FuncExtFunctionAvailable.java FuncId.java
FuncNormalizeSpace.java FuncQname.java
FuncSystemProperty.java
java/src/org/apache/xpath/objects XNodeSet.java
java/src/org/apache/xpath/operations Variable.java
java/src/org/apache/xpath/patterns AncestorStepPattern.java
StepPattern.java
java/src/org/apache/xpath/res XPATHErrorResources.java
Added: java/src/org/apache/xml/utils AttList.java BoolStack.java
DOMBuilder.java DefaultErrorHandler.java
ElemDesc.java FastStringBuffer.java Heap.java
HeapObject.java IntStack.java IntVector.java
MutableAttrListImpl.java NSInfo.java NameSpace.java
NodeConsumer.java NodeVector.java ObjectPool.java
PrefixResolver.java PrefixResolverDefault.java
QName.java RawCharacterHandler.java
SAXSourceLocator.java SerializableLocatorImpl.java
StringBufferPool.java StringKey.java
StringToIntTable.java StringToStringTable.java
StringToStringTableVector.java StringVector.java
SystemIDResolver.java TreeWalker.java Trie.java
URI.java UnImplNode.java
WrappedRuntimeException.java
WrongParserException.java
XMLCharacterRecognizer.java package.html
java/src/org/apache/xml/utils/res XResourceBundle.java
XResourceBundleBase.java XResources_cy.java
XResources_el.java XResources_en.java
XResources_he.java XResources_hy.java
XResources_ja_JP_A.java XResources_ja_JP_HA.java
XResources_ja_JP_HI.java XResources_ja_JP_I.java
XResources_ka.java XResources_zh_CN.java
XResources_zh_TW.java
java/src/org/apache/xml/utils/synthetic Class.java
JavaUtils.java SynthesisException.java
TestDriver.java
java/src/org/apache/xml/utils/synthetic/reflection
Constructor.java EntryPoint.java Field.java
Member.java Method.java
Removed: java/src/org/apache/xalan/res XSLResourceBundle.java
XSLTResourceBundle.java XSLTResources_cy.java
XSLTResources_el.java XSLTResources_en.java
XSLTResources_he.java XSLTResources_hy.java
XSLTResources_ja_JP_A.java
XSLTResources_ja_JP_HA.java
XSLTResources_ja_JP_HI.java
XSLTResources_ja_JP_I.java XSLTResources_ka.java
XSLTResources_zh_CN.java XSLTResources_zh_TW.java
java/src/org/apache/xalan/utils AttList.java BoolStack.java
DOMBuilder.java DefaultErrorHandler.java
ElemDesc.java FastStringBuffer.java Heap.java
HeapObject.java IntStack.java IntVector.java
MutableAttrListImpl.java NSInfo.java NameSpace.java
NodeConsumer.java NodeVector.java ObjectPool.java
PrefixResolver.java PrefixResolverDefault.java
QName.java RawCharacterHandler.java
SAXSourceLocator.java SerializableLocatorImpl.java
StringBufferPool.java StringKey.java
StringToIntTable.java StringToStringTable.java
StringToStringTableVector.java StringVector.java
SystemIDResolver.java TreeWalker.java Trie.java
URI.java UnImplNode.java
WrappedRuntimeException.java
WrongParserException.java
XMLCharacterRecognizer.java package.html
java/src/org/apache/xalan/utils/synthetic Class.java
JavaUtils.java SynthesisException.java
TestDriver.java
java/src/org/apache/xalan/utils/synthetic/reflection
Constructor.java EntryPoint.java Field.java
Member.java Method.java
Log:
Moved the org.apache.xalan.utils package to org.apache.xml.utils,
in response to a design concern that, since XPath uses the utils
stuff, this package should not be in the Xalan package. Also moved
a bunch of the org.apache.xalan.res classes to org.apache.xml.utils.res,
so that the base internationalization stuff can be in a neutral place.
The utils stuff still has a few dependencies on the xalan package,
but we'll be fixing this over the next couple of weeks.
Revision Changes Path
1.7 +1 -1
xml-xalan/java/src/org/apache/xalan/extensions/ExtensionHandler.java
Index: ExtensionHandler.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/extensions/ExtensionHandler.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ExtensionHandler.java 2000/11/13 16:26:36 1.6
+++ ExtensionHandler.java 2000/11/23 04:57:17 1.7
@@ -66,7 +66,7 @@
import org.w3c.dom.Node;
import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
// Temp??
import org.apache.xalan.transformer.TransformerImpl;
1.8 +2 -2
xml-xalan/java/src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
Index: ExtensionHandlerGeneral.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ExtensionHandlerGeneral.java 2000/11/13 16:26:36 1.7
+++ ExtensionHandlerGeneral.java 2000/11/23 04:57:17 1.8
@@ -66,7 +66,7 @@
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import javax.xml.transform.TransformerException;
@@ -74,7 +74,7 @@
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xpath.objects.XObject;
import org.apache.xpath.XPathProcessorException;
-import org.apache.xalan.utils.StringVector;
+import org.apache.xml.utils.StringVector;
import java.lang.reflect.Method;
1.7 +1 -1
xml-xalan/java/src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
Index: ExtensionHandlerJavaClass.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ExtensionHandlerJavaClass.java 2000/11/13 16:26:36 1.6
+++ ExtensionHandlerJavaClass.java 2000/11/23 04:57:17 1.7
@@ -68,7 +68,7 @@
import org.w3c.dom.Node;
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xpath.objects.XObject;
import javax.xml.transform.TransformerException;
1.7 +1 -1
xml-xalan/java/src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
Index: ExtensionHandlerJavaPackage.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ExtensionHandlerJavaPackage.java 2000/11/13 16:26:36 1.6
+++ ExtensionHandlerJavaPackage.java 2000/11/23 04:57:18 1.7
@@ -68,7 +68,7 @@
import org.w3c.dom.Node;
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xpath.objects.XObject;
import javax.xml.transform.TransformerException;
1.7 +1 -1
xml-xalan/java/src/org/apache/xalan/extensions/XSLProcessorContext.java
Index: XSLProcessorContext.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/extensions/XSLProcessorContext.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XSLProcessorContext.java 2000/11/13 16:26:36 1.6
+++ XSLProcessorContext.java 2000/11/23 04:57:18 1.7
@@ -63,7 +63,7 @@
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xalan.transformer.ResultTreeHandler;
import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import javax.xml.transform.TransformerException;
1.5 +1 -1 xml-xalan/java/src/org/apache/xalan/lib/sql/Row.java
Index: Row.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/lib/sql/Row.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Row.java 2000/10/30 18:56:32 1.4
+++ Row.java 2000/11/23 04:57:21 1.5
@@ -60,7 +60,7 @@
import org.w3c.dom.Document;
import org.w3c.dom.DOMException;
-import org.apache.xalan.utils.UnImplNode;
+import org.apache.xml.utils.UnImplNode;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
1.7 +1 -1
xml-xalan/java/src/org/apache/xalan/lib/sql/StreamableNode.java
Index: StreamableNode.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/lib/sql/StreamableNode.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- StreamableNode.java 2000/10/30 18:56:33 1.6
+++ StreamableNode.java 2000/11/23 04:57:21 1.7
@@ -61,7 +61,7 @@
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.DOMException;
-import org.apache.xalan.utils.UnImplNode;
+import org.apache.xml.utils.UnImplNode;
import org.apache.xpath.patterns.NodeTestFilter;
import org.apache.xpath.patterns.NodeTest;
import org.apache.xalan.res.XSLTErrorResources;
1.11 +1 -1
xml-xalan/java/src/org/apache/xalan/processor/CompiledStylesheetBundle.java
Index: CompiledStylesheetBundle.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/CompiledStylesheetBundle.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- CompiledStylesheetBundle.java 2000/11/13 16:26:42 1.10
+++ CompiledStylesheetBundle.java 2000/11/23 04:57:22 1.11
@@ -80,7 +80,7 @@
import org.apache.xpath.functions.Function;
import org.apache.xalan.res.XSLMessages;
import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.PrefixResolver;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.DTDHandler;
1.9 +2 -2
xml-xalan/java/src/org/apache/xalan/processor/CompiledTemplate.java
Index: CompiledTemplate.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/CompiledTemplate.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- CompiledTemplate.java 2000/11/22 23:25:49 1.8
+++ CompiledTemplate.java 2000/11/23 04:57:22 1.9
@@ -64,7 +64,7 @@
import org.apache.xalan.templates.ElemTemplate;
import javax.xml.transform.SourceLocator;
-import org.apache.xalan.utils.SAXSourceLocator;
+import org.apache.xml.utils.SAXSourceLocator;
public abstract class CompiledTemplate
extends ElemTemplate
@@ -173,7 +173,7 @@
public abstract void execute(
org.apache.xalan.transformer.TransformerImpl
transformer,
org.w3c.dom.Node sourceNode,
- org.apache.xalan.utils.QName mode)
+ org.apache.xml.utils.QName mode)
throws javax.xml.transform.TransformerException;
/** During deserialization, reinstantiate the transient thread-table
1.18 +20 -20
xml-xalan/java/src/org/apache/xalan/processor/CompilingStylesheetHandler.java
Index: CompilingStylesheetHandler.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/CompilingStylesheetHandler.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- CompilingStylesheetHandler.java 2000/11/22 23:25:49 1.17
+++ CompilingStylesheetHandler.java 2000/11/23 04:57:23 1.18
@@ -80,7 +80,7 @@
import org.apache.xpath.functions.Function;
import org.apache.xalan.res.XSLMessages;
import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.PrefixResolver;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.DTDHandler;
@@ -92,7 +92,7 @@
import javax.xml.transform.TransformerException;
// Java Compiler support.
-import org.apache.xalan.utils.synthetic.JavaUtils;
+import org.apache.xml.utils.synthetic.JavaUtils;
/**
* <meta name="usage" content="advanced"/>
@@ -227,7 +227,7 @@
Other nodes simply have their .evaluate() invoked
TODO: Their children really should be walked for further compilation
opportunities.
- TODO: ***** OPTIMIZATION: We should preload/cache the
org.apache.xalan.utils.synthetic.Class
+ TODO: ***** OPTIMIZATION: We should preload/cache the
org.apache.xml.utils.synthetic.Class
objects rather than doing forName/forClass lookups every time.
*/
ElemTemplate compileTemplate(ElemTemplate source)
@@ -240,15 +240,15 @@
{
// public class ACompiledTemplate000...
// extends CompiledTemplate (partly abstract superclass)
- org.apache.xalan.utils.synthetic.Class tClass=
- org.apache.xalan.utils.synthetic.Class.declareClass(className);
+ org.apache.xml.utils.synthetic.Class tClass=
+ org.apache.xml.utils.synthetic.Class.declareClass(className);
tClass.setModifiers(java.lang.reflect.Modifier.PUBLIC);
tClass.setSuperClass(tClass.forName("org.apache.xalan.processor.CompiledTemplate"));
// public constructor: Copy values from original
// template object, pick up "uncompiled children"
// array from compilation/instantiation process.
- org.apache.xalan.utils.synthetic.reflection.Constructor ctor=
+ org.apache.xml.utils.synthetic.reflection.Constructor ctor=
tClass.declareConstructor();
ctor.setModifiers(java.lang.reflect.Modifier.PUBLIC);
ctor.addParameter(tClass.forClass(ElemTemplate.class),"original");
@@ -270,7 +270,7 @@
// public void execute(TransformerImpl transformer,
// Node sourceNode, QName mode)
- org.apache.xalan.utils.synthetic.reflection.Method exec=
+ org.apache.xml.utils.synthetic.reflection.Method exec=
tClass.declareMethod("execute");
exec.setModifiers(java.lang.reflect.Modifier.PUBLIC);
exec.addParameter(
@@ -279,7 +279,7 @@
exec.addParameter(
tClass.forClass(org.w3c.dom.Node.class),"sourceNode");
exec.addParameter(
- tClass.forClass(org.apache.xalan.utils.QName.class),"mode");
+ tClass.forClass(org.apache.xml.utils.QName.class),"mode");
exec.addExceptionType(
tClass.forClass(javax.xml.transform.TransformerException.class));
@@ -348,12 +348,12 @@
interpretVector.copyInto(eteParms);
// Instantiate -- note that this will be a singleton,
// as each template is probably unique
- org.apache.xalan.utils.synthetic.reflection.Constructor c=
+ org.apache.xml.utils.synthetic.reflection.Constructor c=
tClass.getConstructor(ctor.getParameterTypes());
Object[] parms={source,eteParms};
instance=(ElemTemplate)c.newInstance(parms);
}
- catch(org.apache.xalan.utils.synthetic.SynthesisException e)
+ catch(org.apache.xml.utils.synthetic.SynthesisException e)
{
System.out.println("CompilingStylesheetHandler class synthesis
error");
e.printStackTrace();
@@ -542,14 +542,14 @@
// expand ElemUse.applyAttrSets(transformer, getStylesheetComposed(),
// ele.getUseAttributeSets(), sourceNode, mode);
// ***** DOES THIS CAST NEED TO BE CHECKED?
- org.apache.xalan.utils.QName[]
attributeSetsNames=((org.apache.xalan.templates.ElemUse)ete).getUseAttributeSets();
+ org.apache.xml.utils.QName[]
attributeSetsNames=((org.apache.xalan.templates.ElemUse)ete).getUseAttributeSets();
if(null != attributeSetsNames)
{
org.apache.xalan.templates.StylesheetComposed
stylesheet=ete.getStylesheetComposed();
int nNames = attributeSetsNames.length;
for(int i = 0; i < nNames; i++)
{
- org.apache.xalan.utils.QName qname = attributeSetsNames[i];
+ org.apache.xml.utils.QName qname = attributeSetsNames[i];
Vector attrSets = stylesheet.getAttributeSetComposed(qname);
int nSets = attrSets.size();
for(int k = 0; k < nSets; k++)
@@ -753,7 +753,7 @@
+" "+prefix+"=rhandler.getNewUniqueNSPrefix();\n"
+"
rhandler.startPrefixMapping("+prefix+","+attrNameSpace+");\n"
+" }\n"
- +"
"+attrName+"=("+prefix+"+\':'+org.apache.xalan.utils.QName.getLocalPart("+attrName+"));\n"
+ +"
"+attrName+"=("+prefix+"+\':'+org.apache.xml.utils.QName.getLocalPart("+attrName+"));\n"
+"}\n"
);
}
@@ -762,9 +762,9 @@
// compile-time decision above? Shouldn't really need to since the
// qname test ought to cover it, but....
body.append(
- "if(org.apache.xalan.utils.QName.isXMLNSDecl("+origAttrName+"))\n"
+ "if(org.apache.xml.utils.QName.isXMLNSDecl("+origAttrName+"))\n"
+"{ // Just declare namespace prefix \n"
- +" String
"+prefix+"=org.apache.xalan.utils.QName.getPrefixFromXMLNSDecl("+origAttrName+");\n"
+ +" String
"+prefix+"=org.apache.xml.utils.QName.getPrefixFromXMLNSDecl("+origAttrName+");\n"
+" String "+ns+"=rhandler.getURI("+prefix+");\n"
+" if(null=="+ns+")\n"
+" rhandler.startPrefixMapping("+prefix+","+val+");\n"
@@ -776,7 +776,7 @@
body.append(" "+attributeHandled+"=true;\n");
body.append("}\n"
+"else\n{\n"
- +" String
"+nsprefix+"=org.apache.xalan.utils.QName.getPrefixPart("+origAttrName+");\n"
+ +" String
"+nsprefix+"=org.apache.xml.utils.QName.getPrefixPart("+origAttrName+");\n"
+" if(null=="+nsprefix+") "+nsprefix+"=\"\";\n"
// attrNameSpace = getNamespaceForPrefix(nsprefix);
@@ -788,7 +788,7 @@
// The if here substitutes for early returns in original code
+"if(!"+attributeHandled+")\n{\n"
- +"String
"+localName+"=org.apache.xalan.utils.QName.getLocalPart("+attrName+");\n"
+ +"String
"+localName+"=org.apache.xml.utils.QName.getLocalPart("+attrName+");\n"
+"rhandler.addAttribute("+attrNameSpace+","+localName+","+attrName+",\"CDATA\","+val+");\n"
+"} //end attributeHandled\n"
+"} //end else\n"
@@ -862,10 +862,10 @@
* name and output is written to the directory that file
* would be found in (possibly relative). However, "."
* is treated as being found in itself rather than in "..".
- * TODO: ***** A more elegant version of this should be moved into
org.apache.xalan.utils.synthetic.Class?
+ * TODO: ***** A more elegant version of this should be moved into
org.apache.xml.utils.synthetic.Class?
* TODO: Should we use a classloader rather than std. classpath?
*/
- Class compileSyntheticClass(org.apache.xalan.utils.synthetic.Class tClass,
String classLocation)
+ Class compileSyntheticClass(org.apache.xml.utils.synthetic.Class tClass,
String classLocation)
{
Class resolved=null;
// Write class relative to specified starting location
@@ -946,7 +946,7 @@
tClass.getName());
e.printStackTrace();
}
- catch(org.apache.xalan.utils.synthetic.SynthesisException e)
+ catch(org.apache.xml.utils.synthetic.SynthesisException e)
{
System.err.println("ERR: synthesized Template class realization
failed for "+
tClass.getName());
1.7 +1 -1
xml-xalan/java/src/org/apache/xalan/processor/ProcessorCharacters.java
Index: ProcessorCharacters.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/ProcessorCharacters.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ProcessorCharacters.java 2000/11/22 23:25:50 1.6
+++ ProcessorCharacters.java 2000/11/23 04:57:23 1.7
@@ -64,7 +64,7 @@
import org.apache.xalan.templates.ElemTextLiteral;
import org.apache.xalan.templates.ElemTemplateElement;
import org.apache.xalan.templates.Constants;
-import org.apache.xalan.utils.XMLCharacterRecognizer;
+import org.apache.xml.utils.XMLCharacterRecognizer;
/**
* This class processes character events for a XSLT template element.
1.9 +1 -1
xml-xalan/java/src/org/apache/xalan/processor/ProcessorImport.java
Index: ProcessorImport.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/ProcessorImport.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ProcessorImport.java 2000/11/22 23:25:52 1.8
+++ ProcessorImport.java 2000/11/23 04:57:23 1.9
@@ -56,7 +56,7 @@
*/
package org.apache.xalan.processor;
-import org.apache.xalan.utils.TreeWalker;
+import org.apache.xml.utils.TreeWalker;
import org.apache.xalan.templates.Stylesheet;
import org.apache.xalan.templates.StylesheetComposed;
import org.apache.xalan.res.XSLMessages;
1.13 +2 -2
xml-xalan/java/src/org/apache/xalan/processor/ProcessorInclude.java
Index: ProcessorInclude.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/ProcessorInclude.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ProcessorInclude.java 2000/11/22 23:25:52 1.12
+++ ProcessorInclude.java 2000/11/23 04:57:24 1.13
@@ -56,7 +56,7 @@
*/
package org.apache.xalan.processor;
-import org.apache.xalan.utils.TreeWalker;
+import org.apache.xml.utils.TreeWalker;
import org.apache.xalan.templates.Stylesheet;
import org.apache.xalan.res.XSLMessages;
import org.apache.xalan.res.XSLTErrorResources;
@@ -83,7 +83,7 @@
import org.w3c.dom.Node;
-import org.apache.xalan.utils.SystemIDResolver;
+import org.apache.xml.utils.SystemIDResolver;
/**
* TransformerFactory class for xsl:include markup.
1.14 +1 -1
xml-xalan/java/src/org/apache/xalan/processor/ProcessorLRE.java
Index: ProcessorLRE.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/ProcessorLRE.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ProcessorLRE.java 2000/11/22 23:25:53 1.13
+++ ProcessorLRE.java 2000/11/23 04:57:24 1.14
@@ -71,7 +71,7 @@
import org.xml.sax.helpers.AttributesImpl;
import javax.xml.transform.TransformerConfigurationException;
-import org.apache.xalan.utils.SAXSourceLocator;
+import org.apache.xml.utils.SAXSourceLocator;
/**
* <meta name="usage" content="internal"/>
1.27 +8 -8
xml-xalan/java/src/org/apache/xalan/processor/StylesheetHandler.java
Index: StylesheetHandler.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/StylesheetHandler.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- StylesheetHandler.java 2000/11/22 23:25:58 1.26
+++ StylesheetHandler.java 2000/11/23 04:57:24 1.27
@@ -73,9 +73,9 @@
import org.apache.xalan.templates.ElemUnknown;
import org.apache.xalan.templates.StylesheetRoot;
import org.apache.xalan.templates.Stylesheet;
-import org.apache.xalan.utils.NodeConsumer;
-import org.apache.xalan.utils.PrefixResolver;
-import org.apache.xalan.utils.XMLCharacterRecognizer;
+import org.apache.xml.utils.NodeConsumer;
+import org.apache.xml.utils.PrefixResolver;
+import org.apache.xml.utils.XMLCharacterRecognizer;
import org.apache.xpath.compiler.FunctionTable;
import org.apache.xpath.compiler.XPathParser;
import org.apache.xpath.functions.Function;
@@ -97,7 +97,7 @@
import javax.xml.transform.ErrorListener;
import javax.xml.transform.TransformerException;
-import org.apache.xalan.utils.SAXSourceLocator;
+import org.apache.xml.utils.SAXSourceLocator;
/**
* <meta name="usage" content="advanced"/>
@@ -223,7 +223,7 @@
/**
* Given a namespace, get the corrisponding prefix. This is here only
- * to support the [EMAIL PROTECTED] org.apache.xalan.utils.PrefixResolver}
interface,
+ * to support the [EMAIL PROTECTED] org.apache.xml.utils.PrefixResolver}
interface,
* and will throw an error if invoked on this object.
*
* @param prefix The prefix to look up, which may be an empty string ("")
for the default Namespace.
@@ -1464,7 +1464,7 @@
/**
* The originating node if the current stylesheet is being created
* from a DOM.
- * @see org.apache.xalan.utils.NodeConsumer
+ * @see org.apache.xml.utils.NodeConsumer
*/
private Node m_originatingNode;
@@ -1472,7 +1472,7 @@
* Set the node that is originating the SAX event.
*
* @param n Reference to node that originated the current event.
- * @see org.apache.xalan.utils.NodeConsumer
+ * @see org.apache.xml.utils.NodeConsumer
*/
public void setOriginatingNode(Node n)
{
@@ -1483,7 +1483,7 @@
* Set the node that is originating the SAX event.
*
* @return Reference to node that originated the current event.
- * @see org.apache.xalan.utils.NodeConsumer
+ * @see org.apache.xml.utils.NodeConsumer
*/
public Node getOriginatingNode()
{
1.7 +1 -1
xml-xalan/java/src/org/apache/xalan/processor/StylesheetPIHandler.java
Index: StylesheetPIHandler.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/StylesheetPIHandler.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- StylesheetPIHandler.java 2000/11/22 23:25:59 1.6
+++ StylesheetPIHandler.java 2000/11/23 04:57:24 1.7
@@ -67,7 +67,7 @@
import javax.xml.transform.Source;
import javax.xml.transform.sax.SAXSource;
-import org.apache.xalan.utils.SystemIDResolver;
+import org.apache.xml.utils.SystemIDResolver;
/**
* Search for the xml-stylesheet processing instructions in an XML document.
1.12 +3 -3
xml-xalan/java/src/org/apache/xalan/processor/TransformerFactoryImpl.java
Index: TransformerFactoryImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/TransformerFactoryImpl.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- TransformerFactoryImpl.java 2000/11/17 21:58:13 1.11
+++ TransformerFactoryImpl.java 2000/11/23 04:57:25 1.12
@@ -66,9 +66,9 @@
import org.w3c.dom.Node;
-import org.apache.xalan.utils.TreeWalker;
-import org.apache.xalan.utils.SystemIDResolver;
-import org.apache.xalan.utils.DefaultErrorHandler;
+import org.apache.xml.utils.TreeWalker;
+import org.apache.xml.utils.SystemIDResolver;
+import org.apache.xml.utils.DefaultErrorHandler;
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xalan.transformer.TrAXFilter;
1.13 +4 -4
xml-xalan/java/src/org/apache/xalan/processor/XSLTAttributeDef.java
Index: XSLTAttributeDef.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/XSLTAttributeDef.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- XSLTAttributeDef.java 2000/11/22 23:25:59 1.12
+++ XSLTAttributeDef.java 2000/11/23 04:57:25 1.13
@@ -56,7 +56,7 @@
*/
package org.apache.xalan.processor;
-import org.apache.xalan.utils.StringToIntTable;
+import org.apache.xml.utils.StringToIntTable;
import java.lang.IllegalAccessException;
import java.lang.IndexOutOfBoundsException;
@@ -72,9 +72,9 @@
import org.apache.xalan.templates.AVT;
import org.apache.xalan.templates.ElemTemplateElement;
import org.apache.xalan.templates.Constants;
-import org.apache.xalan.utils.QName;
-import org.apache.xalan.utils.SystemIDResolver;
-import org.apache.xalan.utils.StringVector;
+import org.apache.xml.utils.QName;
+import org.apache.xml.utils.SystemIDResolver;
+import org.apache.xml.utils.StringVector;
import org.apache.xpath.XPath;
import javax.xml.transform.TransformerException;
1.4 +16 -14 xml-xalan/java/src/org/apache/xalan/res/XSLMessages.java
Index: XSLMessages.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/res/XSLMessages.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XSLMessages.java 2000/10/30 18:56:37 1.3
+++ XSLMessages.java 2000/11/23 04:57:29 1.4
@@ -56,6 +56,8 @@
*/
package org.apache.xalan.res;
+import org.apache.xml.utils.res.XResourceBundleBase;
+
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.ListResourceBundle;
@@ -75,10 +77,10 @@
private Locale fLocale = Locale.getDefault();
/** NEEDSDOC Field XSLTBundle */
- private static XSLResourceBundle XSLTBundle = null;
+ private static XResourceBundleBase XSLTBundle = null;
/** NEEDSDOC Field XPATHBundle */
- private static XSLResourceBundle XPATHBundle = null;
+ private static XResourceBundleBase XPATHBundle = null;
/** NEEDSDOC Field XSLT_ERROR_RESOURCES */
private static final String XSLT_ERROR_RESOURCES =
@@ -129,9 +131,9 @@
if (XPATHBundle == null)
XPATHBundle =
- (XSLResourceBundle) loadResourceBundle(XPATH_ERROR_RESOURCES);
+ (XResourceBundleBase) loadResourceBundle(XPATH_ERROR_RESOURCES);
- XSLResourceBundle fResourceBundle = XPATHBundle;
+ XResourceBundleBase fResourceBundle = XPATHBundle;
if (fResourceBundle != null)
{
@@ -158,9 +160,9 @@
if (XPATHBundle == null)
XPATHBundle =
- (XSLResourceBundle) loadResourceBundle(XPATH_ERROR_RESOURCES);
+ (XResourceBundleBase) loadResourceBundle(XPATH_ERROR_RESOURCES);
- XSLResourceBundle fResourceBundle = XPATHBundle;
+ XResourceBundleBase fResourceBundle = XPATHBundle;
if (fResourceBundle != null)
{
@@ -185,7 +187,7 @@
*
* NEEDSDOC ($objectName$) @return
*/
- public static final String createXPATHMsg(XSLResourceBundle
fResourceBundle,
+ public static final String createXPATHMsg(XResourceBundleBase
fResourceBundle,
String msgKey, Object args[])
//throws Exception
{
@@ -252,9 +254,9 @@
if (XSLTBundle == null)
XSLTBundle =
- (XSLResourceBundle) loadResourceBundle(XSLT_ERROR_RESOURCES);
+ (XResourceBundleBase) loadResourceBundle(XSLT_ERROR_RESOURCES);
- XSLResourceBundle fResourceBundle = XSLTBundle;
+ XResourceBundleBase fResourceBundle = XSLTBundle;
if (fResourceBundle != null)
{
@@ -281,9 +283,9 @@
if (XSLTBundle == null)
XSLTBundle =
- (XSLResourceBundle) loadResourceBundle(XSLT_ERROR_RESOURCES);
+ (XResourceBundleBase) loadResourceBundle(XSLT_ERROR_RESOURCES);
- XSLResourceBundle fResourceBundle = XSLTBundle;
+ XResourceBundleBase fResourceBundle = XSLTBundle;
if (fResourceBundle != null)
{
@@ -308,7 +310,7 @@
*
* NEEDSDOC ($objectName$) @return
*/
- public static final String createMsg(XSLResourceBundle fResourceBundle,
+ public static final String createMsg(XResourceBundleBase fResourceBundle,
String msgKey, Object args[])
//throws Exception
{
@@ -382,9 +384,9 @@
int majorCode;
int minorCode;
String fmsg = null;
- XSLResourceBundle aResourceBundle = null;
+ XResourceBundleBase aResourceBundle = null;
- aResourceBundle = (XSLResourceBundle) loadResourceBundle(bundleName);
+ aResourceBundle = (XResourceBundleBase) loadResourceBundle(bundleName);
String msgKey = aResourceBundle.getMessageKey(errorCode);
String msg = null;
1.10 +3 -2
xml-xalan/java/src/org/apache/xalan/res/XSLTErrorResources.java
Index: XSLTErrorResources.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/res/XSLTErrorResources.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- XSLTErrorResources.java 2000/11/22 23:59:30 1.9
+++ XSLTErrorResources.java 2000/11/23 04:57:30 1.10
@@ -56,6 +56,8 @@
*/
package org.apache.xalan.res;
+import org.apache.xml.utils.res.XResourceBundleBase;
+
import java.util.MissingResourceException;
import java.util.Locale;
import java.util.ResourceBundle;
@@ -63,7 +65,6 @@
import java.text.DecimalFormat;
import org.apache.xalan.templates.Constants;
-import org.apache.xalan.res.XSLResourceBundle;
/**
* Set up error messages.
@@ -75,7 +76,7 @@
* fill in the actual message string. Follow the instructions
* below.
*/
-public class XSLTErrorResources extends XSLResourceBundle
+public class XSLTErrorResources extends XResourceBundleBase
{
/** The error suffix for construction error property keys. */
1.6 +3 -3
xml-xalan/java/src/org/apache/xalan/serialize/FormatterToHTML.java
Index: FormatterToHTML.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/serialize/FormatterToHTML.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FormatterToHTML.java 2000/11/16 08:14:09 1.5
+++ FormatterToHTML.java 2000/11/23 04:57:35 1.6
@@ -66,14 +66,14 @@
import org.xml.sax.*;
-import org.apache.xalan.utils.BoolStack;
-import org.apache.xalan.utils.Trie;
+import org.apache.xml.utils.BoolStack;
+import org.apache.xml.utils.Trie;
import org.apache.xalan.res.XSLMessages;
import org.apache.xpath.res.XPATHErrorResources;
import org.apache.xalan.serialize.OutputFormat;
import org.apache.xalan.serialize.Method;
import org.apache.xalan.serialize.helpers.HTMLOutputFormat;
-import org.apache.xalan.utils.StringToIntTable;
+import org.apache.xml.utils.StringToIntTable;
/**
1.5 +3 -3
xml-xalan/java/src/org/apache/xalan/serialize/FormatterToXML.java
Index: FormatterToXML.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/serialize/FormatterToXML.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- FormatterToXML.java 2000/11/13 16:27:02 1.4
+++ FormatterToXML.java 2000/11/23 04:57:35 1.5
@@ -79,9 +79,9 @@
import org.apache.xalan.serialize.DOMSerializer;
import org.apache.xalan.serialize.QName;
-import org.apache.xalan.utils.BoolStack;
-import org.apache.xalan.utils.TreeWalker;
-import org.apache.xalan.utils.WrappedRuntimeException;
+import org.apache.xml.utils.BoolStack;
+import org.apache.xml.utils.TreeWalker;
+import org.apache.xml.utils.WrappedRuntimeException;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.res.XSLMessages;
1.7 +1 -1
xml-xalan/java/src/org/apache/xalan/stree/CDATASectionImpl.java
Index: CDATASectionImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/stree/CDATASectionImpl.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- CDATASectionImpl.java 2000/11/13 16:27:06 1.6
+++ CDATASectionImpl.java 2000/11/23 04:57:36 1.7
@@ -63,7 +63,7 @@
import javax.xml.transform.TransformerException;
import org.xml.sax.ext.LexicalHandler;
-import org.apache.xalan.utils.FastStringBuffer;
+import org.apache.xml.utils.FastStringBuffer;
/**
* <meta name="usage" content="internal"/>
1.13 +2 -2 xml-xalan/java/src/org/apache/xalan/stree/Child.java
Index: Child.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/stree/Child.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Child.java 2000/11/07 22:22:27 1.12
+++ Child.java 2000/11/23 04:57:37 1.13
@@ -56,7 +56,7 @@
*/
package org.apache.xalan.stree;
-import org.apache.xalan.utils.UnImplNode;
+import org.apache.xml.utils.UnImplNode;
import org.apache.xpath.DOMOrder;
import org.w3c.dom.Node;
@@ -168,7 +168,7 @@
*/
protected void throwParseError(Exception e)
{
- throw new org.apache.xalan.utils.WrappedRuntimeException(e);
+ throw new org.apache.xml.utils.WrappedRuntimeException(e);
}
/**
1.7 +1 -1
xml-xalan/java/src/org/apache/xalan/stree/CommentImpl.java
Index: CommentImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/stree/CommentImpl.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- CommentImpl.java 2000/11/13 16:27:07 1.6
+++ CommentImpl.java 2000/11/23 04:57:37 1.7
@@ -63,7 +63,7 @@
import javax.xml.transform.TransformerException;
import org.xml.sax.ext.LexicalHandler;
-import org.apache.xalan.utils.FastStringBuffer;
+import org.apache.xml.utils.FastStringBuffer;
/**
* <meta name="usage" content="internal"/>
1.4 +1 -1
xml-xalan/java/src/org/apache/xalan/stree/DOMImplementationImpl.java
Index: DOMImplementationImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/stree/DOMImplementationImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DOMImplementationImpl.java 2000/11/07 22:22:30 1.3
+++ DOMImplementationImpl.java 2000/11/23 04:57:37 1.4
@@ -61,7 +61,7 @@
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.DOMException;
-import org.apache.xalan.utils.UnImplNode;
+import org.apache.xml.utils.UnImplNode;
/**
* <meta name="usage" content="internal"/>
1.12 +1 -1
xml-xalan/java/src/org/apache/xalan/stree/DocumentImpl.java
Index: DocumentImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/stree/DocumentImpl.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- DocumentImpl.java 2000/11/16 08:14:09 1.11
+++ DocumentImpl.java 2000/11/23 04:57:37 1.12
@@ -70,7 +70,7 @@
import java.util.Hashtable;
-import org.apache.xalan.utils.FastStringBuffer;
+import org.apache.xml.utils.FastStringBuffer;
/**
* <meta name="usage" content="internal"/>
1.20 +1 -1
xml-xalan/java/src/org/apache/xalan/stree/ElementImpl.java
Index: ElementImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/stree/ElementImpl.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- ElementImpl.java 2000/11/07 22:22:35 1.19
+++ ElementImpl.java 2000/11/23 04:57:37 1.20
@@ -56,7 +56,7 @@
*/
package org.apache.xalan.stree;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.w3c.dom.Node;
1.2 +1 -1 xml-xalan/java/src/org/apache/xalan/stree/EntityImpl.java
Index: EntityImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/stree/EntityImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EntityImpl.java 2000/11/16 08:14:11 1.1
+++ EntityImpl.java 2000/11/23 04:57:38 1.2
@@ -5,7 +5,7 @@
import org.w3c.dom.Entity;
-public class EntityImpl extends org.apache.xalan.utils.UnImplNode implements
Entity
+public class EntityImpl extends org.apache.xml.utils.UnImplNode implements
Entity
{
String m_publicId;
String m_systemId;
1.5 +1 -1
xml-xalan/java/src/org/apache/xalan/stree/LevelIndexer.java
Index: LevelIndexer.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/stree/LevelIndexer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- LevelIndexer.java 2000/11/07 22:22:53 1.4
+++ LevelIndexer.java 2000/11/23 04:57:38 1.5
@@ -64,7 +64,7 @@
import java.lang.Object;
-import org.apache.xalan.utils.IntVector;
+import org.apache.xml.utils.IntVector;
/**
* <meta name="usage" content="general"/>
1.15 +1 -1 xml-xalan/java/src/org/apache/xalan/stree/Parent.java
Index: Parent.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/stree/Parent.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Parent.java 2000/11/13 16:27:07 1.14
+++ Parent.java 2000/11/23 04:57:38 1.15
@@ -310,7 +310,7 @@
}
catch (Exception e)
{
- throw new org.apache.xalan.utils.WrappedRuntimeException(e);
+ throw new org.apache.xml.utils.WrappedRuntimeException(e);
}
}
1.21 +3 -3
xml-xalan/java/src/org/apache/xalan/stree/SourceTreeHandler.java
Index: SourceTreeHandler.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/stree/SourceTreeHandler.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- SourceTreeHandler.java 2000/11/16 08:14:11 1.20
+++ SourceTreeHandler.java 2000/11/23 04:57:38 1.21
@@ -62,9 +62,9 @@
import org.xml.sax.ContentHandler;
-import org.apache.xalan.utils.DOMBuilder;
-import org.apache.xalan.utils.XMLCharacterRecognizer;
-import org.apache.xalan.utils.BoolStack;
+import org.apache.xml.utils.DOMBuilder;
+import org.apache.xml.utils.XMLCharacterRecognizer;
+import org.apache.xml.utils.BoolStack;
import org.apache.xpath.XPathContext;
import org.apache.xpath.SourceTreeManager;
import org.apache.xalan.transformer.TransformerImpl;
1.7 +2 -2
xml-xalan/java/src/org/apache/xalan/stree/StreeDOMBuilder.java
Index: StreeDOMBuilder.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/stree/StreeDOMBuilder.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- StreeDOMBuilder.java 2000/11/16 00:12:10 1.6
+++ StreeDOMBuilder.java 2000/11/23 04:57:39 1.7
@@ -56,7 +56,7 @@
*/
package org.apache.xalan.stree;
-import org.apache.xalan.utils.DOMBuilder;
+import org.apache.xml.utils.DOMBuilder;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentFragment;
@@ -145,7 +145,7 @@
* @param localName local part of qualified name of the element
* @param name The element type name.
* @param atts The attributes attached to the element, if any.
- * @see org.apache.xalan.utils.DOMBuilder.startElement()
+ * @see org.apache.xml.utils.DOMBuilder.startElement()
*/
public void startElement(
String ns, String localName, String name, Attributes atts)
1.8 +1 -1 xml-xalan/java/src/org/apache/xalan/stree/TextImpl.java
Index: TextImpl.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/stree/TextImpl.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- TextImpl.java 2000/11/16 00:12:10 1.7
+++ TextImpl.java 2000/11/23 04:57:39 1.8
@@ -62,7 +62,7 @@
import org.xml.sax.ContentHandler;
import javax.xml.transform.TransformerException;
-import org.apache.xalan.utils.FastStringBuffer;
+import org.apache.xml.utils.FastStringBuffer;
/**
* <meta name="usage" content="internal"/>
1.9 +4 -4 xml-xalan/java/src/org/apache/xalan/templates/AVT.java
Index: AVT.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/AVT.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- AVT.java 2000/11/13 16:27:08 1.8
+++ AVT.java 2000/11/23 04:57:45 1.9
@@ -61,15 +61,15 @@
import java.util.Vector;
import java.util.StringTokenizer;
-import org.apache.xalan.utils.StringBufferPool;
-import org.apache.xalan.utils.FastStringBuffer;
+import org.apache.xml.utils.StringBufferPool;
+import org.apache.xml.utils.FastStringBuffer;
import javax.xml.transform.TransformerException;
import org.apache.xpath.XPathContext;
import org.apache.xpath.XPath;
import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.PrefixResolver;
import org.apache.xalan.res.XSLMessages;
import org.apache.xalan.processor.StylesheetHandler;
import javax.xml.transform.ErrorListener;
@@ -463,7 +463,7 @@
* @throws javax.xml.transform.TransformerException
*/
public String evaluate(
- XPathContext xctxt, Node context,
org.apache.xalan.utils.PrefixResolver nsNode)
+ XPathContext xctxt, Node context,
org.apache.xml.utils.PrefixResolver nsNode)
throws javax.xml.transform.TransformerException
{
1.7 +2 -2
xml-xalan/java/src/org/apache/xalan/templates/AVTPart.java
Index: AVTPart.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/AVTPart.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- AVTPart.java 2000/11/13 16:27:08 1.6
+++ AVTPart.java 2000/11/23 04:57:45 1.7
@@ -59,7 +59,7 @@
import org.w3c.dom.*;
import org.apache.xpath.XPathContext;
-import org.apache.xalan.utils.FastStringBuffer;
+import org.apache.xml.utils.FastStringBuffer;
/**
* <meta name="usage" content="internal"/>
@@ -95,7 +95,7 @@
*/
public abstract void evaluate(
XPathContext xctxt, FastStringBuffer buf, Node context,
- org.apache.xalan.utils.PrefixResolver nsNode)
+ org.apache.xml.utils.PrefixResolver nsNode)
throws javax.xml.transform.TransformerException;
/**
1.6 +2 -2
xml-xalan/java/src/org/apache/xalan/templates/AVTPartSimple.java
Index: AVTPartSimple.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/AVTPartSimple.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- AVTPartSimple.java 2000/10/30 18:49:33 1.5
+++ AVTPartSimple.java 2000/11/23 04:57:45 1.6
@@ -59,7 +59,7 @@
import org.w3c.dom.*;
import org.apache.xpath.XPathContext;
-import org.apache.xalan.utils.FastStringBuffer;
+import org.apache.xml.utils.FastStringBuffer;
/**
* <meta name="usage" content="internal"/>
@@ -103,7 +103,7 @@
*/
public void evaluate(XPathContext xctxt, FastStringBuffer buf,
Node context,
- org.apache.xalan.utils.PrefixResolver nsNode)
+ org.apache.xml.utils.PrefixResolver nsNode)
{
buf.append(m_val);
}
1.7 +3 -3
xml-xalan/java/src/org/apache/xalan/templates/AVTPartXPath.java
Index: AVTPartXPath.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/AVTPartXPath.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- AVTPartXPath.java 2000/11/13 16:27:08 1.6
+++ AVTPartXPath.java 2000/11/23 04:57:45 1.7
@@ -60,7 +60,7 @@
import org.apache.xpath.objects.XObject;
import org.apache.xpath.XPathContext;
import org.apache.xpath.compiler.XPathParser;
-import org.apache.xalan.utils.FastStringBuffer;
+import org.apache.xml.utils.FastStringBuffer;
import org.w3c.dom.*;
@@ -98,7 +98,7 @@
* @throws javax.xml.transform.TransformerException
*/
public AVTPartXPath(
- String val, org.apache.xalan.utils.PrefixResolver nsNode,
XPathParser xpathProcessor, XPathFactory factory, XPathContext liaison)
+ String val, org.apache.xml.utils.PrefixResolver nsNode,
XPathParser xpathProcessor, XPathFactory factory, XPathContext liaison)
throws javax.xml.transform.TransformerException
{
m_xpath = new XPath(val, null, nsNode, XPath.SELECT);
@@ -126,7 +126,7 @@
* @throws javax.xml.transform.TransformerException
*/
public void evaluate(
- XPathContext xctxt, FastStringBuffer buf, Node context,
org.apache.xalan.utils.PrefixResolver nsNode)
+ XPathContext xctxt, FastStringBuffer buf, Node context,
org.apache.xml.utils.PrefixResolver nsNode)
throws javax.xml.transform.TransformerException
{
1.6 +2 -14
xml-xalan/java/src/org/apache/xalan/templates/Constants.java
Index: Constants.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/Constants.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Constants.java 2000/10/30 18:49:34 1.5
+++ Constants.java 2000/11/23 04:57:46 1.6
@@ -56,6 +56,8 @@
*/
package org.apache.xalan.templates;
+import org.apache.xml.utils.res.XResourceBundle;
+
/**
* <meta name="usage" content="advanced"/>
* Primary constants used in the TransformerImpl classes.
@@ -416,18 +418,4 @@
/** NEEDSDOC Field ATTRNAME_XXXX */
public static final String ATTRNAME_XXXX = "XXXX";
-
- /** NEEDSDOC Field ERROR_RESOURCES, XSLT_RESOURCE, LANG_BUNDLE_NAME,
MULT_ORDER, MULT_PRECEDES, MULT_FOLLOWS, LANG_ORIENTATION, LANG_RIGHTTOLEFT,
LANG_LEFTTORIGHT, LANG_NUMBERING, LANG_ADDITIVE, LANG_MULT_ADD,
LANG_MULTIPLIER, LANG_MULTIPLIER_CHAR, LANG_NUMBERGROUPS, LANG_NUM_TABLES,
LANG_ALPHABET, LANG_TRAD_ALPHABET */
- public static final String ERROR_RESOURCES =
- "org.apache.xalan.res.XSLTErrorResources", XSLT_RESOURCE =
- "org.apache.xalan.res.XSLTResourceBundle", LANG_BUNDLE_NAME =
- "org.apache.xalan.res.XSLTResources", MULT_ORDER =
- "multiplierOrder", MULT_PRECEDES = "precedes", MULT_FOLLOWS =
- "follows", LANG_ORIENTATION = "orientation", LANG_RIGHTTOLEFT =
- "rightToLeft", LANG_LEFTTORIGHT = "leftToRight", LANG_NUMBERING =
- "numbering", LANG_ADDITIVE = "additive", LANG_MULT_ADD =
- "multiplicative-additive", LANG_MULTIPLIER =
- "multiplier", LANG_MULTIPLIER_CHAR =
- "multiplierChar", LANG_NUMBERGROUPS = "numberGroups", LANG_NUM_TABLES =
- "tables", LANG_ALPHABET = "alphabet", LANG_TRAD_ALPHABET =
"tradAlphabet";
}
1.6 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/DecimalFormatProperties.java
Index: DecimalFormatProperties.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/DecimalFormatProperties.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DecimalFormatProperties.java 2000/10/30 18:49:34 1.5
+++ DecimalFormatProperties.java 2000/11/23 04:57:47 1.6
@@ -68,7 +68,7 @@
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.res.*;
import org.apache.xalan.transformer.TransformerImpl;
1.5 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemApplyImport.java
Index: ElemApplyImport.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemApplyImport.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ElemApplyImport.java 2000/11/13 16:27:08 1.4
+++ ElemApplyImport.java 2000/11/23 04:57:47 1.5
@@ -63,7 +63,7 @@
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
/**
* <meta name="usage" content="advanced"/>
1.6 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemApplyTemplates.java
Index: ElemApplyTemplates.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemApplyTemplates.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ElemApplyTemplates.java 2000/11/13 16:27:08 1.5
+++ ElemApplyTemplates.java 2000/11/23 04:57:47 1.6
@@ -66,7 +66,7 @@
import java.util.Vector;
import org.apache.xalan.trace.TracerEvent;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xpath.VariableStack;
import org.apache.xalan.transformer.TransformerImpl;
1.8 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemAttribute.java
Index: ElemAttribute.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemAttribute.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ElemAttribute.java 2000/11/13 16:27:09 1.7
+++ ElemAttribute.java 2000/11/23 04:57:47 1.8
@@ -61,7 +61,7 @@
import javax.xml.transform.TransformerException;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.res.XSLMessages;
import org.apache.xalan.transformer.TransformerImpl;
1.4 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemAttributeSet.java
Index: ElemAttributeSet.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemAttributeSet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ElemAttributeSet.java 2000/11/13 16:27:09 1.3
+++ ElemAttributeSet.java 2000/11/23 04:57:47 1.4
@@ -61,7 +61,7 @@
import javax.xml.transform.TransformerException;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.res.XSLMessages;
1.8 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemCallTemplate.java
Index: ElemCallTemplate.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemCallTemplate.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ElemCallTemplate.java 2000/11/13 16:27:09 1.7
+++ ElemCallTemplate.java 2000/11/23 04:57:47 1.8
@@ -63,7 +63,7 @@
import org.xml.sax.*;
import org.apache.xpath.*;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xpath.VariableStack;
import org.apache.xalan.transformer.TransformerImpl;
1.5 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemChoose.java
Index: ElemChoose.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemChoose.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ElemChoose.java 2000/11/13 16:27:09 1.4
+++ ElemChoose.java 2000/11/23 04:57:48 1.5
@@ -63,7 +63,7 @@
import org.apache.xpath.*;
import org.apache.xpath.objects.XObject;
import org.apache.xalan.trace.SelectionEvent;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
1.5 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemComment.java
Index: ElemComment.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemComment.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ElemComment.java 2000/11/13 16:27:09 1.4
+++ ElemComment.java 2000/11/23 04:57:50 1.5
@@ -61,7 +61,7 @@
import org.xml.sax.*;
import org.apache.xpath.*;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
1.7 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemCopy.java
Index: ElemCopy.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemCopy.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ElemCopy.java 2000/11/16 00:25:22 1.6
+++ ElemCopy.java 2000/11/23 04:57:50 1.7
@@ -64,7 +64,7 @@
import java.util.*;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.trace.*;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
1.7 +2 -2
xml-xalan/java/src/org/apache/xalan/templates/ElemCopyOf.java
Index: ElemCopyOf.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemCopyOf.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ElemCopyOf.java 2000/11/16 20:04:50 1.6
+++ ElemCopyOf.java 2000/11/23 04:57:50 1.7
@@ -65,7 +65,7 @@
import org.apache.xpath.objects.XObject;
import org.apache.xalan.trace.SelectionEvent;
import org.apache.xalan.res.XSLTErrorResources;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.transformer.TreeWalker2Result;
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xalan.transformer.ResultTreeHandler;
@@ -183,7 +183,7 @@
NodeIterator nl = value.nodeset();
// Copy the tree.
- org.apache.xalan.utils.TreeWalker tw =
+ org.apache.xml.utils.TreeWalker tw =
new
TreeWalker2Result(transformer, handler);
Node pos;
1.9 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemElement.java
Index: ElemElement.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemElement.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ElemElement.java 2000/11/13 16:27:09 1.8
+++ ElemElement.java 2000/11/23 04:57:51 1.9
@@ -61,7 +61,7 @@
import org.xml.sax.*;
import org.apache.xpath.*;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xalan.transformer.ResultTreeHandler;
1.15 +4 -4
xml-xalan/java/src/org/apache/xalan/templates/ElemExtensionCall.java
Index: ElemExtensionCall.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemExtensionCall.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ElemExtensionCall.java 2000/11/13 16:27:10 1.14
+++ ElemExtensionCall.java 2000/11/23 04:57:51 1.15
@@ -67,11 +67,11 @@
import java.util.StringTokenizer;
-import org.apache.xalan.utils.QName;
-import org.apache.xalan.utils.NameSpace;
-import org.apache.xalan.utils.StringToStringTable;
+import org.apache.xml.utils.QName;
+import org.apache.xml.utils.NameSpace;
+import org.apache.xml.utils.StringToStringTable;
import org.apache.xpath.XPathContext;
-import org.apache.xalan.utils.MutableAttrListImpl;
+import org.apache.xml.utils.MutableAttrListImpl;
import org.apache.xalan.res.XSLMessages;
import org.apache.xpath.XPathContext;
import org.apache.xalan.res.XSLTErrorResources;
1.12 +4 -4
xml-xalan/java/src/org/apache/xalan/templates/ElemExtensionDecl.java
Index: ElemExtensionDecl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemExtensionDecl.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ElemExtensionDecl.java 2000/11/13 16:27:10 1.11
+++ ElemExtensionDecl.java 2000/11/23 04:57:51 1.12
@@ -58,10 +58,10 @@
import java.util.Vector;
-import org.apache.xalan.utils.QName;
-import org.apache.xalan.utils.NameSpace;
-import org.apache.xalan.utils.StringToStringTable;
-import org.apache.xalan.utils.StringVector;
+import org.apache.xml.utils.QName;
+import org.apache.xml.utils.NameSpace;
+import org.apache.xml.utils.StringToStringTable;
+import org.apache.xml.utils.StringVector;
import org.apache.xalan.extensions.ExtensionHandler;
import org.apache.xalan.extensions.ExtensionHandlerGeneral;
import org.apache.xalan.extensions.ExtensionsTable;
1.5 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemFallback.java
Index: ElemFallback.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemFallback.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ElemFallback.java 2000/11/13 16:27:10 1.4
+++ ElemFallback.java 2000/11/23 04:57:51 1.5
@@ -62,7 +62,7 @@
import org.apache.xpath.*;
import org.apache.xalan.trace.SelectionEvent;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
1.9 +2 -2
xml-xalan/java/src/org/apache/xalan/templates/ElemForEach.java
Index: ElemForEach.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemForEach.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ElemForEach.java 2000/11/16 20:04:50 1.8
+++ ElemForEach.java 2000/11/23 04:57:51 1.9
@@ -67,8 +67,8 @@
import java.util.Vector;
-import org.apache.xalan.utils.QName;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.QName;
+import org.apache.xml.utils.PrefixResolver;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xalan.transformer.NodeSorter;
1.5 +1 -1 xml-xalan/java/src/org/apache/xalan/templates/ElemIf.java
Index: ElemIf.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemIf.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ElemIf.java 2000/11/13 16:27:10 1.4
+++ ElemIf.java 2000/11/23 04:57:52 1.5
@@ -63,7 +63,7 @@
import org.apache.xpath.*;
import org.apache.xpath.objects.XObject;
import org.apache.xalan.trace.SelectionEvent;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
1.11 +5 -5
xml-xalan/java/src/org/apache/xalan/templates/ElemLiteralResult.java
Index: ElemLiteralResult.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemLiteralResult.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ElemLiteralResult.java 2000/11/13 16:27:10 1.10
+++ ElemLiteralResult.java 2000/11/23 04:57:52 1.11
@@ -63,12 +63,12 @@
import java.util.StringTokenizer;
-import org.apache.xalan.utils.QName;
-import org.apache.xalan.utils.NameSpace;
+import org.apache.xml.utils.QName;
+import org.apache.xml.utils.NameSpace;
import org.apache.xpath.XPathContext;
-import org.apache.xalan.utils.StringToStringTable;
-import org.apache.xalan.utils.NameSpace;
-import org.apache.xalan.utils.StringVector;
+import org.apache.xml.utils.StringToStringTable;
+import org.apache.xml.utils.NameSpace;
+import org.apache.xml.utils.StringVector;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xalan.transformer.ResultTreeHandler;
1.5 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemMessage.java
Index: ElemMessage.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemMessage.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ElemMessage.java 2000/11/13 16:27:10 1.4
+++ ElemMessage.java 2000/11/23 04:57:52 1.5
@@ -61,7 +61,7 @@
import org.xml.sax.*;
import org.apache.xpath.*;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
1.10 +70 -68
xml-xalan/java/src/org/apache/xalan/templates/ElemNumber.java
Index: ElemNumber.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemNumber.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ElemNumber.java 2000/11/13 16:27:10 1.9
+++ ElemNumber.java 2000/11/23 04:57:52 1.10
@@ -56,6 +56,8 @@
*/
package org.apache.xalan.templates;
+import org.apache.xml.utils.res.XResourceBundle;
+
import org.w3c.dom.*;
import org.w3c.dom.traversal.NodeIterator;
@@ -69,14 +71,14 @@
import org.apache.xpath.*;
import org.apache.xpath.objects.XObject;
import org.apache.xpath.compiler.XPathParser;
-import org.apache.xalan.utils.QName;
-import org.apache.xalan.utils.StringBufferPool;
-import org.apache.xalan.utils.FastStringBuffer;
+import org.apache.xml.utils.QName;
+import org.apache.xml.utils.StringBufferPool;
+import org.apache.xml.utils.FastStringBuffer;
import org.apache.xalan.res.*;
import org.apache.xalan.transformer.DecimalToRoman;
import org.apache.xalan.transformer.CountersTable;
import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.utils.NodeVector;
+import org.apache.xml.utils.NodeVector;
import javax.xml.transform.TransformerException;
@@ -444,7 +446,7 @@
* Shouldn't this be in the transformer? Big worries about threads...
*/
- // private XSLTResourceBundle thisBundle;
+ // private XResourceBundle thisBundle;
/**
* Table to help in converting decimals to roman numerals.
@@ -1238,15 +1240,15 @@
case 'A' :
if (m_alphaCountTable == null)
{
- XSLTResourceBundle thisBundle;
+ XResourceBundle thisBundle;
thisBundle =
- (XSLTResourceBundle) XSLTResourceBundle.loadResourceBundle(
- Constants.LANG_BUNDLE_NAME, getLocale(transformer, contextNode));
+ (XResourceBundle) XResourceBundle.loadResourceBundle(
+ org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME,
getLocale(transformer, contextNode));
char[] alphabet;
- alphabet = (char[]) thisBundle.getObject(Constants.LANG_ALPHABET);
+ alphabet = (char[])
thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET);
m_alphaCountTable = alphabet;
}
@@ -1255,15 +1257,15 @@
case 'a' :
if (m_alphaCountTable == null)
{
- XSLTResourceBundle thisBundle;
+ XResourceBundle thisBundle;
thisBundle =
- (XSLTResourceBundle) XSLTResourceBundle.loadResourceBundle(
- Constants.LANG_BUNDLE_NAME, getLocale(transformer, contextNode));
+ (XResourceBundle) XResourceBundle.loadResourceBundle(
+ org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME,
getLocale(transformer, contextNode));
char[] alphabet;
- alphabet = (char[]) thisBundle.getObject(Constants.LANG_ALPHABET);
+ alphabet = (char[])
thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET);
m_alphaCountTable = alphabet;
}
@@ -1291,10 +1293,10 @@
break;
case 0x3042 :
{
- XSLTResourceBundle thisBundle;
+ XResourceBundle thisBundle;
- thisBundle = (XSLTResourceBundle)
XSLTResourceBundle.loadResourceBundle(
- Constants.LANG_BUNDLE_NAME, new Locale("ja", "JP", "HA"));
+ thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
+ org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new
Locale("ja", "JP", "HA"));
if (letterVal != null
&& letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
@@ -1303,16 +1305,16 @@
formattedNumber.append(
int2singlealphaCount(
listElement,
- (char[]) thisBundle.getObject(Constants.LANG_ALPHABET)));
+ (char[])
thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET)));
break;
}
case 0x3044 :
{
- XSLTResourceBundle thisBundle;
+ XResourceBundle thisBundle;
- thisBundle = (XSLTResourceBundle)
XSLTResourceBundle.loadResourceBundle(
- Constants.LANG_BUNDLE_NAME, new Locale("ja", "JP", "HI"));
+ thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
+ org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new
Locale("ja", "JP", "HI"));
if ((letterVal != null)
&& letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
@@ -1321,16 +1323,16 @@
formattedNumber.append(
int2singlealphaCount(
listElement,
- (char[]) thisBundle.getObject(Constants.LANG_ALPHABET)));
+ (char[])
thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET)));
break;
}
case 0x30A2 :
{
- XSLTResourceBundle thisBundle;
+ XResourceBundle thisBundle;
- thisBundle = (XSLTResourceBundle)
XSLTResourceBundle.loadResourceBundle(
- Constants.LANG_BUNDLE_NAME, new Locale("ja", "JP", "A"));
+ thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
+ org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new
Locale("ja", "JP", "A"));
if (letterVal != null
&& letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
@@ -1339,16 +1341,16 @@
formattedNumber.append(
int2singlealphaCount(
listElement,
- (char[]) thisBundle.getObject(Constants.LANG_ALPHABET)));
+ (char[])
thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET)));
break;
}
case 0x30A4 :
{
- XSLTResourceBundle thisBundle;
+ XResourceBundle thisBundle;
- thisBundle = (XSLTResourceBundle)
XSLTResourceBundle.loadResourceBundle(
- Constants.LANG_BUNDLE_NAME, new Locale("ja", "JP", "I"));
+ thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
+ org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new
Locale("ja", "JP", "I"));
if (letterVal != null
&& letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
@@ -1357,16 +1359,16 @@
formattedNumber.append(
int2singlealphaCount(
listElement,
- (char[]) thisBundle.getObject(Constants.LANG_ALPHABET)));
+ (char[])
thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET)));
break;
}
case 0x4E00 :
{
- XSLTResourceBundle thisBundle;
+ XResourceBundle thisBundle;
- thisBundle = (XSLTResourceBundle)
XSLTResourceBundle.loadResourceBundle(
- Constants.LANG_BUNDLE_NAME, new Locale("zh", "CN"));
+ thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
+ org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new
Locale("zh", "CN"));
if (letterVal != null
&& letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
@@ -1375,109 +1377,109 @@
}
else //if (m_lettervalue_avt != null &&
m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
int2alphaCount(listElement,
- (char[])
thisBundle.getObject(Constants.LANG_ALPHABET),
+ (char[])
thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET),
formattedNumber);
break;
}
case 0x58F9 :
{
- XSLTResourceBundle thisBundle;
+ XResourceBundle thisBundle;
- thisBundle = (XSLTResourceBundle)
XSLTResourceBundle.loadResourceBundle(
- Constants.LANG_BUNDLE_NAME, new Locale("zh", "TW"));
+ thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
+ org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new
Locale("zh", "TW"));
if (letterVal != null
&& letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
formattedNumber.append(tradAlphaCount(listElement, thisBundle));
else //if (m_lettervalue_avt != null &&
m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
int2alphaCount(listElement,
- (char[])
thisBundle.getObject(Constants.LANG_ALPHABET),
+ (char[])
thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET),
formattedNumber);
break;
}
case 0x0E51 :
{
- XSLTResourceBundle thisBundle;
+ XResourceBundle thisBundle;
- thisBundle = (XSLTResourceBundle)
XSLTResourceBundle.loadResourceBundle(
- Constants.LANG_BUNDLE_NAME, new Locale("th", ""));
+ thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
+ org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new
Locale("th", ""));
if (letterVal != null
&& letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
formattedNumber.append(tradAlphaCount(listElement, thisBundle));
else //if (m_lettervalue_avt != null &&
m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
int2alphaCount(listElement,
- (char[])
thisBundle.getObject(Constants.LANG_ALPHABET),
+ (char[])
thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET),
formattedNumber);
break;
}
case 0x05D0 :
{
- XSLTResourceBundle thisBundle;
+ XResourceBundle thisBundle;
- thisBundle = (XSLTResourceBundle)
XSLTResourceBundle.loadResourceBundle(
- Constants.LANG_BUNDLE_NAME, new Locale("he", ""));
+ thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
+ org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new
Locale("he", ""));
if (letterVal != null
&& letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
formattedNumber.append(tradAlphaCount(listElement, thisBundle));
else //if (m_lettervalue_avt != null &&
m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
int2alphaCount(listElement,
- (char[])
thisBundle.getObject(Constants.LANG_ALPHABET),
+ (char[])
thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET),
formattedNumber);
break;
}
case 0x10D0 :
{
- XSLTResourceBundle thisBundle;
+ XResourceBundle thisBundle;
- thisBundle = (XSLTResourceBundle)
XSLTResourceBundle.loadResourceBundle(
- Constants.LANG_BUNDLE_NAME, new Locale("ka", ""));
+ thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
+ org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new
Locale("ka", ""));
if (letterVal != null
&& letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
formattedNumber.append(tradAlphaCount(listElement, thisBundle));
else //if (m_lettervalue_avt != null &&
m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
int2alphaCount(listElement,
- (char[])
thisBundle.getObject(Constants.LANG_ALPHABET),
+ (char[])
thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET),
formattedNumber);
break;
}
case 0x03B1 :
{
- XSLTResourceBundle thisBundle;
+ XResourceBundle thisBundle;
- thisBundle = (XSLTResourceBundle)
XSLTResourceBundle.loadResourceBundle(
- Constants.LANG_BUNDLE_NAME, new Locale("el", ""));
+ thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
+ org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new
Locale("el", ""));
if (letterVal != null
&& letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
formattedNumber.append(tradAlphaCount(listElement, thisBundle));
else //if (m_lettervalue_avt != null &&
m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
int2alphaCount(listElement,
- (char[])
thisBundle.getObject(Constants.LANG_ALPHABET),
+ (char[])
thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET),
formattedNumber);
break;
}
case 0x0430 :
{
- XSLTResourceBundle thisBundle;
+ XResourceBundle thisBundle;
- thisBundle = (XSLTResourceBundle)
XSLTResourceBundle.loadResourceBundle(
- Constants.LANG_BUNDLE_NAME, new Locale("cy", ""));
+ thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle(
+ org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new
Locale("cy", ""));
if (letterVal != null
&& letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
formattedNumber.append(tradAlphaCount(listElement, thisBundle));
else //if (m_lettervalue_avt != null &&
m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
int2alphaCount(listElement,
- (char[])
thisBundle.getObject(Constants.LANG_ALPHABET),
+ (char[])
thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET),
formattedNumber);
break;
@@ -1555,7 +1557,7 @@
//some languages go left to right(ie. english), right to left (ie.
Hebrew),
//top to bottom (ie.Japanese), etc... Handle them differently
- //String orientation = thisBundle.getString(Constants.LANG_ORIENTATION);
+ //String orientation =
thisBundle.getString(org.apache.xml.utils.res.XResourceBundle.LANG_ORIENTATION);
// next character to set in the buffer
int charPos;
@@ -1631,7 +1633,7 @@
* Note that the radix of the conversion is inferred from the size
* of the table.
*/
- protected String tradAlphaCount(int val, XSLTResourceBundle thisBundle)
+ protected String tradAlphaCount(int val, XResourceBundle thisBundle)
{
// if this number is larger than the largest number we can represent,
error!
@@ -1649,29 +1651,29 @@
//some languages go left to right(ie. english), right to left (ie.
Hebrew),
//top to bottom (ie.Japanese), etc... Handle them differently
- //String orientation = thisBundle.getString(Constants.LANG_ORIENTATION);
+ //String orientation =
thisBundle.getString(org.apache.xml.utils.res.XResourceBundle.LANG_ORIENTATION);
// next character to set in the buffer
int charPos;
charPos = 0; //start at 0
// array of number groups: ie.1000, 100, 10, 1
- int[] groups = (int[]) thisBundle.getObject(Constants.LANG_NUMBERGROUPS);
+ int[] groups = (int[])
thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_NUMBERGROUPS);
// array of tables of hundreds, tens, digits...
String[] tables =
- (String[]) (thisBundle.getObject(Constants.LANG_NUM_TABLES));
+ (String[])
(thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_NUM_TABLES));
//some languages have additive alphabetical notation,
//some multiplicative-additive, etc... Handle them differently.
- String numbering = thisBundle.getString(Constants.LANG_NUMBERING);
+ String numbering =
thisBundle.getString(org.apache.xml.utils.res.XResourceBundle.LANG_NUMBERING);
// do multiplicative part first
- if (numbering.equals(Constants.LANG_MULT_ADD))
+ if
(numbering.equals(org.apache.xml.utils.res.XResourceBundle.LANG_MULT_ADD))
{
- String mult_order = thisBundle.getString(Constants.MULT_ORDER);
+ String mult_order =
thisBundle.getString(org.apache.xml.utils.res.XResourceBundle.MULT_ORDER);
int[] multiplier =
- (int[]) (thisBundle.getObject(Constants.LANG_MULTIPLIER));
+ (int[])
(thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_MULTIPLIER));
char[] zeroChar = (char[]) thisBundle.getObject("zero");
int i = 0;
@@ -1742,12 +1744,12 @@
break;
char multiplierChar = ((char[]) (thisBundle.getObject(
- Constants.LANG_MULTIPLIER_CHAR)))[i];
+
org.apache.xml.utils.res.XResourceBundle.LANG_MULTIPLIER_CHAR)))[i];
// put out the next character of output
if (lookupIndex < table.length)
{
- if (mult_order.equals(Constants.MULT_PRECEDES))
+ if
(mult_order.equals(org.apache.xml.utils.res.XResourceBundle.MULT_PRECEDES))
{
buf[charPos++] = multiplierChar;
buf[charPos++] = table[lookupIndex];
1.6 +1 -1 xml-xalan/java/src/org/apache/xalan/templates/ElemPI.java
Index: ElemPI.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemPI.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ElemPI.java 2000/11/13 16:27:10 1.5
+++ ElemPI.java 2000/11/23 04:57:53 1.6
@@ -61,7 +61,7 @@
import org.xml.sax.*;
import org.apache.xpath.*;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
1.6 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemParam.java
Index: ElemParam.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemParam.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ElemParam.java 2000/11/13 16:27:10 1.5
+++ ElemParam.java 2000/11/23 04:57:53 1.6
@@ -62,7 +62,7 @@
import org.apache.xpath.*;
import org.apache.xalan.trace.*;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.transformer.TransformerImpl;
import javax.xml.transform.TransformerException;
1.6 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemTemplate.java
Index: ElemTemplate.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemTemplate.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ElemTemplate.java 2000/11/13 16:27:10 1.5
+++ ElemTemplate.java 2000/11/23 04:57:53 1.6
@@ -61,7 +61,7 @@
import org.xml.sax.*;
import org.apache.xpath.*;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
1.23 +5 -5
xml-xalan/java/src/org/apache/xalan/templates/ElemTemplateElement.java
Index: ElemTemplateElement.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemTemplateElement.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- ElemTemplateElement.java 2000/11/15 18:09:02 1.22
+++ ElemTemplateElement.java 2000/11/23 04:57:53 1.23
@@ -64,11 +64,11 @@
import java.util.Vector;
// Xalan imports
-import org.apache.xalan.utils.UnImplNode;
-import org.apache.xalan.utils.NameSpace;
-import org.apache.xalan.utils.PrefixResolver;
-import org.apache.xalan.utils.QName;
-import org.apache.xalan.utils.StringToStringTable;
+import org.apache.xml.utils.UnImplNode;
+import org.apache.xml.utils.NameSpace;
+import org.apache.xml.utils.PrefixResolver;
+import org.apache.xml.utils.QName;
+import org.apache.xml.utils.StringToStringTable;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.res.XSLMessages;
import org.apache.xalan.transformer.TransformerImpl;
1.5 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemTextLiteral.java
Index: ElemTextLiteral.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemTextLiteral.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ElemTextLiteral.java 2000/11/13 16:27:10 1.4
+++ ElemTextLiteral.java 2000/11/23 04:57:54 1.5
@@ -60,7 +60,7 @@
import org.xml.sax.*;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xalan.transformer.ResultTreeHandler;
1.4 +5 -5
xml-xalan/java/src/org/apache/xalan/templates/ElemUnknown.java
Index: ElemUnknown.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemUnknown.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ElemUnknown.java 2000/11/13 16:27:11 1.3
+++ ElemUnknown.java 2000/11/23 04:57:54 1.4
@@ -63,12 +63,12 @@
import java.util.StringTokenizer;
-import org.apache.xalan.utils.QName;
-import org.apache.xalan.utils.NameSpace;
+import org.apache.xml.utils.QName;
+import org.apache.xml.utils.NameSpace;
import org.apache.xpath.XPathContext;
-import org.apache.xalan.utils.StringToStringTable;
-import org.apache.xalan.utils.NameSpace;
-import org.apache.xalan.utils.StringVector;
+import org.apache.xml.utils.StringToStringTable;
+import org.apache.xml.utils.NameSpace;
+import org.apache.xml.utils.StringVector;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xalan.transformer.ResultTreeHandler;
1.6 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemUse.java
Index: ElemUse.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemUse.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ElemUse.java 2000/11/13 16:27:11 1.5
+++ ElemUse.java 2000/11/23 04:57:54 1.6
@@ -63,7 +63,7 @@
import javax.xml.transform.TransformerException;
import org.apache.xpath.*;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import java.util.StringTokenizer;
1.8 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemValueOf.java
Index: ElemValueOf.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemValueOf.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ElemValueOf.java 2000/11/13 16:27:11 1.7
+++ ElemValueOf.java 2000/11/23 04:57:54 1.8
@@ -64,7 +64,7 @@
import org.apache.xpath.objects.XString;
import org.apache.xpath.objects.XObject;
import org.apache.xalan.trace.SelectionEvent;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xalan.transformer.ResultTreeHandler;
1.6 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemVariable.java
Index: ElemVariable.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemVariable.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ElemVariable.java 2000/11/13 16:27:11 1.5
+++ ElemVariable.java 2000/11/23 04:57:55 1.6
@@ -64,7 +64,7 @@
import org.apache.xpath.objects.XObject;
import org.apache.xpath.objects.XString;
import org.apache.xpath.objects.XRTreeFrag;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.trace.SelectionEvent;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
1.4 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemWithParam.java
Index: ElemWithParam.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemWithParam.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ElemWithParam.java 2000/10/30 18:50:01 1.3
+++ ElemWithParam.java 2000/11/23 04:57:55 1.4
@@ -61,7 +61,7 @@
import org.xml.sax.*;
import org.apache.xpath.*;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
1.15 +6 -6
xml-xalan/java/src/org/apache/xalan/templates/FuncDocument.java
Index: FuncDocument.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/FuncDocument.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- FuncDocument.java 2000/11/14 18:56:26 1.14
+++ FuncDocument.java 2000/11/23 04:57:55 1.15
@@ -89,7 +89,7 @@
import javax.xml.transform.TransformerException;
import javax.xml.transform.SourceLocator;
import javax.xml.transform.ErrorListener;
-import org.apache.xalan.utils.SAXSourceLocator;
+import org.apache.xml.utils.SAXSourceLocator;
import javax.xml.transform.Source;
/**
@@ -297,16 +297,16 @@
// path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA,
new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested
doc: "+((base == null) ? "" : base )+uri);
while (throwable
- instanceof org.apache.xalan.utils.WrappedRuntimeException)
+ instanceof org.apache.xml.utils.WrappedRuntimeException)
{
throwable =
- ((org.apache.xalan.utils.WrappedRuntimeException)
throwable).getException();
+ ((org.apache.xml.utils.WrappedRuntimeException)
throwable).getException();
}
if ((throwable instanceof NullPointerException)
|| (throwable instanceof ClassCastException))
{
- throw new org.apache.xalan.utils.WrappedRuntimeException(
+ throw new org.apache.xml.utils.WrappedRuntimeException(
(Exception) throwable);
}
@@ -341,8 +341,8 @@
e = spe2.getException();
- if (e instanceof
org.apache.xalan.utils.WrappedRuntimeException)
- e = ((org.apache.xalan.utils.WrappedRuntimeException)
e).getException();
+ if (e instanceof org.apache.xml.utils.WrappedRuntimeException)
+ e = ((org.apache.xml.utils.WrappedRuntimeException)
e).getException();
}
else
e = null;
1.10 +2 -2
xml-xalan/java/src/org/apache/xalan/templates/FuncFormatNumb.java
Index: FuncFormatNumb.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/FuncFormatNumb.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- FuncFormatNumb.java 2000/11/13 16:27:11 1.9
+++ FuncFormatNumb.java 2000/11/23 04:57:55 1.10
@@ -58,7 +58,7 @@
import java.util.Vector;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xpath.functions.Function;
import org.apache.xpath.functions.Function3Args;
import org.apache.xpath.XPathContext;
@@ -74,7 +74,7 @@
import javax.xml.transform.TransformerException;
import javax.xml.transform.ErrorListener;
-import org.apache.xalan.utils.SAXSourceLocator;
+import org.apache.xml.utils.SAXSourceLocator;
/**
* <meta name="usage" content="advanced"/>
1.6 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/FuncKey.java
Index: FuncKey.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/FuncKey.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FuncKey.java 2000/11/13 16:27:11 1.5
+++ FuncKey.java 2000/11/23 04:57:56 1.6
@@ -68,7 +68,7 @@
import org.apache.xpath.XPathContext;
import org.apache.xpath.axes.LocPathIterator;
import org.apache.xpath.axes.UnionPathIterator;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xalan.transformer.KeyManager;
import org.apache.xpath.res.XPATHErrorResources;
1.4 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/KeyDeclaration.java
Index: KeyDeclaration.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/KeyDeclaration.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- KeyDeclaration.java 2000/10/30 18:50:03 1.3
+++ KeyDeclaration.java 2000/11/23 04:57:56 1.4
@@ -57,7 +57,7 @@
package org.apache.xalan.templates;
import org.apache.xpath.XPath;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
/**
* <meta name="usage" content="internal"/>
1.11 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/OutputFormatExtended.java
Index: OutputFormatExtended.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/OutputFormatExtended.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- OutputFormatExtended.java 2000/11/13 16:27:11 1.10
+++ OutputFormatExtended.java 2000/11/23 04:57:56 1.11
@@ -62,7 +62,7 @@
import org.w3c.dom.Document;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
/**
* This class extends OutputFormat to act as a bean that
1.16 +3 -3
xml-xalan/java/src/org/apache/xalan/templates/Stylesheet.java
Index: Stylesheet.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/Stylesheet.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Stylesheet.java 2000/11/22 23:56:49 1.15
+++ Stylesheet.java 2000/11/23 04:57:56 1.16
@@ -68,9 +68,9 @@
import java.util.Vector;
// Xalan imports
-import org.apache.xalan.utils.SystemIDResolver;
-import org.apache.xalan.utils.QName;
-import org.apache.xalan.utils.StringVector;
+import org.apache.xml.utils.SystemIDResolver;
+import org.apache.xml.utils.QName;
+import org.apache.xml.utils.StringVector;
import org.apache.xpath.XPath;
// DOM Imports
1.19 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/StylesheetComposed.java
Index: StylesheetComposed.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/StylesheetComposed.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- StylesheetComposed.java 2000/11/17 20:37:11 1.18
+++ StylesheetComposed.java 2000/11/23 04:57:57 1.19
@@ -62,7 +62,7 @@
import javax.xml.transform.TransformerConfigurationException;
import org.apache.xpath.XPath;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.serialize.OutputFormat;
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xpath.XPathContext;
1.23 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/StylesheetRoot.java
Index: StylesheetRoot.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/StylesheetRoot.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- StylesheetRoot.java 2000/11/15 16:18:45 1.22
+++ StylesheetRoot.java 2000/11/23 04:57:57 1.23
@@ -68,7 +68,7 @@
import org.xml.sax.helpers.*;
import org.apache.xalan.serialize.*;
-import org.apache.xalan.utils.*;
+import org.apache.xml.utils.*;
import org.apache.xpath.*;
import org.apache.xpath.compiler.XPathParser;
import org.apache.xalan.trace.*;
1.22 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/TemplateList.java
Index: TemplateList.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/TemplateList.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- TemplateList.java 2000/11/17 20:37:11 1.21
+++ TemplateList.java 2000/11/23 04:57:57 1.22
@@ -66,7 +66,7 @@
import javax.xml.transform.TransformerException;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xpath.XPath;
import org.apache.xpath.compiler.PsuedoNames;
import org.apache.xpath.patterns.NodeTest;
1.7 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/TemplateSubPatternAssociation.java
Index: TemplateSubPatternAssociation.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/TemplateSubPatternAssociation.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- TemplateSubPatternAssociation.java 2000/11/17 20:37:11 1.6
+++ TemplateSubPatternAssociation.java 2000/11/23 04:57:57 1.7
@@ -65,7 +65,7 @@
import org.apache.xpath.XPath;
import org.apache.xpath.XPathContext;
import org.apache.xpath.patterns.StepPattern;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
/**
* A class to contain a match pattern and it's corresponding template.
1.5 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/WhitespaceList.java
Index: WhitespaceList.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/WhitespaceList.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- WhitespaceList.java 2000/11/13 16:27:11 1.4
+++ WhitespaceList.java 2000/11/23 04:57:57 1.5
@@ -57,7 +57,7 @@
package org.apache.xalan.templates;
import org.apache.xpath.XPathContext;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.w3c.dom.Node;
import org.w3c.dom.Element;
1.4 +4 -4
xml-xalan/java/src/org/apache/xalan/trace/GenerateEvent.java
Index: GenerateEvent.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/trace/GenerateEvent.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- GenerateEvent.java 2000/11/03 23:28:11 1.3
+++ GenerateEvent.java 2000/11/23 04:58:11 1.4
@@ -70,10 +70,10 @@
* This event responds to and is modeled on the SAX events that are sent to
the
* formatter listener FormatterToXXX)classes.
*
- * @see org.apache.xalan.utils.DOMBuilder
- * @see org.apache.xalan.utils.FormatterToHTML
- * @see org.apache.xalan.utils.FormatterToText
- * @see org.apache.xalan.utils.FormatterToXML
+ * @see org.apache.xml.utils.DOMBuilder
+ * @see org.apache.xml.utils.FormatterToHTML
+ * @see org.apache.xml.utils.FormatterToText
+ * @see org.apache.xml.utils.FormatterToXML
*
*/
public class GenerateEvent implements java.util.EventListener
1.6 +1 -1
xml-xalan/java/src/org/apache/xalan/trace/TraceManager.java
Index: TraceManager.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/trace/TraceManager.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- TraceManager.java 2000/11/13 16:27:18 1.5
+++ TraceManager.java 2000/11/23 04:58:12 1.6
@@ -61,7 +61,7 @@
import org.w3c.dom.Node;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.templates.ElemTemplateElement;
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xpath.objects.XObject;
1.4 +1 -1
xml-xalan/java/src/org/apache/xalan/trace/TracerEvent.java
Index: TracerEvent.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/trace/TracerEvent.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TracerEvent.java 2000/11/03 23:28:11 1.3
+++ TracerEvent.java 2000/11/23 04:58:12 1.4
@@ -60,7 +60,7 @@
import org.apache.xalan.templates.ElemTemplateElement;
import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
/**
* <meta name="usage" content="advanced"/>
1.5 +1 -1
xml-xalan/java/src/org/apache/xalan/transformer/Counter.java
Index: Counter.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/Counter.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Counter.java 2000/11/13 16:27:19 1.4
+++ Counter.java 2000/11/23 04:58:14 1.5
@@ -58,7 +58,7 @@
import org.w3c.dom.Node;
-import org.apache.xalan.utils.NodeVector;
+import org.apache.xml.utils.NodeVector;
import org.apache.xpath.NodeSet; // for isNodeAfter support
import org.apache.xpath.XPathContext;
1.6 +2 -2
xml-xalan/java/src/org/apache/xalan/transformer/KeyIterator.java
Index: KeyIterator.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/KeyIterator.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- KeyIterator.java 2000/11/13 16:27:19 1.5
+++ KeyIterator.java 2000/11/23 04:58:16 1.6
@@ -59,8 +59,8 @@
import java.util.Vector;
import org.apache.xpath.axes.LocPathIterator;
-import org.apache.xalan.utils.PrefixResolver;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.PrefixResolver;
+import org.apache.xml.utils.QName;
import org.apache.xalan.templates.KeyDeclaration;
import org.apache.xpath.XPathContext;
import org.apache.xpath.axes.DescendantOrSelfWalker;
1.7 +2 -2
xml-xalan/java/src/org/apache/xalan/transformer/KeyManager.java
Index: KeyManager.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/KeyManager.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- KeyManager.java 2000/11/13 16:27:19 1.6
+++ KeyManager.java 2000/11/23 04:58:16 1.7
@@ -62,8 +62,8 @@
import org.w3c.dom.NodeList;
import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.utils.QName;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.QName;
+import org.apache.xml.utils.PrefixResolver;
import org.apache.xpath.XPathContext;
import org.apache.xpath.axes.LocPathIterator;
1.6 +2 -2
xml-xalan/java/src/org/apache/xalan/transformer/KeyTable.java
Index: KeyTable.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/KeyTable.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- KeyTable.java 2000/11/13 16:27:19 1.5
+++ KeyTable.java 2000/11/23 04:58:16 1.6
@@ -69,10 +69,10 @@
import org.apache.xpath.XPathContext;
import org.apache.xpath.XPathContext;
import org.apache.xpath.DOMHelper;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xalan.templates.KeyDeclaration;
import org.apache.xpath.XPathContext;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.PrefixResolver;
import org.apache.xpath.axes.LocPathIterator;
// import org.apache.xalan.dtm.*;
1.8 +2 -2
xml-xalan/java/src/org/apache/xalan/transformer/KeyWalker.java
Index: KeyWalker.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/KeyWalker.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- KeyWalker.java 2000/11/16 17:12:41 1.7
+++ KeyWalker.java 2000/11/23 04:58:16 1.8
@@ -59,8 +59,8 @@
import java.util.Vector;
import org.apache.xpath.axes.LocPathIterator;
-import org.apache.xalan.utils.PrefixResolver;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.PrefixResolver;
+import org.apache.xml.utils.QName;
import org.apache.xalan.templates.KeyDeclaration;
import org.apache.xpath.XPathContext;
import org.apache.xpath.axes.DescendantOrSelfWalker;
1.5 +2 -2
xml-xalan/java/src/org/apache/xalan/transformer/NodeSortKey.java
Index: NodeSortKey.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/NodeSortKey.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- NodeSortKey.java 2000/11/13 16:27:19 1.4
+++ NodeSortKey.java 2000/11/23 04:58:18 1.5
@@ -90,7 +90,7 @@
Locale m_locale;
/** NEEDSDOC Field m_namespaceContext */
- org.apache.xalan.utils.PrefixResolver m_namespaceContext;
+ org.apache.xml.utils.PrefixResolver m_namespaceContext;
/** NEEDSDOC Field m_processor */
TransformerImpl m_processor; // needed for error reporting.
@@ -110,7 +110,7 @@
* @throws javax.xml.transform.TransformerException
*/
NodeSortKey(
- TransformerImpl transformer, XPath selectPat, boolean
treatAsNumbers, boolean descending, String langValue, boolean caseOrderUpper,
org.apache.xalan.utils.PrefixResolver namespaceContext)
+ TransformerImpl transformer, XPath selectPat, boolean
treatAsNumbers, boolean descending, String langValue, boolean caseOrderUpper,
org.apache.xml.utils.PrefixResolver namespaceContext)
throws javax.xml.transform.TransformerException
{
1.8 +1 -1
xml-xalan/java/src/org/apache/xalan/transformer/NodeSorter.java
Index: NodeSorter.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/NodeSorter.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- NodeSorter.java 2000/11/13 16:27:19 1.7
+++ NodeSorter.java 2000/11/23 04:58:19 1.8
@@ -69,7 +69,7 @@
import org.apache.xpath.NodeSet;
import org.apache.xpath.objects.XObject;
import org.apache.xpath.objects.XNodeSet;
-import org.apache.xalan.utils.NodeVector;
+import org.apache.xml.utils.NodeVector;
import javax.xml.transform.TransformerException;
1.5 +1 -1
xml-xalan/java/src/org/apache/xalan/transformer/QueuedEvents.java
Index: QueuedEvents.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/QueuedEvents.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- QueuedEvents.java 2000/11/13 16:27:19 1.4
+++ QueuedEvents.java 2000/11/23 04:58:19 1.5
@@ -58,7 +58,7 @@
import java.util.Stack;
-import org.apache.xalan.utils.ObjectPool;
+import org.apache.xml.utils.ObjectPool;
import org.xml.sax.Attributes;
1.5 +2 -2
xml-xalan/java/src/org/apache/xalan/transformer/QueuedStartElement.java
Index: QueuedStartElement.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/QueuedStartElement.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- QueuedStartElement.java 2000/11/13 16:27:19 1.4
+++ QueuedStartElement.java 2000/11/23 04:58:20 1.5
@@ -62,9 +62,9 @@
import javax.xml.transform.TransformerException;
import org.xml.sax.Attributes;
-import org.apache.xalan.utils.MutableAttrListImpl;
+import org.apache.xml.utils.MutableAttrListImpl;
import org.apache.xalan.trace.GenerateEvent;
-import org.apache.xalan.utils.NameSpace;
+import org.apache.xml.utils.NameSpace;
/**
* Tracks the state of a queued element event.
1.7 +1 -1
xml-xalan/java/src/org/apache/xalan/transformer/ResultTreeFrag.java
Index: ResultTreeFrag.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/ResultTreeFrag.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ResultTreeFrag.java 2000/10/30 18:57:01 1.6
+++ ResultTreeFrag.java 2000/11/23 04:58:20 1.7
@@ -67,7 +67,7 @@
import org.apache.xpath.XPathContext;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.utils.UnImplNode;
+import org.apache.xml.utils.UnImplNode;
import org.apache.xalan.stree.DocumentFragmentImpl;
/**
1.25 +5 -5
xml-xalan/java/src/org/apache/xalan/transformer/ResultTreeHandler.java
Index: ResultTreeHandler.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/ResultTreeHandler.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- ResultTreeHandler.java 2000/11/15 17:16:43 1.24
+++ ResultTreeHandler.java 2000/11/23 04:58:21 1.25
@@ -62,11 +62,11 @@
import org.apache.xalan.templates.StylesheetRoot;
import org.apache.xalan.trace.TraceManager;
import org.apache.xalan.trace.GenerateEvent;
-import org.apache.xalan.utils.MutableAttrListImpl;
-import org.apache.xalan.utils.QName;
-import org.apache.xalan.utils.TreeWalker;
-import org.apache.xalan.utils.ObjectPool;
-import org.apache.xalan.utils.XMLCharacterRecognizer;
+import org.apache.xml.utils.MutableAttrListImpl;
+import org.apache.xml.utils.QName;
+import org.apache.xml.utils.TreeWalker;
+import org.apache.xml.utils.ObjectPool;
+import org.apache.xml.utils.XMLCharacterRecognizer;
import org.apache.xpath.DOMHelper;
import org.apache.xpath.objects.XObject;
import org.apache.xpath.XPathContext;
1.54 +13 -13
xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java
Index: TransformerImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- TransformerImpl.java 2000/11/18 01:19:14 1.53
+++ TransformerImpl.java 2000/11/23 04:58:21 1.54
@@ -88,12 +88,12 @@
import org.apache.xalan.templates.TemplateList;
import org.apache.xalan.templates.XUnresolvedVariable;
import org.apache.xalan.trace.TraceManager;
-import org.apache.xalan.utils.DOMBuilder;
-import org.apache.xalan.utils.NodeVector;
-import org.apache.xalan.utils.BoolStack;
-import org.apache.xalan.utils.QName;
-import org.apache.xalan.utils.PrefixResolver;
-import org.apache.xalan.utils.ObjectPool;
+import org.apache.xml.utils.DOMBuilder;
+import org.apache.xml.utils.NodeVector;
+import org.apache.xml.utils.BoolStack;
+import org.apache.xml.utils.QName;
+import org.apache.xml.utils.PrefixResolver;
+import org.apache.xml.utils.ObjectPool;
import org.apache.xpath.XPathContext;
import org.apache.xpath.NodeSet;
import org.apache.xpath.objects.XObject;
@@ -328,7 +328,7 @@
/**
* The SAX error handler, where errors and warnings are sent.
*/
- private ErrorListener m_errorHandler = new
org.apache.xalan.utils.DefaultErrorHandler();
+ private ErrorListener m_errorHandler = new
org.apache.xml.utils.DefaultErrorHandler();
/**
* The trace manager.
@@ -591,9 +591,9 @@
{
if (e instanceof javax.xml.transform.TransformerException)
throw (javax.xml.transform.TransformerException) e;
- else if (e instanceof org.apache.xalan.utils.WrappedRuntimeException)
+ else if (e instanceof org.apache.xml.utils.WrappedRuntimeException)
throw new javax.xml.transform.TransformerException(
- ((org.apache.xalan.utils.WrappedRuntimeException)
e).getException());
+ ((org.apache.xml.utils.WrappedRuntimeException)
e).getException());
else
{
throw new javax.xml.transform.TransformerException(e);
@@ -604,15 +604,15 @@
m_resultTreeHandler.endDocument();
}
}
- catch (org.apache.xalan.utils.WrappedRuntimeException wre)
+ catch (org.apache.xml.utils.WrappedRuntimeException wre)
{
Throwable throwable = wre.getException();
while (throwable
- instanceof org.apache.xalan.utils.WrappedRuntimeException)
+ instanceof org.apache.xml.utils.WrappedRuntimeException)
{
throwable =
- ((org.apache.xalan.utils.WrappedRuntimeException)
throwable).getException();
+ ((org.apache.xml.utils.WrappedRuntimeException)
throwable).getException();
}
throw new TransformerException(wre.getException());
@@ -2825,7 +2825,7 @@
e.printStackTrace();
}
- // throw new org.apache.xalan.utils.WrappedRuntimeException(e);
+ // throw new org.apache.xml.utils.WrappedRuntimeException(e);
}
}
1.6 +2 -2
xml-xalan/java/src/org/apache/xalan/transformer/TreeWalker2Result.java
Index: TreeWalker2Result.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TreeWalker2Result.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- TreeWalker2Result.java 2000/11/13 16:27:19 1.5
+++ TreeWalker2Result.java 2000/11/23 04:58:22 1.6
@@ -60,8 +60,8 @@
import org.xml.sax.*;
-import org.apache.xalan.utils.TreeWalker;
-import org.apache.xalan.utils.MutableAttrListImpl;
+import org.apache.xml.utils.TreeWalker;
+import org.apache.xml.utils.MutableAttrListImpl;
import org.apache.xalan.templates.ElemTemplateElement;
import org.apache.xpath.DOMHelper;
1.18 +3 -3 xml-xalan/java/src/org/apache/xalan/xslt/Process.java
Index: Process.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xslt/Process.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Process.java 2000/11/16 03:22:23 1.17
+++ Process.java 2000/11/23 04:58:43 1.18
@@ -178,7 +178,7 @@
java.io.PrintWriter dumpWriter = diagnosticsWriter;
XSLTErrorResources resbundle =
(XSLTErrorResources) (XSLMessages.loadResourceBundle(
- Constants.ERROR_RESOURCES));
+ org.apache.xml.utils.res.XResourceBundle.ERROR_RESOURCES));
// loadPropertyFileToSystem(XSLT_PROPERTIES);
if (argv.length < 1)
@@ -519,10 +519,10 @@
catch (Throwable throwable)
{
while (throwable
- instanceof org.apache.xalan.utils.WrappedRuntimeException)
+ instanceof org.apache.xml.utils.WrappedRuntimeException)
{
throwable =
- ((org.apache.xalan.utils.WrappedRuntimeException)
throwable).getException();
+ ((org.apache.xml.utils.WrappedRuntimeException)
throwable).getException();
}
if ((throwable instanceof NullPointerException)
1.1 xml-xalan/java/src/org/apache/xml/utils/AttList.java
Index: AttList.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import org.w3c.dom.*;
import org.xml.sax.*;
import org.apache.xpath.DOMHelper;
import org.apache.xpath.DOM2Helper;
/**
* <meta name="usage" content="internal"/>
* Wraps a DOM attribute list in a SAX Attributes.
*/
public class AttList implements Attributes
{
/** NEEDSDOC Field m_attrs */
NamedNodeMap m_attrs;
/** NEEDSDOC Field m_lastIndex */
int m_lastIndex;
// ARGHH!! JAXP Uses Xerces without setting the namespace processing to ON!
// DOM2Helper m_dh = new DOM2Helper();
/** NEEDSDOC Field m_dh */
DOMHelper m_dh;
/**
* Constructor AttList
*
*
* NEEDSDOC @param attrs
*/
public AttList(NamedNodeMap attrs)
{
m_attrs = attrs;
m_lastIndex = m_attrs.getLength() - 1;
m_dh = new DOM2Helper();
}
/**
* Constructor AttList
*
*
* NEEDSDOC @param attrs
* NEEDSDOC @param dh
*/
public AttList(NamedNodeMap attrs, DOMHelper dh)
{
m_attrs = attrs;
m_lastIndex = m_attrs.getLength() - 1;
m_dh = dh;
}
/**
* NEEDSDOC Method getLength
*
*
* NEEDSDOC (getLength) @return
*/
public int getLength()
{
return m_attrs.getLength();
}
/**
* Look up an attribute's Namespace URI by index.
*
* @param index The attribute index (zero-based).
* @return The Namespace URI, or the empty string if none
* is available, or null if the index is out of
* range.
*/
public String getURI(int index)
{
return m_dh.getNamespaceOfNode(((Attr) m_attrs.item(index)));
}
/**
* Look up an attribute's local name by index.
*
* @param index The attribute index (zero-based).
* @return The local name, or the empty string if Namespace
* processing is not being performed, or null
* if the index is out of range.
*/
public String getLocalName(int index)
{
return m_dh.getLocalNameOfNode(((Attr) m_attrs.item(index)));
}
/**
* NEEDSDOC Method getQName
*
*
* NEEDSDOC @param i
*
* NEEDSDOC (getQName) @return
*/
public String getQName(int i)
{
return ((Attr) m_attrs.item(i)).getName();
}
/**
* NEEDSDOC Method getType
*
*
* NEEDSDOC @param i
*
* NEEDSDOC (getType) @return
*/
public String getType(int i)
{
return "CDATA"; // for the moment
}
/**
* NEEDSDOC Method getValue
*
*
* NEEDSDOC @param i
*
* NEEDSDOC (getValue) @return
*/
public String getValue(int i)
{
return ((Attr) m_attrs.item(i)).getValue();
}
/**
* NEEDSDOC Method getType
*
*
* NEEDSDOC @param name
*
* NEEDSDOC (getType) @return
*/
public String getType(String name)
{
return "CDATA"; // for the moment
}
/**
* Look up an attribute's type by Namespace name.
*
* @param uri The Namespace URI, or the empty String if the
* name has no Namespace URI.
* @param localName The local name of the attribute.
* @return The attribute type as a string, or null if the
* attribute is not in the list or if Namespace
* processing is not being performed.
*/
public String getType(String uri, String localName)
{
return "CDATA"; // for the moment
}
/**
* NEEDSDOC Method getValue
*
*
* NEEDSDOC @param name
*
* NEEDSDOC (getValue) @return
*/
public String getValue(String name)
{
return ((Attr) m_attrs.getNamedItem(name)).getValue();
}
/**
* Look up an attribute's value by Namespace name.
*
* @param uri The Namespace URI, or the empty String if the
* name has no Namespace URI.
* @param localName The local name of the attribute.
* @return The attribute value as a string, or null if the
* attribute is not in the list.
*/
public String getValue(String uri, String localName)
{
return ((Attr) m_attrs.getNamedItem(localName)).getValue();
}
/**
* Look up the index of an attribute by Namespace name.
*
* @param uri The Namespace URI, or the empty string if
* the name has no Namespace URI.
* @param localName The attribute's local name.
* NEEDSDOC @param localPart
* @return The index of the attribute, or -1 if it does not
* appear in the list.
*/
public int getIndex(String uri, String localPart)
{
return 0;
}
/**
* Look up the index of an attribute by raw XML 1.0 name.
*
* @param rawName The raw (prefixed) name.
* @return The index of the attribute, or -1 if it does not
* appear in the list.
*/
public int getIndex(String rawName)
{
return 0;
}
}
1.1 xml-xalan/java/src/org/apache/xml/utils/BoolStack.java
Index: BoolStack.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import java.util.EmptyStackException;
/**
* <meta name="usage" content="internal"/>
* Simple stack for boolean values.
*/
public final class BoolStack
{
/** NEEDSDOC Field m_values[] */
private boolean m_values[];
/** NEEDSDOC Field m_allocatedSize */
private int m_allocatedSize;
/** NEEDSDOC Field m_index */
private int m_index;
/**
* Default constructor. Note that the default
* block size is very small, for small lists.
*/
public BoolStack()
{
this(32);
}
/**
* Construct a IntVector, using the given block size.
*
* NEEDSDOC @param size
*/
public BoolStack(int size)
{
m_allocatedSize = size;
m_values = new boolean[size];
m_index = -1;
}
/**
* Get the length of the list.
*
* NEEDSDOC ($objectName$) @return
*/
public final int size()
{
return m_index + 1;
}
/**
* Pushes an item onto the top of this stack.
*
* @param i the int to be pushed onto this stack.
*
* NEEDSDOC @param val
* @return the <code>item</code> argument.
*/
public final boolean push(boolean val)
{
if (m_index == m_allocatedSize - 1)
grow();
return (m_values[++m_index] = val);
}
/**
* Removes the object at the top of this stack and returns that
* object as the value of this function.
*
* @return The object at the top of this stack.
* @exception EmptyStackException if this stack is empty.
*/
public final boolean pop()
{
return m_values[m_index--];
}
/**
* NEEDSDOC Method popAndTop
*
*
* NEEDSDOC (popAndTop) @return
*/
public final boolean popAndTop()
{
m_index--;
return (m_index >= 0) ? m_values[m_index] : false;
}
/**
* NEEDSDOC Method setTop
*
*
* NEEDSDOC @param b
*/
public final void setTop(boolean b)
{
m_values[m_index] = b;
}
/**
* Looks at the object at the top of this stack without removing it
* from the stack.
*
* @return the object at the top of this stack.
* @exception EmptyStackException if this stack is empty.
*/
public final boolean peek()
{
return m_values[m_index];
}
/**
* Looks at the object at the top of this stack without removing it
* from the stack. If the stack is empty, it returns false.
*
* @return the object at the top of this stack.
*/
public final boolean peekOrFalse()
{
return (m_index > -1) ? m_values[m_index] : false;
}
/**
* Tests if this stack is empty.
*
* @return <code>true</code> if this stack is empty;
* <code>false</code> otherwise.
*/
public boolean isEmpty()
{
return (m_index == -1);
}
/**
* Grows the size of the stack
*
*/
private void grow()
{
m_allocatedSize *= 2;
boolean newVector[] = new boolean[m_allocatedSize];
System.arraycopy(m_values, 0, newVector, 0, m_index + 1);
m_values = newVector;
}
}
1.1 xml-xalan/java/src/org/apache/xml/utils/DOMBuilder.java
Index: DOMBuilder.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import org.apache.xalan.res.XSLMessages;
import org.apache.xpath.res.XPATHErrorResources;
import org.apache.xml.utils.NodeVector;
import org.xml.sax.ext.LexicalHandler;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
import org.xml.sax.Attributes;
import org.w3c.dom.*; // we pretty much use everything in the DOM here.
/**
* <meta name="usage" content="general"/>
* This class takes SAX events (in addition to some extra events
* that SAX doesn't handle yet) and adds the result to a document
* or document fragment.
*/
public class DOMBuilder
implements ContentHandler, LexicalHandler
{
/** NEEDSDOC Field m_doc */
public Document m_doc;
/** NEEDSDOC Field m_currentNode */
Node m_currentNode = null;
/** NEEDSDOC Field m_docFrag */
public DocumentFragment m_docFrag = null;
/** NEEDSDOC Field m_elemStack */
NodeVector m_elemStack = new NodeVector();
/**
* DOMBuilder instance constructor... it will add the DOM nodes
* to the document fragment.
*
* NEEDSDOC @param doc
* NEEDSDOC @param node
*/
public DOMBuilder(Document doc, Node node)
{
m_doc = doc;
m_currentNode = node;
}
/**
* DOMBuilder instance constructor... it will add the DOM nodes
* to the document fragment.
*
* NEEDSDOC @param doc
* NEEDSDOC @param docFrag
*/
public DOMBuilder(Document doc, DocumentFragment docFrag)
{
m_doc = doc;
m_docFrag = docFrag;
}
/**
* DOMBuilder instance constructor... it will add the DOM nodes
* to the document.
*
* NEEDSDOC @param doc
*/
public DOMBuilder(Document doc)
{
m_doc = doc;
}
/**
* Get the root node of the DOM being created. This
* is either a Document or a DocumentFragment.
*
* NEEDSDOC ($objectName$) @return
*/
public Node getRootNode()
{
return (null != m_docFrag) ? (Node) m_docFrag : (Node) m_doc;
}
/**
* Get the node currently being processed.
*
* NEEDSDOC ($objectName$) @return
*/
public Node getCurrentNode()
{
return m_currentNode;
}
/**
* Return null since there is no Writer for this class.
*
* NEEDSDOC ($objectName$) @return
*/
public java.io.Writer getWriter()
{
return null;
}
/**
* Append a node to the current container.
*
* NEEDSDOC @param newNode
*/
protected void append(Node newNode) throws org.xml.sax.SAXException
{
Node currentNode = m_currentNode;
if (null != currentNode)
{
currentNode.appendChild(newNode);
// System.out.println(newNode.getNodeName());
}
else if (null != m_docFrag)
{
m_docFrag.appendChild(newNode);
}
else
{
boolean ok = true;
short type = newNode.getNodeType();
if (type == Node.TEXT_NODE)
{
String data = newNode.getNodeValue();
if ((null != data) && (data.trim().length() > 0))
{
throw new org.xml.sax.SAXException(
XSLMessages.createXPATHMessage(
XPATHErrorResources.ER_CANT_OUTPUT_TEXT_BEFORE_DOC, null));
//"Warning: can't output text before document element! Ignoring...");
}
ok = false;
}
else if (type == Node.ELEMENT_NODE)
{
if (m_doc.getDocumentElement() != null)
{
throw new org.xml.sax.SAXException(
XSLMessages.createXPATHMessage(
XPATHErrorResources.ER_CANT_HAVE_MORE_THAN_ONE_ROOT, null));
//"Can't have more than one root on a DOM!");
}
}
if (ok)
m_doc.appendChild(newNode);
}
}
/**
* Receive an object for locating the origin of SAX document events.
*
* <p>SAX parsers are strongly encouraged (though not absolutely
* required) to supply a locator: if it does so, it must supply
* the locator to the application by invoking this method before
* invoking any of the other methods in the ContentHandler
* interface.</p>
*
* <p>The locator allows the application to determine the end
* position of any document-related event, even if the parser is
* not reporting an error. Typically, the application will
* use this information for reporting its own errors (such as
* character content that does not match an application's
* business rules). The information returned by the locator
* is probably not sufficient for use with a search engine.</p>
*
* <p>Note that the locator will return correct information only
* during the invocation of the events in this interface. The
* application should not attempt to use it at any other time.</p>
*
* @param locator An object that can return the location of
* any SAX document event.
* @see org.xml.sax.Locator
*/
public void setDocumentLocator(Locator locator)
{
// No action for the moment.
}
/**
* Receive notification of the beginning of a document.
*
* <p>The SAX parser will invoke this method only once, before any
* other methods in this interface or in DTDHandler (except for
* setDocumentLocator).</p>
*/
public void startDocument() throws org.xml.sax.SAXException
{
// No action for the moment.
}
/**
* Receive notification of the end of a document.
*
* <p>The SAX parser will invoke this method only once, and it will
* be the last method invoked during the parse. The parser shall
* not invoke this method until it has either abandoned parsing
* (because of an unrecoverable error) or reached the end of
* input.</p>
*/
public void endDocument() throws org.xml.sax.SAXException
{
// No action for the moment.
}
/**
* Receive notification of the beginning of an element.
*
* <p>The Parser will invoke this method at the beginning of every
* element in the XML document; there will be a corresponding
* endElement() event for every startElement() event (even when the
* element is empty). All of the element's content will be
* reported, in order, before the corresponding endElement()
* event.</p>
*
* <p>If the element name has a namespace prefix, the prefix will
* still be attached. Note that the attribute list provided will
* contain only attributes with explicit values (specified or
* defaulted): #IMPLIED attributes will be omitted.</p>
*
*
* NEEDSDOC @param ns
* NEEDSDOC @param localName
* @param name The element type name.
* @param atts The attributes attached to the element, if any.
* @see #endElement
* @see org.xml.sax.Attributes
*/
public void startElement(
String ns, String localName, String name, Attributes atts)
throws org.xml.sax.SAXException
{
Element elem;
if ((null == ns) || (ns.length() == 0))
elem = m_doc.createElement(name);
else
elem = m_doc.createElementNS(ns, name);
append(elem);
int nAtts = atts.getLength();
if (0 != nAtts)
{
for (int i = 0; i < nAtts; i++)
{
//System.out.println("type " + atts.getType(i) + " name " +
atts.getLocalName(i) );
// First handle a possible ID attribute
if (atts.getType(i).equalsIgnoreCase("ID"))
setIDAttribute(atts.getValue(i), elem);
String attrNS = atts.getURI(i);
// System.out.println("attrNS: "+attrNS+", localName:
"+atts.getQName(i)
// +", qname: "+atts.getQName(i)+", value:
"+atts.getValue(i));
// Crimson won't let us set an xmlns: attribute on the DOM.
if ((null == attrNS) || (attrNS.length() == 0) ||
atts.getQName(i).startsWith("xmlns:"))
elem.setAttribute(atts.getQName(i), atts.getValue(i));
else
{
// elem.setAttributeNS(atts.getURI(i), atts.getLocalName(i),
atts.getValue(i));
elem.setAttributeNS(atts.getURI(i), atts.getQName(i),
atts.getValue(i));
}
}
}
m_elemStack.push(elem);
m_currentNode = elem;
}
/**
* Receive notification of the end of an element.
*
* <p>The SAX parser will invoke this method at the end of every
* element in the XML document; there will be a corresponding
* startElement() event for every endElement() event (even when the
* element is empty).</p>
*
* <p>If the element name has a namespace prefix, the prefix will
* still be attached to the name.</p>
*
*
* NEEDSDOC @param ns
* NEEDSDOC @param localName
* @param name The element type name
*/
public void endElement(String ns, String localName, String name)
throws org.xml.sax.SAXException
{
m_currentNode = m_elemStack.popAndTop();
}
/**
* Set an ID string to node association in the ID table.
*
* @param id The ID string.
* @param elem The associated ID.
*/
public void setIDAttribute(String id, Element elem)
{
// Do nothing. This method is meant to be overiden.
}
/**
* Receive notification of character data.
*
* <p>The Parser will call this method to report each chunk of
* character data. SAX parsers may return all contiguous character
* data in a single chunk, or they may split it into several
* chunks; however, all of the characters in any single event
* must come from the same external entity, so that the Locator
* provides useful information.</p>
*
* <p>The application must not attempt to read from the array
* outside of the specified range.</p>
*
* <p>Note that some parsers will report whitespace using the
* ignorableWhitespace() method rather than this one (validating
* parsers must do so).</p>
*
* @param ch The characters from the XML document.
* @param start The start position in the array.
* @param length The number of characters to read from the array.
* @see #ignorableWhitespace
* @see org.xml.sax.Locator
*/
public void characters(char ch[], int start, int length) throws
org.xml.sax.SAXException
{
if (m_inCData)
{
cdata(ch, start, length);
return;
}
String s = new String(ch, start, length);
Text text = m_doc.createTextNode(s);
append(text);
}
/**
* If available, when the disable-output-escaping attribute is used,
* output raw text without escaping. A PI will be inserted in front
* of the node with the name "lotusxsl-next-is-raw" and a value of
* "formatter-to-dom".
*
* NEEDSDOC @param ch
* NEEDSDOC @param start
* NEEDSDOC @param length
*/
public void charactersRaw(char ch[], int start, int length)
throws org.xml.sax.SAXException
{
String s = new String(ch, start, length);
append(m_doc.createProcessingInstruction("xslt-next-is-raw",
"formatter-to-dom"));
append(m_doc.createTextNode(s));
}
/**
* Report the beginning of an entity.
*
* The start and end of the document entity are not reported.
* The start and end of the external DTD subset are reported
* using the pseudo-name "[dtd]". All other events must be
* properly nested within start/end entity events.
*
* @param name The name of the entity. If it is a parameter
* entity, the name will begin with '%'.
* @see #endEntity
* @see org.xml.sax.misc.DeclHandler#internalEntityDecl
* @see org.xml.sax.misc.DeclHandler#externalEntityDecl
*/
public void startEntity(String name) throws org.xml.sax.SAXException
{
// Almost certainly the wrong behavior...
// entityReference(name);
}
/**
* Report the end of an entity.
*
* @param name The name of the entity that is ending.
* @see #startEntity
*/
public void endEntity(String name) throws org.xml.sax.SAXException{}
/**
* Receive notivication of a entityReference.
*
* NEEDSDOC @param name
*/
public void entityReference(String name) throws org.xml.sax.SAXException
{
append(m_doc.createEntityReference(name));
}
/**
* Receive notification of ignorable whitespace in element content.
*
* <p>Validating Parsers must use this method to report each chunk
* of ignorable whitespace (see the W3C XML 1.0 recommendation,
* section 2.10): non-validating parsers may also use this method
* if they are capable of parsing and using content models.</p>
*
* <p>SAX parsers may return all contiguous whitespace in a single
* chunk, or they may split it into several chunks; however, all of
* the characters in any single event must come from the same
* external entity, so that the Locator provides useful
* information.</p>
*
* <p>The application must not attempt to read from the array
* outside of the specified range.</p>
*
* @param ch The characters from the XML document.
* @param start The start position in the array.
* @param length The number of characters to read from the array.
* @see #characters
*/
public void ignorableWhitespace(char ch[], int start, int length)
throws org.xml.sax.SAXException
{
String s = new String(ch, start, length);
append(m_doc.createTextNode(s));
}
/**
* Receive notification of a processing instruction.
*
* <p>The Parser will invoke this method once for each processing
* instruction found: note that processing instructions may occur
* before or after the main document element.</p>
*
* <p>A SAX parser should never report an XML declaration (XML 1.0,
* section 2.8) or a text declaration (XML 1.0, section 4.3.1)
* using this method.</p>
*
* @param target The processing instruction target.
* @param data The processing instruction data, or null if
* none was supplied.
*/
public void processingInstruction(String target, String data)
throws org.xml.sax.SAXException
{
append(m_doc.createProcessingInstruction(target, data));
}
/**
* Report an XML comment anywhere in the document.
*
* This callback will be used for comments inside or outside the
* document element, including comments in the external DTD
* subset (if read).
*
* @param ch An array holding the characters in the comment.
* @param start The starting position in the array.
* @param length The number of characters to use from the array.
*/
public void comment(char ch[], int start, int length) throws
org.xml.sax.SAXException
{
append(m_doc.createComment(new String(ch, start, length)));
}
/** NEEDSDOC Field m_inCData */
protected boolean m_inCData = false;
/**
* Report the start of a CDATA section.
*
* @see #endCDATA
*/
public void startCDATA() throws org.xml.sax.SAXException
{
m_inCData = true;
}
/**
* Report the end of a CDATA section.
*
* @see #startCDATA
*/
public void endCDATA() throws org.xml.sax.SAXException
{
m_inCData = false;
}
/**
* Receive notification of cdata.
*
* <p>The Parser will call this method to report each chunk of
* character data. SAX parsers may return all contiguous character
* data in a single chunk, or they may split it into several
* chunks; however, all of the characters in any single event
* must come from the same external entity, so that the Locator
* provides useful information.</p>
*
* <p>The application must not attempt to read from the array
* outside of the specified range.</p>
*
* <p>Note that some parsers will report whitespace using the
* ignorableWhitespace() method rather than this one (validating
* parsers must do so).</p>
*
* @param ch The characters from the XML document.
* @param start The start position in the array.
* @param length The number of characters to read from the array.
* @see #ignorableWhitespace
* @see org.xml.sax.Locator
*/
public void cdata(char ch[], int start, int length) throws
org.xml.sax.SAXException
{
String s = new String(ch, start, length);
append(m_doc.createCDATASection(s));
}
/**
* Report the start of DTD declarations, if any.
*
* Any declarations are assumed to be in the internal subset
* unless otherwise indicated.
*
* @param name The document type name.
* @param publicId The declared public identifier for the
* external DTD subset, or null if none was declared.
* @param systemId The declared system identifier for the
* external DTD subset, or null if none was declared.
* @see #endDTD
* @see #startEntity
*/
public void startDTD(String name, String publicId, String systemId)
throws org.xml.sax.SAXException
{
// Do nothing for now.
}
/**
* Report the end of DTD declarations.
*
* @see #startDTD
*/
public void endDTD() throws org.xml.sax.SAXException
{
// Do nothing for now.
}
/**
* Begin the scope of a prefix-URI Namespace mapping.
*
* <p>The information from this event is not necessary for
* normal Namespace processing: the SAX XML reader will
* automatically replace prefixes for element and attribute
* names when the http://xml.org/sax/features/namespaces
* feature is true (the default).</p>
*
* <p>There are cases, however, when applications need to
* use prefixes in character data or in attribute values,
* where they cannot safely be expanded automatically; the
* start/endPrefixMapping event supplies the information
* to the application to expand prefixes in those contexts
* itself, if necessary.</p>
*
* <p>Note that start/endPrefixMapping events are not
* guaranteed to be properly nested relative to each-other:
* all startPrefixMapping events will occur before the
* corresponding startElement event, and all endPrefixMapping
* events will occur after the corresponding endElement event,
* but their order is not guaranteed.</p>
*
* @param prefix The Namespace prefix being declared.
* @param uri The Namespace URI the prefix is mapped to.
* @see #endPrefixMapping
* @see #startElement
*/
public void startPrefixMapping(String prefix, String uri)
throws org.xml.sax.SAXException
{
/*
// Not sure if this is needed or wanted
// Also, it fails in the stree.
if((null != m_currentNode)
&& (m_currentNode.getNodeType() == Node.ELEMENT_NODE))
{
String qname;
if(((null != prefix) && (prefix.length() == 0))
|| (null == prefix))
qname = "xmlns";
else
qname = "xmlns:"+prefix;
Element elem = (Element)m_currentNode;
String val = elem.getAttribute(qname);
if(val == null)
{
elem.setAttributeNS("http://www.w3.org/XML/1998/namespace",
qname, uri);
}
}
*/
}
/**
* End the scope of a prefix-URI mapping.
*
* <p>See startPrefixMapping for details. This event will
* always occur after the corresponding endElement event,
* but the order of endPrefixMapping events is not otherwise
* guaranteed.</p>
*
* @param prefix The prefix that was being mapping.
* @see #startPrefixMapping
* @see #endElement
*/
public void endPrefixMapping(String prefix) throws
org.xml.sax.SAXException{}
/**
* Receive notification of a skipped entity.
*
* <p>The Parser will invoke this method once for each entity
* skipped. Non-validating processors may skip entities if they
* have not seen the declarations (because, for example, the
* entity was declared in an external DTD subset). All processors
* may skip external entities, depending on the values of the
* http://xml.org/sax/features/external-general-entities and the
* http://xml.org/sax/features/external-parameter-entities
* properties.</p>
*
* @param name The name of the skipped entity. If it is a
* parameter entity, the name will begin with '%'.
*/
public void skippedEntity(String name) throws org.xml.sax.SAXException{}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/DefaultErrorHandler.java
Index: DefaultErrorHandler.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import org.xml.sax.*;
import javax.xml.transform.ErrorListener;
import javax.xml.transform.TransformerException;
import javax.xml.transform.SourceLocator;
/**
* <meta name="usage" content="general"/>
* Implement SAX error handler for default reporting.
*/
public class DefaultErrorHandler implements ErrorHandler, ErrorListener
{
/**
* Constructor DefaultErrorHandler
*/
public DefaultErrorHandler()
{
}
/**
* Receive notification of a warning.
*
* <p>SAX parsers will use this method to report conditions that
* are not errors or fatal errors as defined by the XML 1.0
* recommendation. The default behaviour is to take no action.</p>
*
* <p>The SAX parser must continue to provide normal parsing events
* after invoking this method: it should still be possible for the
* application to process the document through to the end.</p>
*
* @param exception The warning information encapsulated in a
* SAX parse exception.
* @exception javax.xml.transform.TransformerException Any SAX exception,
possibly
* wrapping another exception.
* @see javax.xml.transform.TransformerException
*
* @throws TransformerException
*/
public void warning(SAXParseException exception) throws SAXException
{
printLocation(exception);
System.out.println("Parser warning: " + exception.getMessage());
}
/**
* Receive notification of a recoverable error.
*
* <p>This corresponds to the definition of "error" in section 1.2
* of the W3C XML 1.0 Recommendation. For example, a validating
* parser would use this callback to report the violation of a
* validity constraint. The default behaviour is to take no
* action.</p>
*
* <p>The SAX parser must continue to provide normal parsing events
* after invoking this method: it should still be possible for the
* application to process the document through to the end. If the
* application cannot do so, then the parser should report a fatal
* error even if the XML 1.0 recommendation does not require it to
* do so.</p>
*
* @param exception The error information encapsulated in a
* SAX parse exception.
* @exception javax.xml.transform.TransformerException Any SAX exception,
possibly
* wrapping another exception.
* @see javax.xml.transform.TransformerException
*
* @throws TransformerException
*/
public void error(SAXParseException exception) throws SAXException
{
printLocation(exception);
System.out.println("Parser error: " + exception.getMessage());
}
/**
* Receive notification of a non-recoverable error.
*
* <p>This corresponds to the definition of "fatal error" in
* section 1.2 of the W3C XML 1.0 Recommendation. For example, a
* parser would use this callback to report the violation of a
* well-formedness constraint.</p>
*
* <p>The application must assume that the document is unusable
* after the parser has invoked this method, and should continue
* (if at all) only for the sake of collecting addition error
* messages: in fact, SAX parsers are free to stop reporting any
* other events once this method has been invoked.</p>
*
* @param exception The error information encapsulated in a
* SAX parse exception.
* @exception javax.xml.transform.TransformerException Any SAX exception,
possibly
* wrapping another exception.
* @see javax.xml.transform.TransformerException
*
* @throws TransformerException
*/
public void fatalError(SAXParseException exception) throws SAXException
{
printLocation(exception);
throw exception;
}
/**
* Receive notification of a warning.
*
* <p>SAX parsers will use this method to report conditions that
* are not errors or fatal errors as defined by the XML 1.0
* recommendation. The default behaviour is to take no action.</p>
*
* <p>The SAX parser must continue to provide normal parsing events
* after invoking this method: it should still be possible for the
* application to process the document through to the end.</p>
*
* @param exception The warning information encapsulated in a
* SAX parse exception.
* @exception javax.xml.transform.TransformerException Any SAX exception,
possibly
* wrapping another exception.
* @see javax.xml.transform.TransformerException
*
* @throws TransformerException
*/
public void warning(TransformerException exception) throws
TransformerException
{
printLocation(exception);
System.out.println(exception.getMessage());
}
/**
* Receive notification of a recoverable error.
*
* <p>This corresponds to the definition of "error" in section 1.2
* of the W3C XML 1.0 Recommendation. For example, a validating
* parser would use this callback to report the violation of a
* validity constraint. The default behaviour is to take no
* action.</p>
*
* <p>The SAX parser must continue to provide normal parsing events
* after invoking this method: it should still be possible for the
* application to process the document through to the end. If the
* application cannot do so, then the parser should report a fatal
* error even if the XML 1.0 recommendation does not require it to
* do so.</p>
*
* @param exception The error information encapsulated in a
* SAX parse exception.
* @exception javax.xml.transform.TransformerException Any SAX exception,
possibly
* wrapping another exception.
* @see javax.xml.transform.TransformerException
*
* @throws TransformerException
*/
public void error(TransformerException exception) throws
TransformerException
{
printLocation(exception);
System.out.println("Parser error: " + exception.getMessage());
}
/**
* Receive notification of a non-recoverable error.
*
* <p>This corresponds to the definition of "fatal error" in
* section 1.2 of the W3C XML 1.0 Recommendation. For example, a
* parser would use this callback to report the violation of a
* well-formedness constraint.</p>
*
* <p>The application must assume that the document is unusable
* after the parser has invoked this method, and should continue
* (if at all) only for the sake of collecting addition error
* messages: in fact, SAX parsers are free to stop reporting any
* other events once this method has been invoked.</p>
*
* @param exception The error information encapsulated in a
* SAX parse exception.
* @exception javax.xml.transform.TransformerException Any SAX exception,
possibly
* wrapping another exception.
* @see javax.xml.transform.TransformerException
*
* @throws TransformerException
*/
public void fatalError(TransformerException exception) throws
TransformerException
{
printLocation(exception);
throw exception;
}
private void printLocation(org.xml.sax.SAXParseException exception)
{
// System.out.println("Parser fatal error: "+exception.getMessage());
String id = (null != exception.getSystemId())
? exception.getSystemId() : "SystemId Unknown";
System.out.println(id + "; Line " + exception.getLineNumber()
+ "; Column " + exception.getColumnNumber());
}
private void printLocation(TransformerException exception)
{
SourceLocator locator = exception.getLocator();
if(null != locator)
{
// System.out.println("Parser fatal error: "+exception.getMessage());
String id = (locator.getPublicId() != locator.getPublicId())
? locator.getPublicId()
: (null != locator.getSystemId())
? locator.getSystemId() : "SystemId Unknown";
System.out.println(id + "; Line " + locator.getLineNumber()
+ "; Column " + locator.getColumnNumber());
}
}
}
1.1 xml-xalan/java/src/org/apache/xml/utils/ElemDesc.java
Index: ElemDesc.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import java.util.Hashtable;
/**
* <meta name="usage" content="internal"/>
* This class is in support of FormatterToHTML, and acts as a sort
* of element representative for HTML elements.
*/
class ElemDesc
{
/** NEEDSDOC Field m_flags */
int m_flags;
/** NEEDSDOC Field m_attrs */
Hashtable m_attrs = null;
/** NEEDSDOC Field EMPTY */
static final int EMPTY = (1 << 1);
/** NEEDSDOC Field FLOW */
static final int FLOW = (1 << 2);
/** NEEDSDOC Field BLOCK */
static final int BLOCK = (1 << 3);
/** NEEDSDOC Field BLOCKFORM */
static final int BLOCKFORM = (1 << 4);
/** NEEDSDOC Field BLOCKFORMFIELDSET */
static final int BLOCKFORMFIELDSET = (1 << 5);
/** NEEDSDOC Field CDATA */
static final int CDATA = (1 << 6);
/** NEEDSDOC Field PCDATA */
static final int PCDATA = (1 << 7);
/** NEEDSDOC Field RAW */
static final int RAW = (1 << 8);
/** NEEDSDOC Field INLINE */
static final int INLINE = (1 << 9);
/** NEEDSDOC Field INLINEA */
static final int INLINEA = (1 << 10);
/** NEEDSDOC Field INLINELABEL */
static final int INLINELABEL = (1 << 11);
/** NEEDSDOC Field FONTSTYLE */
static final int FONTSTYLE = (1 << 12);
/** NEEDSDOC Field PHRASE */
static final int PHRASE = (1 << 13);
/** NEEDSDOC Field FORMCTRL */
static final int FORMCTRL = (1 << 14);
/** NEEDSDOC Field SPECIAL */
static final int SPECIAL = (1 << 15);
/** NEEDSDOC Field ASPECIAL */
static final int ASPECIAL = (1 << 16);
/** NEEDSDOC Field HEADMISC */
static final int HEADMISC = (1 << 17);
/** NEEDSDOC Field HEAD */
static final int HEAD = (1 << 18);
/** NEEDSDOC Field LIST */
static final int LIST = (1 << 19);
/** NEEDSDOC Field PREFORMATTED */
static final int PREFORMATTED = (1 << 20);
/** NEEDSDOC Field WHITESPACESENSITIVE */
static final int WHITESPACESENSITIVE = (1 << 21);
/** NEEDSDOC Field ATTRURL */
static final int ATTRURL = (1 << 1);
/** NEEDSDOC Field ATTREMPTY */
static final int ATTREMPTY = (1 << 2);
/**
* Constructor ElemDesc
*
*
* NEEDSDOC @param flags
*/
ElemDesc(int flags)
{
m_flags = flags;
}
/**
* NEEDSDOC Method is
*
*
* NEEDSDOC @param flags
*
* NEEDSDOC (is) @return
*/
boolean is(int flags)
{
// int which = (m_flags & flags);
return (m_flags & flags) != 0;
}
/**
* NEEDSDOC Method setAttr
*
*
* NEEDSDOC @param name
* NEEDSDOC @param flags
*/
void setAttr(String name, int flags)
{
if (null == m_attrs)
m_attrs = new Hashtable();
m_attrs.put(name, new Integer(flags));
}
/**
* NEEDSDOC Method isAttrFlagSet
*
*
* NEEDSDOC @param name
* NEEDSDOC @param flags
*
* NEEDSDOC (isAttrFlagSet) @return
*/
boolean isAttrFlagSet(String name, int flags)
{
if (null != m_attrs)
{
Integer _flags = (Integer) m_attrs.get(name);
if (null != _flags)
{
return (_flags.intValue() & flags) != 0;
}
}
return false;
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/FastStringBuffer.java
Index: FastStringBuffer.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* Bare-bones, unsafe, fast string buffer.
*/
public class FastStringBuffer
{
/** NEEDSDOC Field m_blocksize */
public int m_blocksize;
/** NEEDSDOC Field m_map[] */
public char m_map[]; // don't hold on to a reference!
/** NEEDSDOC Field m_firstFree */
public int m_firstFree = 0;
/** NEEDSDOC Field m_mapSize */
public int m_mapSize;
/**
* Construct a IntVector, using the given block size.
*/
public FastStringBuffer()
{
m_blocksize = 1024;
m_mapSize = 1024;
m_map = new char[1024];
}
/**
* Construct a IntVector, using the given block size.
*
* NEEDSDOC @param blocksize
*/
public FastStringBuffer(int blocksize)
{
m_blocksize = blocksize;
m_mapSize = blocksize;
m_map = new char[blocksize];
}
/**
* Get the length of the list.
*
* NEEDSDOC ($objectName$) @return
*/
public final int size()
{
return m_firstFree;
}
/**
* NEEDSDOC Method length
*
*
* NEEDSDOC (length) @return
*/
public final int length()
{
return m_firstFree;
}
/**
* NEEDSDOC Method reset
*
*/
public final void reset()
{
m_firstFree = 0;
}
/**
* NEEDSDOC Method setLength
*
*
* NEEDSDOC @param l
*/
public final void setLength(int l)
{
m_firstFree = l;
}
/**
* NEEDSDOC Method toString
*
*
* NEEDSDOC (toString) @return
*/
public final String toString()
{
return new String(m_map, 0, m_firstFree);
}
/**
* NEEDSDOC Method ensureSize
*
*
* NEEDSDOC @param newSize
*/
private final void ensureSize(int newSize)
{
if ((m_firstFree + newSize) >= m_mapSize)
{
if (m_blocksize > newSize)
m_mapSize += m_blocksize;
else
m_mapSize += (newSize + m_blocksize);
char newMap[] = new char[m_mapSize];
System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
m_map = newMap;
}
}
/**
* Append a int onto the vector.
*
* NEEDSDOC @param value
*/
public final void append(char value)
{
ensureSize(1);
m_map[m_firstFree] = value;
m_firstFree++;
}
/**
* Append a int onto the vector.
*
* NEEDSDOC @param value
*/
public final void append(String value)
{
int len = value.length();
ensureSize(len);
value.getChars(0, len, m_map, m_firstFree);
m_firstFree += len;
}
/**
* Append a int onto the vector.
*
* NEEDSDOC @param value
*/
public final void append(StringBuffer value)
{
int len = value.length();
ensureSize(len);
value.getChars(0, len, m_map, m_firstFree);
m_firstFree += len;
}
/**
* NEEDSDOC Method append
*
*
* NEEDSDOC @param chars
* NEEDSDOC @param start
* NEEDSDOC @param length
*/
public final void append(char[] chars, int start, int length)
{
ensureSize(length);
System.arraycopy(chars, start, m_map, m_firstFree, length);
m_firstFree += length;
}
/**
* NEEDSDOC Method append
*
*
* NEEDSDOC @param value
*/
public final void append(FastStringBuffer value)
{
int length = value.m_firstFree;
ensureSize(length);
System.arraycopy(value.m_map, 0, m_map, m_firstFree, length);
m_firstFree += length;
}
}
1.1 xml-xalan/java/src/org/apache/xml/utils/Heap.java
Index: Heap.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import java.util.Vector;
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class Heap <needs-comment/>
*/
public class Heap extends Vector
{
/** NEEDSDOC Field m_a[] */
private HeapObject m_a[] = new HeapObject[50];
/** NEEDSDOC Field m_n */
private int m_n;
/**
* Constructor Heap
*
*/
public Heap(){}
/**
* NEEDSDOC Method insert
*
*
* NEEDSDOC @param obj
*/
public void insert(HeapObject obj)
{
m_n++;
m_a[m_n] = obj;
upheap(m_n);
}
/**
* NEEDSDOC Method upheap
*
*
* NEEDSDOC @param k
*/
private void upheap(int k)
{
HeapObject v = m_a[k];
m_a[0] = m_sentinel;
while (m_a[k / 2].getHeapValue() < v.getHeapValue())
{
m_a[k] = m_a[k / 2];
k = k / 2;
}
m_a[k] = v;
}
/**
* NEEDSDOC Method remove
*
*
* NEEDSDOC (remove) @return
*/
public HeapObject remove()
{
HeapObject v = m_a[1];
m_a[1] = m_a[m_n--];
downheap(1);
return v;
}
/**
* NEEDSDOC Method downheap
*
*
* NEEDSDOC @param k
*/
private void downheap(int k)
{
HeapObject v = m_a[k];
while (k <= m_n / 2)
{
int j = k + k;
if (j < m_n && m_a[j].getHeapValue() < m_a[j + 1].getHeapValue())
j++;
if (v.getHeapValue() >= m_a[j].getHeapValue())
break;
m_a[k] = m_a[j];
k = j;
}
m_a[k] = v;
}
/**
* NEEDSDOC Method replace
*
*
* NEEDSDOC @param v
*
* NEEDSDOC (replace) @return
*/
HeapObject replace(HeapObject v)
{
m_a[0] = v;
downheap(0);
return m_a[0];
}
/**
* NEEDSDOC Method change
*
*/
void change(){}
/**
* NEEDSDOC Method delete
*
*/
void delete(){}
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class Sentinel <needs-comment/>
*/
class Sentinel implements HeapObject
{
/**
* NEEDSDOC Method getHeapValue
*
*
* NEEDSDOC (getHeapValue) @return
*/
public int getHeapValue()
{
return Short.MAX_VALUE;
}
}
/** NEEDSDOC Field m_sentinel */
final Sentinel m_sentinel = new Sentinel();
}
1.1 xml-xalan/java/src/org/apache/xml/utils/HeapObject.java
Index: HeapObject.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Interface HeapObject
*/
public interface HeapObject
{
/**
* NEEDSDOC Method getHeapValue
*
*
* NEEDSDOC (getHeapValue) @return
*/
int getHeapValue();
}
1.1 xml-xalan/java/src/org/apache/xml/utils/IntStack.java
Index: IntStack.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import java.util.EmptyStackException;
/**
* <meta name="usage" content="internal"/>
* Implement an array of simple integers.
*/
public class IntStack extends IntVector
{
/**
* Default constructor. Note that the default
* block size is very small, for small lists.
*/
public IntStack()
{
super();
}
/**
* Construct a IntVector, using the given block size.
*
* NEEDSDOC @param blocksize
*/
public IntStack(int blocksize)
{
super(blocksize);
}
/**
* Pushes an item onto the top of this stack.
*
* @param i the int to be pushed onto this stack.
* @return the <code>item</code> argument.
*/
public int push(int i)
{
if ((m_firstFree + 1) >= m_mapSize)
{
m_mapSize += m_blocksize;
int newMap[] = new int[m_mapSize];
System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
m_map = newMap;
}
m_map[m_firstFree] = i;
m_firstFree++;
return i;
}
/**
* Removes the object at the top of this stack and returns that
* object as the value of this function.
*
* @return The object at the top of this stack.
*/
public int pop()
{
return m_map[--m_firstFree];
}
/**
* Quickly pops a number of items from the stack.
*/
public void quickPop(int n)
{
m_firstFree -= n;
}
/**
* Looks at the object at the top of this stack without removing it
* from the stack.
*
* @return the object at the top of this stack.
* @exception EmptyStackException if this stack is empty.
*/
public int peek()
{
return m_map[m_firstFree - 1];
}
/**
* Sets an object at a the top of the statck
*
*
* NEEDSDOC @param val
* @exception EmptyStackException if this stack is empty.
*/
public void setTop(int val)
{
m_map[m_firstFree - 1] = val;
}
/**
* Tests if this stack is empty.
*
* @return <code>true</code> if this stack is empty;
* <code>false</code> otherwise.
* @since JDK1.0
*/
public boolean empty()
{
return m_firstFree == 0;
}
/**
* Returns where an object is on this stack.
*
* @param o the desired object.
* @return the distance from the top of the stack where the object is]
* located; the return value <code>-1</code> indicates that the
* object is not on the stack.
* @since JDK1.0
*/
public int search(int o)
{
int i = lastIndexOf(o);
if (i >= 0)
{
return size() - i;
}
return -1;
}
}
1.1 xml-xalan/java/src/org/apache/xml/utils/IntVector.java
Index: IntVector.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* <meta name="usage" content="internal"/>
* A very simple table that stores a list of int.
*/
public class IntVector
{
/** NEEDSDOC Field m_blocksize */
protected int m_blocksize;
/** NEEDSDOC Field m_map[] */
public int m_map[]; // expose to package for direct access.
/** NEEDSDOC Field m_firstFree */
protected int m_firstFree = 0;
/** NEEDSDOC Field m_mapSize */
protected int m_mapSize;
/**
* Default constructor. Note that the default
* block size is very small, for small lists.
*/
public IntVector()
{
m_blocksize = 32;
m_mapSize = m_blocksize;
m_map = new int[m_blocksize];
}
/**
* Construct a IntVector, using the given block size.
*
* NEEDSDOC @param blocksize
*/
public IntVector(int blocksize)
{
m_blocksize = blocksize;
m_mapSize = blocksize;
m_map = new int[blocksize];
}
/**
* Get the length of the list.
*
* NEEDSDOC ($objectName$) @return
*/
public final int size()
{
return m_firstFree;
}
/**
* Append a int onto the vector.
*
* NEEDSDOC @param value
*/
public final void addElement(int value)
{
if ((m_firstFree + 1) >= m_mapSize)
{
m_mapSize += m_blocksize;
int newMap[] = new int[m_mapSize];
System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
m_map = newMap;
}
m_map[m_firstFree] = value;
m_firstFree++;
}
/**
* Inserts the specified node in this vector at the specified index.
* Each component in this vector with an index greater or equal to
* the specified index is shifted upward to have an index one greater
* than the value it had previously.
*
* NEEDSDOC @param value
* NEEDSDOC @param at
*/
public final void insertElementAt(int value, int at)
{
if ((m_firstFree + 1) >= m_mapSize)
{
m_mapSize += m_blocksize;
int newMap[] = new int[m_mapSize];
System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
m_map = newMap;
}
if (at <= (m_firstFree - 1))
{
System.arraycopy(m_map, at, m_map, at + 1, m_firstFree - at);
}
m_map[at] = value;
m_firstFree++;
}
/**
* Inserts the specified node in this vector at the specified index.
* Each component in this vector with an index greater or equal to
* the specified index is shifted upward to have an index one greater
* than the value it had previously.
*/
public final void removeAllElements()
{
for (int i = 0; i < m_firstFree; i++)
{
m_map[i] = java.lang.Integer.MIN_VALUE;
}
m_firstFree = 0;
}
/**
* Removes the first occurrence of the argument from this vector.
* If the object is found in this vector, each component in the vector
* with an index greater or equal to the object's index is shifted
* downward to have an index one smaller than the value it had
* previously.
*
* NEEDSDOC @param s
*
* NEEDSDOC ($objectName$) @return
*/
public final boolean removeElement(int s)
{
for (int i = 0; i < m_firstFree; i++)
{
if (m_map[i] == s)
{
if ((i + 1) < m_firstFree)
System.arraycopy(m_map, i + 1, m_map, i - 1, m_firstFree - i);
else
m_map[i] = java.lang.Integer.MIN_VALUE;
m_firstFree--;
return true;
}
}
return false;
}
/**
* Deletes the component at the specified index. Each component in
* this vector with an index greater or equal to the specified
* index is shifted downward to have an index one smaller than
* the value it had previously.
*
* NEEDSDOC @param i
*/
public final void removeElementAt(int i)
{
if (i > m_firstFree)
System.arraycopy(m_map, i + 1, m_map, i, m_firstFree);
else
m_map[i] = java.lang.Integer.MIN_VALUE;
m_firstFree--;
}
/**
* Sets the component at the specified index of this vector to be the
* specified object. The previous component at that position is discarded.
*
* The index must be a value greater than or equal to 0 and less
* than the current size of the vector.
*
* NEEDSDOC @param node
* NEEDSDOC @param index
*/
public final void setElementAt(int node, int index)
{
m_map[index] = node;
}
/**
* Get the nth element.
*
* NEEDSDOC @param i
*
* NEEDSDOC ($objectName$) @return
*/
public final int elementAt(int i)
{
return m_map[i];
}
/**
* Tell if the table contains the given node.
*
* NEEDSDOC @param s
*
* NEEDSDOC ($objectName$) @return
*/
public final boolean contains(int s)
{
for (int i = 0; i < m_firstFree; i++)
{
if (m_map[i] == s)
return true;
}
return false;
}
/**
* Searches for the first occurence of the given argument,
* beginning the search at index, and testing for equality
* using the equals method.
*
* NEEDSDOC @param elem
* NEEDSDOC @param index
* @return the index of the first occurrence of the object
* argument in this vector at position index or later in the
* vector; returns -1 if the object is not found.
*/
public final int indexOf(int elem, int index)
{
for (int i = index; i < m_firstFree; i++)
{
if (m_map[i] == elem)
return i;
}
return java.lang.Integer.MIN_VALUE;
}
/**
* Searches for the first occurence of the given argument,
* beginning the search at index, and testing for equality
* using the equals method.
*
* NEEDSDOC @param elem
* @return the index of the first occurrence of the object
* argument in this vector at position index or later in the
* vector; returns -1 if the object is not found.
*/
public final int indexOf(int elem)
{
for (int i = 0; i < m_firstFree; i++)
{
if (m_map[i] == elem)
return i;
}
return java.lang.Integer.MIN_VALUE;
}
/**
* Searches for the first occurence of the given argument,
* beginning the search at index, and testing for equality
* using the equals method.
*
* NEEDSDOC @param elem
* @return the index of the first occurrence of the object
* argument in this vector at position index or later in the
* vector; returns -1 if the object is not found.
*/
public final int lastIndexOf(int elem)
{
for (int i = (m_firstFree - 1); i >= 0; i--)
{
if (m_map[i] == elem)
return i;
}
return java.lang.Integer.MIN_VALUE;
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/MutableAttrListImpl.java
Index: MutableAttrListImpl.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import org.apache.xml.utils.StringVector;
import org.xml.sax.Attributes;
import java.io.Serializable;
import org.xml.sax.helpers.AttributesImpl;
/**
* <meta name="usage" content="advanced"/>
* Mutable version of AttributesImpl.
*/
public class MutableAttrListImpl extends AttributesImpl
implements Serializable
{
/**
* Construct a new, empty AttributesImpl object.
*/
public MutableAttrListImpl()
{
super();
}
/**
* Copy an existing Attributes object.
*
* <p>This constructor is especially useful inside a start
* element event.</p>
*
* @param atts The existing Attributes object.
*/
public MutableAttrListImpl(Attributes atts)
{
super(atts);
}
/**
* Add an attribute to the end of the list.
*
* <p>For the sake of speed, this method does no checking
* to see if the attribute is already in the list: that is
* the responsibility of the application.</p>
*
* @param uri The Namespace URI, or the empty string if
* none is available or Namespace processing is not
* being performed.
* @param localName The local name, or the empty string if
* Namespace processing is not being performed.
* @param qName The qualified (prefixed) name, or the empty string
* if qualified names are not available.
* @param type The attribute type as a string.
* @param value The attribute value.
*/
public void addAttribute(String uri, String localName, String qName,
String type, String value)
{
if (null == uri)
uri = "";
int index = this.getIndex(uri, localName);
if (index >= 0)
this.setAttribute(index, uri, localName, qName, type, value);
else
super.addAttribute(uri, localName, qName, type, value);
}
/**
* Add the contents of the attribute list to this list.
*
* NEEDSDOC @param atts
*/
public void addAttributes(Attributes atts)
{
int nAtts = atts.getLength();
for (int i = 0; i < nAtts; i++)
{
String uri = atts.getURI(i);
if (null == uri)
uri = "";
String localName = atts.getLocalName(i);
String qname = atts.getQName(i);
int index = this.getIndex(uri, localName);
if (index >= 0)
this.setAttribute(index, uri, localName, qname, atts.getType(i),
atts.getValue(i));
else
addAttribute(uri, localName, qname, atts.getType(i),
atts.getValue(i));
}
}
/**
* Return true if list contains the given (raw) attribute name.
*
* NEEDSDOC @param name
*
* NEEDSDOC ($objectName$) @return
*/
public boolean contains(String name)
{
return getValue(name) != null;
}
}
// end of MutableAttrListImpl.java
1.1 xml-xalan/java/src/org/apache/xml/utils/NSInfo.java
Index: NSInfo.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* <meta name="usage" content="internal"/>
* This class holds information about the namespace info
* of a node. It is used to optimize namespace lookup in
* a generic DOM.
*/
public class NSInfo
{
/**
* Constructor NSInfo
*
*
* NEEDSDOC @param hasProcessedNS
* NEEDSDOC @param hasXMLNSAttrs
*/
public NSInfo(boolean hasProcessedNS, boolean hasXMLNSAttrs)
{
m_hasProcessedNS = hasProcessedNS;
m_hasXMLNSAttrs = hasXMLNSAttrs;
m_namespace = null;
m_ancestorHasXMLNSAttrs = ANCESTORXMLNSUNPROCESSED;
}
// Unused at the moment
/**
* Constructor NSInfo
*
*
* NEEDSDOC @param hasProcessedNS
* NEEDSDOC @param hasXMLNSAttrs
* NEEDSDOC @param ancestorHasXMLNSAttrs
*/
public NSInfo(boolean hasProcessedNS, boolean hasXMLNSAttrs,
int ancestorHasXMLNSAttrs)
{
m_hasProcessedNS = hasProcessedNS;
m_hasXMLNSAttrs = hasXMLNSAttrs;
m_ancestorHasXMLNSAttrs = ancestorHasXMLNSAttrs;
m_namespace = null;
}
/**
* Constructor NSInfo
*
*
* NEEDSDOC @param namespace
* NEEDSDOC @param hasXMLNSAttrs
*/
public NSInfo(String namespace, boolean hasXMLNSAttrs)
{
m_hasProcessedNS = true;
m_hasXMLNSAttrs = hasXMLNSAttrs;
m_namespace = namespace;
m_ancestorHasXMLNSAttrs = ANCESTORXMLNSUNPROCESSED;
}
/** NEEDSDOC Field m_namespace */
public String m_namespace;
/** NEEDSDOC Field m_hasXMLNSAttrs */
public boolean m_hasXMLNSAttrs;
/** NEEDSDOC Field m_hasProcessedNS */
public boolean m_hasProcessedNS;
/** NEEDSDOC Field m_ancestorHasXMLNSAttrs */
public int m_ancestorHasXMLNSAttrs;
/** NEEDSDOC Field ANCESTORXMLNSUNPROCESSED */
public static final int ANCESTORXMLNSUNPROCESSED = 0;
/** NEEDSDOC Field ANCESTORHASXMLNS */
public static final int ANCESTORHASXMLNS = 1;
/** NEEDSDOC Field ANCESTORNOXMLNS */
public static final int ANCESTORNOXMLNS = 2;
}
1.1 xml-xalan/java/src/org/apache/xml/utils/NameSpace.java
Index: NameSpace.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import java.io.Serializable;
/**
* <meta name="usage" content="advanced"/>
* A representation of a namespace. One of these will
* be pushed on the namespace stack for each
* element.
*/
public class NameSpace implements Serializable
{
/** NEEDSDOC Field m_next */
public NameSpace m_next = null;
/** NEEDSDOC Field m_prefix */
public String m_prefix;
/** NEEDSDOC Field m_uri */
public String m_uri; // if null, then Element namespace is empty.
/**
* Construct a namespace for placement on the
* result tree namespace stack.
*
* NEEDSDOC @param prefix
* NEEDSDOC @param uri
*/
public NameSpace(String prefix, String uri)
{
m_prefix = prefix;
m_uri = uri;
}
}
1.1 xml-xalan/java/src/org/apache/xml/utils/NodeConsumer.java
Index: NodeConsumer.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import org.w3c.dom.Node;
/**
* The tree walker will test for this interface, and call
* setOriginatingNode before calling the SAX event. For creating
* DOM backpointers for things that are normally created via
* SAX events.
*/
public interface NodeConsumer
{
/**
* Set the node that is originating the SAX event.
*
* @param n Reference to node that originated the current event.
*/
public void setOriginatingNode(Node n);
}
1.1 xml-xalan/java/src/org/apache/xml/utils/NodeVector.java
Index: NodeVector.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import java.io.Serializable;
import org.w3c.dom.Node;
/**
* <meta name="usage" content="internal"/>
* A very simple table that stores a list of Nodes.
*/
public class NodeVector implements Serializable, Cloneable
{
/** NEEDSDOC Field m_blocksize */
private int m_blocksize;
/** NEEDSDOC Field m_map[] */
private Node m_map[];
/** NEEDSDOC Field m_firstFree */
protected int m_firstFree = 0;
/** NEEDSDOC Field m_mapSize */
private int m_mapSize; // lazy initialization
/**
* Default constructor.
*/
public NodeVector()
{
m_blocksize = 32;
m_mapSize = 0;
}
/**
* Construct a NodeVector, using the given block size.
*
* NEEDSDOC @param blocksize
*/
public NodeVector(int blocksize)
{
m_blocksize = blocksize;
m_mapSize = 0;
}
/**
* Get a cloned LocPathIterator.
*
* NEEDSDOC ($objectName$) @return
*
* @throws CloneNotSupportedException
*/
public Object clone() throws CloneNotSupportedException
{
NodeVector clone = (NodeVector) super.clone();
if ((null != this.m_map) && (this.m_map == clone.m_map))
{
clone.m_map = new Node[this.m_map.length];
System.arraycopy(this.m_map, 0, clone.m_map, 0, this.m_map.length);
}
return clone;
}
/**
* Get the length of the list.
*
* NEEDSDOC ($objectName$) @return
*/
public int size()
{
return m_firstFree;
}
/**
* Append a Node onto the vector.
*
* NEEDSDOC @param value
*/
public void addElement(Node value)
{
if ((m_firstFree + 1) >= m_mapSize)
{
if (null == m_map)
{
m_map = new Node[m_blocksize];
m_mapSize = m_blocksize;
}
else
{
m_mapSize += m_blocksize;
Node newMap[] = new Node[m_mapSize];
System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
m_map = newMap;
}
}
m_map[m_firstFree] = value;
m_firstFree++;
}
/**
* Append a Node onto the vector.
*
* NEEDSDOC @param value
*/
public final void push(Node value)
{
int ff = m_firstFree;
if ((ff + 1) >= m_mapSize)
{
if (null == m_map)
{
m_map = new Node[m_blocksize];
m_mapSize = m_blocksize;
}
else
{
m_mapSize += m_blocksize;
Node newMap[] = new Node[m_mapSize];
System.arraycopy(m_map, 0, newMap, 0, ff + 1);
m_map = newMap;
}
}
m_map[ff] = value;
ff++;
m_firstFree = ff;
}
/**
* Pop a node from the tail of the vector and return the result.
*
* NEEDSDOC ($objectName$) @return
*/
public final Node pop()
{
m_firstFree--;
Node n = m_map[m_firstFree];
m_map[m_firstFree] = null;
return n;
}
/**
* Pop a node from the tail of the vector and return the
* top of the stack after the pop.
*
* NEEDSDOC ($objectName$) @return
*/
public final Node popAndTop()
{
m_firstFree--;
m_map[m_firstFree] = null;
return (m_firstFree == 0) ? null : m_map[m_firstFree - 1];
}
/**
* Pop a node from the tail of the vector.
*/
public final void popQuick()
{
m_firstFree--;
m_map[m_firstFree] = null;
}
/**
* Special purpose method for TransformerImpl, pushElemTemplateElement.
* Performance critical.
*
* NEEDSDOC ($objectName$) @return
*/
public final Node peepOrNull()
{
return ((null != m_map) && (m_firstFree > 0))
? m_map[m_firstFree - 1] : null;
}
/**
* Special purpose method for TransformerImpl, pushElemTemplateElement.
* Performance critical.
*
* NEEDSDOC @param v1
* NEEDSDOC @param v2
*/
public final void pushPair(Node v1, Node v2)
{
if (null == m_map)
{
m_map = new Node[m_blocksize];
m_mapSize = m_blocksize;
}
else
{
if ((m_firstFree + 2) >= m_mapSize)
{
m_mapSize += m_blocksize;
Node newMap[] = new Node[m_mapSize];
System.arraycopy(m_map, 0, newMap, 0, m_firstFree);
m_map = newMap;
}
}
m_map[m_firstFree] = v1;
m_map[m_firstFree + 1] = v2;
m_firstFree += 2;
}
/**
* Special purpose method for TransformerImpl, pushElemTemplateElement.
* Performance critical.
*/
public final void popPair()
{
m_firstFree -= 2;
m_map[m_firstFree] = null;
m_map[m_firstFree + 1] = null;
}
/**
* Special purpose method for TransformerImpl, pushElemTemplateElement.
* Performance critical.
*
* NEEDSDOC @param n
*/
public final void setTail(Node n)
{
m_map[m_firstFree - 1] = n;
}
/**
* Special purpose method for TransformerImpl, pushElemTemplateElement.
* Performance critical.
*
* NEEDSDOC @param n
*/
public final void setTailSub1(Node n)
{
m_map[m_firstFree - 2] = n;
}
/**
* Special purpose method for TransformerImpl, pushElemTemplateElement.
* Performance critical.
*
* NEEDSDOC ($objectName$) @return
*/
public final Node peepTail()
{
return m_map[m_firstFree - 1];
}
/**
* Special purpose method for TransformerImpl, pushElemTemplateElement.
* Performance critical.
*
* NEEDSDOC ($objectName$) @return
*/
public final Node peepTailSub1()
{
return m_map[m_firstFree - 2];
}
/**
* Inserts the specified node in this vector at the specified index.
* Each component in this vector with an index greater or equal to
* the specified index is shifted upward to have an index one greater
* than the value it had previously.
*
* NEEDSDOC @param value
* NEEDSDOC @param at
*/
public void insertElementAt(Node value, int at)
{
if (null == m_map)
{
m_map = new Node[m_blocksize];
m_mapSize = m_blocksize;
}
else if ((m_firstFree + 1) >= m_mapSize)
{
m_mapSize += m_blocksize;
Node newMap[] = new Node[m_mapSize];
System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
m_map = newMap;
}
if (at <= (m_firstFree - 1))
{
System.arraycopy(m_map, at, m_map, at + 1, m_firstFree - at);
}
m_map[at] = value;
m_firstFree++;
}
/**
* Append the nodes to the list.
*
* NEEDSDOC @param nodes
*/
public void appendNodes(NodeVector nodes)
{
int nNodes = nodes.size();
if (null == m_map)
{
m_mapSize = nNodes + m_blocksize;
m_map = new Node[m_mapSize];
}
else if ((m_firstFree + nNodes) >= m_mapSize)
{
m_mapSize += (nNodes + m_blocksize);
Node newMap[] = new Node[m_mapSize];
System.arraycopy(m_map, 0, newMap, 0, m_firstFree + nNodes);
m_map = newMap;
}
System.arraycopy(nodes.m_map, 0, m_map, m_firstFree, nNodes);
m_firstFree += nNodes;
}
/**
* Inserts the specified node in this vector at the specified index.
* Each component in this vector with an index greater or equal to
* the specified index is shifted upward to have an index one greater
* than the value it had previously.
*/
public void removeAllElements()
{
if (null == m_map)
return;
for (int i = 0; i < m_firstFree; i++)
{
m_map[i] = null;
}
m_firstFree = 0;
}
/**
* Removes the first occurrence of the argument from this vector.
* If the object is found in this vector, each component in the vector
* with an index greater or equal to the object's index is shifted
* downward to have an index one smaller than the value it had
* previously.
*
* NEEDSDOC @param s
*
* NEEDSDOC ($objectName$) @return
*/
public boolean removeElement(Node s)
{
if (null == m_map)
return false;
for (int i = 0; i < m_firstFree; i++)
{
Node node = m_map[i];
if ((null != node) && node.equals(s))
{
if (i > m_firstFree)
System.arraycopy(m_map, i + 1, m_map, i - 1, m_firstFree - i);
else
m_map[i] = null;
m_firstFree--;
return true;
}
}
return false;
}
/**
* Deletes the component at the specified index. Each component in
* this vector with an index greater or equal to the specified
* index is shifted downward to have an index one smaller than
* the value it had previously.
*
* NEEDSDOC @param i
*/
public void removeElementAt(int i)
{
if (null == m_map)
return;
if (i > m_firstFree)
System.arraycopy(m_map, i + 1, m_map, i - 1, m_firstFree - i);
else
m_map[i] = null;
}
/**
* Sets the component at the specified index of this vector to be the
* specified object. The previous component at that position is discarded.
*
* The index must be a value greater than or equal to 0 and less
* than the current size of the vector.
*
* NEEDSDOC @param node
* NEEDSDOC @param index
*/
public void setElementAt(Node node, int index)
{
if (null == m_map)
{
m_map = new Node[m_blocksize];
m_mapSize = m_blocksize;
}
m_map[index] = node;
}
/**
* Get the nth element.
*
* NEEDSDOC @param i
*
* NEEDSDOC ($objectName$) @return
*/
public Node elementAt(int i)
{
if (null == m_map)
return null;
return m_map[i];
}
/**
* Tell if the table contains the given node.
*
* NEEDSDOC @param s
*
* NEEDSDOC ($objectName$) @return
*/
public boolean contains(Node s)
{
if (null == m_map)
return false;
for (int i = 0; i < m_firstFree; i++)
{
Node node = m_map[i];
if ((null != node) && node.equals(s))
return true;
}
return false;
}
/**
* Searches for the first occurence of the given argument,
* beginning the search at index, and testing for equality
* using the equals method.
*
* NEEDSDOC @param elem
* NEEDSDOC @param index
* @return the index of the first occurrence of the object
* argument in this vector at position index or later in the
* vector; returns -1 if the object is not found.
*/
public int indexOf(Node elem, int index)
{
if (null == m_map)
return -1;
for (int i = index; i < m_firstFree; i++)
{
Node node = m_map[i];
if ((null != node) && node.equals(elem))
return i;
}
return -1;
}
/**
* Searches for the first occurence of the given argument,
* beginning the search at index, and testing for equality
* using the equals method.
*
* NEEDSDOC @param elem
* @return the index of the first occurrence of the object
* argument in this vector at position index or later in the
* vector; returns -1 if the object is not found.
*/
public int indexOf(Node elem)
{
if (null == m_map)
return -1;
for (int i = 0; i < m_firstFree; i++)
{
Node node = m_map[i];
if ((null != node) && node.equals(elem))
return i;
}
return -1;
}
}
1.1 xml-xalan/java/src/org/apache/xml/utils/ObjectPool.java
Index: ObjectPool.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import java.util.*;
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class ObjectPool <needs-comment/>
*/
public class ObjectPool implements java.io.Serializable
{
/** NEEDSDOC Field objectType */
private final Class objectType;
/** NEEDSDOC Field freeStack */
private final Vector freeStack;
/**
* Constructor ObjectPool
*
*
* NEEDSDOC @param type
*/
public ObjectPool(Class type)
{
objectType = type;
freeStack = new Vector();
}
/**
* Constructor ObjectPool
*
*
* NEEDSDOC @param type
* NEEDSDOC @param size
*/
public ObjectPool(Class type, int size)
{
objectType = type;
freeStack = new Vector(size);
}
/**
* Constructor ObjectPool
*
*/
public ObjectPool()
{
objectType = null;
freeStack = new Vector();
}
/**
* NEEDSDOC Method getInstanceIfFree
*
*
* NEEDSDOC (getInstanceIfFree) @return
*/
public synchronized Object getInstanceIfFree()
{
// Check if the pool is empty.
if (!freeStack.isEmpty())
{
// Remove object from end of free pool.
Object result = freeStack.lastElement();
freeStack.setSize(freeStack.size() - 1);
return result;
}
return null;
}
/**
* NEEDSDOC Method getInstance
*
*
* NEEDSDOC (getInstance) @return
*/
public synchronized Object getInstance()
{
// Check if the pool is empty.
if (freeStack.isEmpty())
{
// Create a new object if so.
try
{
return objectType.newInstance();
}
catch (InstantiationException ex){}
catch (IllegalAccessException ex){}
// Throw unchecked exception for error in pool configuration.
throw new RuntimeException("exception creating new instance for pool");
}
else
{
// Remove object from end of free pool.
Object result = freeStack.lastElement();
freeStack.setSize(freeStack.size() - 1);
return result;
}
}
/**
* NEEDSDOC Method freeInstance
*
*
* NEEDSDOC @param obj
*/
public synchronized void freeInstance(Object obj)
{
// Make sure the object is of the correct type.
// Remove safety. -sb
// if (objectType.isInstance(obj))
// {
freeStack.addElement(obj);
// }
// else
// {
// throw new IllegalArgumentException("argument type invalid for pool");
// }
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/PrefixResolver.java
Index: PrefixResolver.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* <meta name="usage" content="advanced"/>
* The class that implements this interface can resolve prefixes
* to namespaces.
*/
public interface PrefixResolver
{
/**
* Given a namespace, get the corrisponding prefix. This assumes that
* the PrevixResolver hold's it's own namespace context, or is a namespace
* context itself.
*
* @param prefix The prefix to look up, which may be an empty string ("")
for the default Namespace.
*
* @return The associated Namespace URI, or null if the prefix
* is undeclared in this context.
*/
String getNamespaceForPrefix(String prefix);
/**
* Given a namespace, get the corrisponding prefix, based on the node
context.
*
* @param prefix The prefix to look up, which may be an empty string ("")
for the default Namespace.
* @param context The node context from which to look up the URI.
*
* @return The associated Namespace URI, or null if the prefix
* is undeclared in this context.
*/
String getNamespaceForPrefix(String prefix, org.w3c.dom.Node context);
/**
* Return the base identifier.
*
* @return The base identifier from where relative URIs should be
absolutized, or null
* if the base ID is unknown.
*/
public String getBaseIdentifier();
}
1.1
xml-xalan/java/src/org/apache/xml/utils/PrefixResolverDefault.java
Index: PrefixResolverDefault.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import org.w3c.dom.Node;
import org.w3c.dom.NamedNodeMap;
/**
* <meta name="usage" content="general"/>
* This class implements a generic PrefixResolver that
* can be used to perform prefix-to-namespace lookup
* for the XPath object.
*/
public class PrefixResolverDefault implements PrefixResolver
{
/**
* The context to resolve the prefix from, if the context
* is not given.
*/
Node m_context;
/**
* The URI for the XML namespace.
* (Duplicate of that found in org.apache.xpath.XPathContext).
*/
public static final String S_XMLNAMESPACEURI =
"http://www.w3.org/XML/1998/namespace";
/**
* Construct a PrefixResolverDefault object.
* @param xpathExpressionContext The context from
* which XPath expression prefixes will be resolved.
* Warning: This will not work correctly if xpathExpressionContext
* is an attribute node.
* @param xpathExpressionContext Node from which to start searching for a
* xmlns attribute that binds a prefix to a namespace (when the namespace
* context is not specified in the getNamespaceForPrefix call).
*/
public PrefixResolverDefault(Node xpathExpressionContext)
{
m_context = xpathExpressionContext;
}
/**
* Given a namespace, get the corrisponding prefix. This assumes that
* the PrevixResolver hold's it's own namespace context, or is a namespace
* context itself.
* @param prefix Prefix to resolve.
* @return Namespace that prefix resolves to, or null if prefix
* is not bound.
*/
public String getNamespaceForPrefix(String prefix)
{
return getNamespaceForPrefix(prefix, m_context);
}
/**
* Given a namespace, get the corrisponding prefix.
* Warning: This will not work correctly if namespaceContext
* is an attribute node.
* @param prefix Prefix to resolve.
* @param namespaceContext Node from which to start searching for a
* xmlns attribute that binds a prefix to a namespace.
* @return Namespace that prefix resolves to, or null if prefix
* is not bound.
*/
public String getNamespaceForPrefix(String prefix,
org.w3c.dom.Node namespaceContext)
{
Node parent = namespaceContext;
String namespace = null;
if (prefix.equals("xml"))
{
namespace = S_XMLNAMESPACEURI;
}
else
{
int type;
while ((null != parent) && (null == namespace)
&& (((type = parent.getNodeType()) == Node.ELEMENT_NODE)
|| (type == Node.ENTITY_REFERENCE_NODE)))
{
if (type == Node.ELEMENT_NODE)
{
NamedNodeMap nnm = parent.getAttributes();
for (int i = 0; i < nnm.getLength(); i++)
{
Node attr = nnm.item(i);
String aname = attr.getNodeName();
boolean isPrefix = aname.startsWith("xmlns:");
if (isPrefix || aname.equals("xmlns"))
{
int index = aname.indexOf(':');
String p = isPrefix ? aname.substring(index + 1) : "";
if (p.equals(prefix))
{
namespace = attr.getNodeValue();
break;
}
}
}
}
parent = parent.getParentNode();
}
}
return namespace;
}
/**
* Return the base identifier.
*
* NEEDSDOC ($objectName$) @return
*/
public String getBaseIdentifier()
{
return null;
}
}
1.1 xml-xalan/java/src/org/apache/xml/utils/QName.java
Index: QName.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import java.util.Stack;
import java.util.StringTokenizer;
import org.w3c.dom.Element;
import org.apache.xpath.res.XPATHErrorResources;
import org.apache.xalan.res.XSLMessages;
/**
* <meta name="usage" content="general"/>
* Class to represent a qualified name: "The name of an internal XSLT object,
* specifically a named template (see [7 Named Templates]), a mode (see [6.7
Modes]),
* an attribute set (see [8.1.4 Named Attribute Sets]), a key (see [14.2
Keys]),
* a locale (see [14.3 Number Formatting]), a variable or a parameter (see
* [12 Variables and Parameters]) is specified as a QName. If it has a prefix,
* then the prefix is expanded into a URI reference using the namespace
declarations
* in effect on the attribute in which the name occurs. The expanded name
* consisting of the local part of the name and the possibly null URI
reference
* is used as the name of the object. The default namespace is not used for
* unprefixed names."
*/
public class QName extends org.apache.xalan.serialize.QName
implements java.io.Serializable
{
/**
* The XML namespace.
*/
public static final String S_XMLNAMESPACEURI =
"http://www.w3.org/XML/1998/namespace";
/**
* Get the namespace of the qualified name.
*
* NEEDSDOC ($objectName$) @return
*/
public String getNamespace()
{
return getNamespaceURI();
}
/**
* Get the local part of the qualified name.
*
* NEEDSDOC ($objectName$) @return
*/
public String getLocalPart()
{
return getLocalName();
}
/**
* The cached hashcode, which is calculated at construction time.
*/
private int m_hashCode;
/**
* Return the cached hashcode of the qualified name.
*
* NEEDSDOC ($objectName$) @return
*/
public int hashCode()
{
return m_hashCode;
}
/**
* Override equals and agree that we're equal if
* the passed object is a string and it matches
* the name of the arg.
*
* NEEDSDOC @param ns
* NEEDSDOC @param localPart
*
* NEEDSDOC ($objectName$) @return
*/
public boolean equals(String ns, String localPart)
{
String thisnamespace = getNamespaceURI();
return getLocalName().equals(localPart)
&& (((null != thisnamespace) && (null != ns))
? thisnamespace.equals(ns)
: ((null == thisnamespace) && (null == ns)));
}
/**
* Override equals and agree that we're equal if
* the passed object is a QName and it matches
* the name of the arg.
*
* NEEDSDOC @param qname
*
* NEEDSDOC ($objectName$) @return
*/
public boolean equals(QName qname)
{
String thisnamespace = getNamespaceURI();
String thatnamespace = qname.getNamespaceURI();
return getLocalName().equals(qname.getLocalName())
&& (((null != thisnamespace) && (null != thatnamespace))
? thisnamespace.equals(thatnamespace)
: ((null == thisnamespace) && (null == thatnamespace)));
}
public static QName getQNameFromString(String name)
{
StringTokenizer tokenizer = new StringTokenizer(name, "{}", false);
QName qname;
String s1 = tokenizer.nextToken();
String s2 = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null;
if(null == s2)
qname = new QName(null, s1);
else
qname = new QName(s1, s2);
return qname;
}
/**
* Construct a QName from a string, without namespace resolution. Good
* for a few odd cases.
*
* NEEDSDOC @param localName
*/
public QName(String localName)
{
super(null, localName);
m_hashCode = toString().hashCode();
}
/**
* Construct a QName from a namespace and a local name.
*
* NEEDSDOC @param ns
* NEEDSDOC @param localName
*/
public QName(String ns, String localName)
{
super(ns, localName);
m_hashCode = toString().hashCode();
}
/**
* This function tells if a raw attribute name is a
* xmlns attribute.
*
* NEEDSDOC @param attRawName
*
* NEEDSDOC ($objectName$) @return
*/
public static boolean isXMLNSDecl(String attRawName)
{
return (attRawName.startsWith("xmlns")
&& (attRawName.equals("xmlns")
|| attRawName.startsWith("xmlns:")));
}
/**
* This function tells if a raw attribute name is a
* xmlns attribute.
*
* NEEDSDOC @param attRawName
*
* NEEDSDOC ($objectName$) @return
*/
public static String getPrefixFromXMLNSDecl(String attRawName)
{
int index = attRawName.indexOf(':');
return (index >= 0) ? attRawName.substring(index + 1) : "";
}
/**
* Returns the local name of the given node.
*
* NEEDSDOC @param qname
*
* NEEDSDOC ($objectName$) @return
*/
public static String getLocalPart(String qname)
{
int index = qname.indexOf(':');
return (index < 0) ? qname : qname.substring(index + 1);
}
/**
* Returns the local name of the given node.
*
* NEEDSDOC @param qname
*
* NEEDSDOC ($objectName$) @return
*/
public static String getPrefixPart(String qname)
{
int index = qname.indexOf(':');
return (index >= 0) ? qname.substring(0, index) : "";
}
/**
* Construct a QName from a string, resolving the prefix
* using the given namespace stack. The default namespace is
* not resolved.
*
* NEEDSDOC @param qname
* NEEDSDOC @param namespaces
*/
public QName(String qname, Stack namespaces)
{
String namespace = null;
String prefix = null;
int indexOfNSSep = qname.indexOf(':');
if (indexOfNSSep > 0)
{
prefix = qname.substring(0, indexOfNSSep);
if (prefix.equals("xml"))
{
namespace = S_XMLNAMESPACEURI;
}
else if (prefix.equals("xmlns"))
{
return;
}
else
{
int depth = namespaces.size();
for (int i = depth - 1; i >= 0; i--)
{
NameSpace ns = (NameSpace) namespaces.elementAt(i);
while (null != ns)
{
if ((null != ns.m_prefix) && prefix.equals(ns.m_prefix))
{
namespace = ns.m_uri;
i = -1;
break;
}
ns = ns.m_next;
}
}
}
if (null == namespace)
{
throw new RuntimeException(
XSLMessages.createXPATHMessage(
XPATHErrorResources.ER_PREFIX_MUST_RESOLVE,
new Object[]{ prefix })); //"Prefix must resolve to a namespace:
"+prefix);
}
}
_localName = (indexOfNSSep < 0)
? qname : qname.substring(indexOfNSSep + 1);
_namespaceURI = namespace;
_prefix = prefix;
m_hashCode = toString().hashCode();
}
/**
* Construct a QName from a string, resolving the prefix
* using the given namespace stack. The default namespace is
* not resolved.
*
* NEEDSDOC @param qname
* NEEDSDOC @param namespaceContext
* NEEDSDOC @param resolver
*/
public QName(String qname, Element namespaceContext,
PrefixResolver resolver)
{
_namespaceURI = null;
int indexOfNSSep = qname.indexOf(':');
if (indexOfNSSep > 0)
{
if (null != namespaceContext)
{
String prefix = qname.substring(0, indexOfNSSep);
_prefix = prefix;
if (prefix.equals("xml"))
{
_namespaceURI = S_XMLNAMESPACEURI;
}
else
{
_namespaceURI = resolver.getNamespaceForPrefix(prefix,
namespaceContext);
}
if (null == _namespaceURI)
{
throw new RuntimeException(
XSLMessages.createXPATHMessage(
XPATHErrorResources.ER_PREFIX_MUST_RESOLVE,
new Object[]{ prefix })); //"Prefix must resolve to a
namespace: "+prefix);
}
}
else
{
// TODO: error or warning...
}
}
_localName = (indexOfNSSep < 0)
? qname : qname.substring(indexOfNSSep + 1);
m_hashCode = toString().hashCode();
}
/**
* Construct a QName from a string, resolving the prefix
* using the given namespace stack. The default namespace is
* not resolved.
*
* NEEDSDOC @param qname
* NEEDSDOC @param resolver
*/
public QName(String qname, PrefixResolver resolver)
{
_namespaceURI = null;
int indexOfNSSep = qname.indexOf(':');
if (indexOfNSSep > 0)
{
String prefix = qname.substring(0, indexOfNSSep);
if (prefix.equals("xml"))
{
_namespaceURI = S_XMLNAMESPACEURI;
}
else
{
_namespaceURI = resolver.getNamespaceForPrefix(prefix);
}
if (null == _namespaceURI)
{
throw new RuntimeException(
XSLMessages.createXPATHMessage(
XPATHErrorResources.ER_PREFIX_MUST_RESOLVE,
new Object[]{ prefix })); //"Prefix must resolve to a namespace:
"+prefix);
}
}
_localName = (indexOfNSSep < 0)
? qname : qname.substring(indexOfNSSep + 1);
m_hashCode = toString().hashCode();
}
/**
* Return the string representation of the namespace. Performs
* string concatenation, so beware of performance issues.
*
* NEEDSDOC ($objectName$) @return
*/
public String toString()
{
return (null != this._namespaceURI)
? (this._namespaceURI + ":" + this._localName) : this._localName;
}
/** Serializable objects seem to require a public no-args constructor.
* Nobody else will be using it, and the object will be promptly
* overwritten. Should this be putting the object in a recognizable
* "You shouldn't have done that" state?
*/
public QName()
{ super();
/* Deserializer will run after this to fill in the fields */
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/RawCharacterHandler.java
Index: RawCharacterHandler.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* <meta name="usage" content="advanced"/>
* An interface that a Serializer/ContentHandler/ContentHandler must
* implement in order for disable-output-escaping to work.
*/
public interface RawCharacterHandler
{
/**
* Serialize the characters without escaping.
*
* NEEDSDOC @param ch
* NEEDSDOC @param start
* NEEDSDOC @param length
*
* @throws javax.xml.transform.TransformerException
*/
public void charactersRaw(char ch[], int start, int length)
throws javax.xml.transform.TransformerException;
}
1.1
xml-xalan/java/src/org/apache/xml/utils/SAXSourceLocator.java
Index: SAXSourceLocator.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import javax.xml.transform.SourceLocator;
import org.xml.sax.helpers.LocatorImpl;
import org.xml.sax.Locator;
import java.io.Serializable;
/**
* Class SAXSourceLocator extends org.xml.sax.helpers.LocatorImpl
* for the purpose of implementing the SourceLocator interface,
* and thus can be both a SourceLocator and a SAX Locator.
*/
public class SAXSourceLocator extends LocatorImpl
implements SourceLocator, Serializable
{
Locator m_locator;
/**
* Constructor SAXSourceLocator
*
*/
public SAXSourceLocator(){}
/**
* Constructor SAXSourceLocator
*
*
* NEEDSDOC @param locator
*/
public SAXSourceLocator(Locator locator)
{
m_locator = locator;
this.setColumnNumber(locator.getColumnNumber());
this.setLineNumber(locator.getLineNumber());
this.setPublicId(locator.getPublicId());
this.setSystemId(locator.getSystemId());
}
/**
* Return the public identifier for the current document event.
*
* <p>The return value is the public identifier of the document
* entity or of the external parsed entity in which the markup
* triggering the event appears.</p>
*
* @return A string containing the public identifier, or
* null if none is available.
* @see #getSystemId
*/
public String getPublicId()
{
return (null == m_locator) ? super.getPublicId() :
m_locator.getPublicId();
}
/**
* Return the system identifier for the current document event.
*
* <p>The return value is the system identifier of the document
* entity or of the external parsed entity in which the markup
* triggering the event appears.</p>
*
* <p>If the system identifier is a URL, the parser must resolve it
* fully before passing it to the application.</p>
*
* @return A string containing the system identifier, or null
* if none is available.
* @see #getPublicId
*/
public String getSystemId()
{
return (null == m_locator) ? super.getSystemId() :
m_locator.getSystemId();
}
/**
* Return the line number where the current document event ends.
*
* <p><strong>Warning:</strong> The return value from the method
* is intended only as an approximation for the sake of error
* reporting; it is not intended to provide sufficient information
* to edit the character content of the original XML document.</p>
*
* <p>The return value is an approximation of the line number
* in the document entity or external parsed entity where the
* markup triggering the event appears.</p>
*
* @return The line number, or -1 if none is available.
* @see #getColumnNumber
*/
public int getLineNumber()
{
return (null == m_locator) ? super.getLineNumber() :
m_locator.getLineNumber();
}
/**
* Return the column number where the current document event ends.
*
* <p><strong>Warning:</strong> The return value from the method
* is intended only as an approximation for the sake of error
* reporting; it is not intended to provide sufficient information
* to edit the character content of the original XML document.</p>
*
* <p>The return value is an approximation of the column number
* in the document entity or external parsed entity where the
* markup triggering the event appears.</p>
*
* @return The column number, or -1 if none is available.
* @see #getLineNumber
*/
public int getColumnNumber()
{
return (null == m_locator) ? super.getColumnNumber() :
m_locator.getColumnNumber();
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/SerializableLocatorImpl.java
Index: SerializableLocatorImpl.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* The standard SAX implementation of LocatorImpl is not serializable,
* limiting its utility as "a persistent snapshot of a locator".
* This is a quick hack to make it so. Note that it makes more sense
* in many cases to set up fields to hold this data rather than pointing
* at another object... but that decision should be made on architectural
* grounds rather than serializability.
*<p>
* It isn't clear whether subclassing LocatorImpl and adding serialization
* methods makes more sense than copying it and just adding Serializable
* to its interface. Since it's so simple, I've taken the latter approach
* for now.
*
* @see org.xml.sax.helpers.LocatorImpl
* @see org.xml.sax.Locator Locator
* @since XalanJ2
* @author Joe Kesselman
* @version 1.0
*/
public class SerializableLocatorImpl
implements org.xml.sax.Locator, java.io.Serializable
{
/**
* Zero-argument constructor.
*
* <p>SAX says "This will not normally be useful, since the main purpose
* of this class is to make a snapshot of an existing Locator." In fact,
* it _is_ sometimes useful when you want to construct a new Locator
* pointing to a specific location... which, after all, is why the
* setter methods are provided.
* </p>
*/
public SerializableLocatorImpl ()
{
}
/**
* Copy constructor.
*
* <p>Create a persistent copy of the current state of a locator.
* When the original locator changes, this copy will still keep
* the original values (and it can be used outside the scope of
* DocumentHandler methods).</p>
*
* @param locator The locator to copy.
*/
public SerializableLocatorImpl (org.xml.sax.Locator locator)
{
setPublicId(locator.getPublicId());
setSystemId(locator.getSystemId());
setLineNumber(locator.getLineNumber());
setColumnNumber(locator.getColumnNumber());
}
////////////////////////////////////////////////////////////////////
// Implementation of org.xml.sax.Locator
////////////////////////////////////////////////////////////////////
/**
* Return the saved public identifier.
*
* @return The public identifier as a string, or null if none
* is available.
* @see org.xml.sax.Locator#getPublicId
* @see #setPublicId
*/
public String getPublicId ()
{
return publicId;
}
/**
* Return the saved system identifier.
*
* @return The system identifier as a string, or null if none
* is available.
* @see org.xml.sax.Locator#getSystemId
* @see #setSystemId
*/
public String getSystemId ()
{
return systemId;
}
/**
* Return the saved line number (1-based).
*
* @return The line number as an integer, or -1 if none is available.
* @see org.xml.sax.Locator#getLineNumber
* @see #setLineNumber
*/
public int getLineNumber ()
{
return lineNumber;
}
/**
* Return the saved column number (1-based).
*
* @return The column number as an integer, or -1 if none is available.
* @see org.xml.sax.Locator#getColumnNumber
* @see #setColumnNumber
*/
public int getColumnNumber ()
{
return columnNumber;
}
////////////////////////////////////////////////////////////////////
// Setters for the properties (not in org.xml.sax.Locator)
////////////////////////////////////////////////////////////////////
/**
* Set the public identifier for this locator.
*
* @param publicId The new public identifier, or null
* if none is available.
* @see #getPublicId
*/
public void setPublicId (String publicId)
{
this.publicId = publicId;
}
/**
* Set the system identifier for this locator.
*
* @param systemId The new system identifier, or null
* if none is available.
* @see #getSystemId
*/
public void setSystemId (String systemId)
{
this.systemId = systemId;
}
/**
* Set the line number for this locator (1-based).
*
* @param lineNumber The line number, or -1 if none is available.
* @see #getLineNumber
*/
public void setLineNumber (int lineNumber)
{
this.lineNumber = lineNumber;
}
/**
* Set the column number for this locator (1-based).
*
* @param columnNumber The column number, or -1 if none is available.
* @see #getColumnNumber
*/
public void setColumnNumber (int columnNumber)
{
this.columnNumber = columnNumber;
}
////////////////////////////////////////////////////////////////////
// Internal state.
////////////////////////////////////////////////////////////////////
private String publicId;
private String systemId;
private int lineNumber;
private int columnNumber;
}
// end of LocatorImpl.java
1.1
xml-xalan/java/src/org/apache/xml/utils/StringBufferPool.java
Index: StringBufferPool.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class StringBufferPool <needs-comment/>
*/
public class StringBufferPool
{
/** NEEDSDOC Field m_stringBufPool */
private static ObjectPool m_stringBufPool =
new ObjectPool(org.apache.xml.utils.FastStringBuffer.class);
/**
* NEEDSDOC Method get
*
*
* NEEDSDOC (get) @return
*/
public static FastStringBuffer get()
{
return (FastStringBuffer) m_stringBufPool.getInstance();
}
/**
* NEEDSDOC Method free
*
*
* NEEDSDOC @param sb
*/
public static void free(FastStringBuffer sb)
{
m_stringBufPool.freeInstance(sb);
sb.setLength(0);
}
}
1.1 xml-xalan/java/src/org/apache/xml/utils/StringKey.java
Index: StringKey.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* <meta name="usage" content="internal"/>
* Simple class for fast lookup of string values, when used with
* hashtables. This class caches the hash value of the string.
*/
public class StringKey extends Object
{
/** NEEDSDOC Field m_str */
private String m_str;
/** NEEDSDOC Field m_hash */
int m_hash;
/**
* Constructor StringKey
*
*
* NEEDSDOC @param key
*/
public StringKey(String key)
{
m_str = key;
m_hash = key.hashCode();
}
/**
* NEEDSDOC Method hashCode
*
*
* NEEDSDOC (hashCode) @return
*/
public int hashCode()
{
return m_hash;
}
/**
* NEEDSDOC Method equals
*
*
* NEEDSDOC @param obj
*
* NEEDSDOC (equals) @return
*/
public final boolean equals(Object obj)
{
return obj.equals(m_str);
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/StringToIntTable.java
Index: StringToIntTable.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* <meta name="usage" content="internal"/>
* A very simple lookup table that stores a list of strings, the even
* number strings being keys, and the odd number strings being values.
*/
public class StringToIntTable
{
/** NEEDSDOC Field m_blocksize */
private int m_blocksize;
/** NEEDSDOC Field m_map[] */
private String m_map[];
/** NEEDSDOC Field m_values[] */
private int m_values[];
/** NEEDSDOC Field m_firstFree */
private int m_firstFree = 0;
/** NEEDSDOC Field m_mapSize */
private int m_mapSize;
/**
* Default constructor. Note that the default
* block size is very small, for small lists.
*/
public StringToIntTable()
{
m_blocksize = 8;
m_mapSize = m_blocksize;
m_map = new String[m_blocksize];
m_values = new int[m_blocksize];
}
/**
* Construct a StringToIntTable, using the given block size.
*
* NEEDSDOC @param blocksize
*/
public StringToIntTable(int blocksize)
{
m_blocksize = blocksize;
m_mapSize = blocksize;
m_map = new String[blocksize];
m_values = new int[m_blocksize];
}
/**
* Get the length of the list.
*
* NEEDSDOC ($objectName$) @return
*/
public final int getLength()
{
return m_firstFree;
}
/**
* Append a string onto the vector.
*
* NEEDSDOC @param key
* NEEDSDOC @param value
*/
public final void put(String key, int value)
{
if ((m_firstFree + 1) >= m_mapSize)
{
m_mapSize += m_blocksize;
String newMap[] = new String[m_mapSize];
System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
m_map = newMap;
int newValues[] = new int[m_mapSize];
System.arraycopy(m_values, 0, newValues, 0, m_firstFree + 1);
m_values = newValues;
}
m_map[m_firstFree] = key;
m_values[m_firstFree] = value;
m_firstFree++;
}
/**
* Tell if the table contains the given string.
*
* NEEDSDOC @param key
*
* NEEDSDOC ($objectName$) @return
*/
public final int get(String key)
{
for (int i = 0; i < m_firstFree; i++)
{
if (m_map[i].equals(key))
return m_values[i];
}
return -10000; // Bogus value, needs to throw exception.
}
/**
* Tell if the table contains the given string.
*
* NEEDSDOC @param key
*
* NEEDSDOC ($objectName$) @return
*/
public final int getIgnoreCase(String key)
{
if (null == key)
return -10000; // Bogus value, needs to throw exception.
for (int i = 0; i < m_firstFree; i++)
{
if (m_map[i].equalsIgnoreCase(key))
return m_values[i];
}
return -10000; // Bogus value, needs to throw exception.
}
/**
* Tell if the table contains the given string.
*
* NEEDSDOC @param key
*
* NEEDSDOC ($objectName$) @return
*/
public final boolean contains(String key)
{
for (int i = 0; i < m_firstFree; i++)
{
if (m_map[i].equals(key))
return true;
}
return false;
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/StringToStringTable.java
Index: StringToStringTable.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* <meta name="usage" content="internal"/>
* A very simple lookup table that stores a list of strings, the even
* number strings being keys, and the odd number strings being values.
*/
public class StringToStringTable
{
/** NEEDSDOC Field m_blocksize */
private int m_blocksize;
/** NEEDSDOC Field m_map[] */
private String m_map[];
/** NEEDSDOC Field m_firstFree */
private int m_firstFree = 0;
/** NEEDSDOC Field m_mapSize */
private int m_mapSize;
/**
* Default constructor. Note that the default
* block size is very small, for small lists.
*/
public StringToStringTable()
{
m_blocksize = 16;
m_mapSize = m_blocksize;
m_map = new String[m_blocksize];
}
/**
* Construct a StringToStringTable, using the given block size.
*
* NEEDSDOC @param blocksize
*/
public StringToStringTable(int blocksize)
{
m_blocksize = blocksize;
m_mapSize = blocksize;
m_map = new String[blocksize];
}
/**
* Get the length of the list.
*
* NEEDSDOC ($objectName$) @return
*/
public final int getLength()
{
return m_firstFree;
}
/**
* Append a string onto the vector.
*
* NEEDSDOC @param key
* NEEDSDOC @param value
*/
public final void put(String key, String value)
{
if ((m_firstFree + 2) >= m_mapSize)
{
m_mapSize += m_blocksize;
String newMap[] = new String[m_mapSize];
System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
m_map = newMap;
}
m_map[m_firstFree] = key;
m_firstFree++;
m_map[m_firstFree] = value;
m_firstFree++;
}
/**
* Tell if the table contains the given string.
*
* NEEDSDOC @param key
*
* NEEDSDOC ($objectName$) @return
*/
public final String get(String key)
{
for (int i = 0; i < m_firstFree; i += 2)
{
if (m_map[i].equals(key))
return m_map[i + 1];
}
return null;
}
/**
* Tell if the table contains the given string.
*
* NEEDSDOC @param key
*/
public final void remove(String key)
{
for (int i = 0; i < m_firstFree; i += 2)
{
if (m_map[i].equals(key))
{
if ((i + 2) < m_firstFree)
System.arraycopy(m_map, i + 2, m_map, i, m_firstFree - (i + 2));
m_firstFree -= 2;
m_map[m_firstFree] = null;
m_map[m_firstFree + 1] = null;
break;
}
}
}
/**
* Tell if the table contains the given string.
*
* NEEDSDOC @param key
*
* NEEDSDOC ($objectName$) @return
*/
public final String getIgnoreCase(String key)
{
if (null == key)
return null;
for (int i = 0; i < m_firstFree; i += 2)
{
if (m_map[i].equalsIgnoreCase(key))
return m_map[i + 1];
}
return null;
}
/**
* Tell if the table contains the given string in the value.
*
* NEEDSDOC @param val
*
* NEEDSDOC ($objectName$) @return
*/
public final String getByValue(String val)
{
for (int i = 1; i < m_firstFree; i += 2)
{
if (m_map[i].equals(val))
return m_map[i - 1];
}
return null;
}
/**
* Get the nth element.
*
* NEEDSDOC @param i
*
* NEEDSDOC ($objectName$) @return
*/
public final String elementAt(int i)
{
return m_map[i];
}
/**
* Tell if the table contains the given string.
*
* NEEDSDOC @param key
*
* NEEDSDOC ($objectName$) @return
*/
public final boolean contains(String key)
{
for (int i = 0; i < m_firstFree; i += 2)
{
if (m_map[i].equals(key))
return true;
}
return false;
}
/**
* Tell if the table contains the given string.
*
* NEEDSDOC @param val
*
* NEEDSDOC ($objectName$) @return
*/
public final boolean containsValue(String val)
{
for (int i = 1; i < m_firstFree; i += 2)
{
if (m_map[i].equals(val))
return true;
}
return false;
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/StringToStringTableVector.java
Index: StringToStringTableVector.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* <meta name="usage" content="internal"/>
* A very simple table that stores a list of StringToStringTables, optimized
* for small lists.
*/
public class StringToStringTableVector
{
/** NEEDSDOC Field m_blocksize */
private int m_blocksize;
/** NEEDSDOC Field m_map[] */
private StringToStringTable m_map[];
/** NEEDSDOC Field m_firstFree */
private int m_firstFree = 0;
/** NEEDSDOC Field m_mapSize */
private int m_mapSize;
/**
* Default constructor. Note that the default
* block size is very small, for small lists.
*/
public StringToStringTableVector()
{
m_blocksize = 8;
m_mapSize = m_blocksize;
m_map = new StringToStringTable[m_blocksize];
}
/**
* Construct a StringToStringTableVector, using the given block size.
*
* NEEDSDOC @param blocksize
*/
public StringToStringTableVector(int blocksize)
{
m_blocksize = blocksize;
m_mapSize = blocksize;
m_map = new StringToStringTable[blocksize];
}
/**
* Get the length of the list.
*
* NEEDSDOC ($objectName$) @return
*/
public final int getLength()
{
return m_firstFree;
}
/**
* Get the length of the list.
*
* NEEDSDOC ($objectName$) @return
*/
public final int size()
{
return m_firstFree;
}
/**
* Append a string onto the vector.
*
* NEEDSDOC @param value
*/
public final void addElement(StringToStringTable value)
{
if ((m_firstFree + 1) >= m_mapSize)
{
m_mapSize += m_blocksize;
StringToStringTable newMap[] = new StringToStringTable[m_mapSize];
System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
m_map = newMap;
}
m_map[m_firstFree] = value;
m_firstFree++;
}
/**
* Given a string, find the last added occurance value
* that matches the key.
*
* NEEDSDOC @param key
*
* NEEDSDOC ($objectName$) @return
*/
public final String get(String key)
{
for (int i = m_firstFree - 1; i >= 0; --i)
{
String nsuri = m_map[i].get(key);
if (nsuri != null)
return nsuri;
}
return null;
}
/**
* Given a string, find the last added occurance value
* that matches the key.
*
* NEEDSDOC @param key
*
* NEEDSDOC ($objectName$) @return
*/
public final boolean containsKey(String key)
{
for (int i = m_firstFree - 1; i >= 0; --i)
{
if (m_map[i].get(key) != null)
return true;
}
return false;
}
/**
* Remove the last element.
*/
public final void removeLastElem()
{
if (m_firstFree > 0)
{
m_map[m_firstFree] = null;
m_firstFree--;
}
}
/**
* Get the nth element.
*
* NEEDSDOC @param i
*
* NEEDSDOC ($objectName$) @return
*/
public final StringToStringTable elementAt(int i)
{
return m_map[i];
}
/**
* Tell if the table contains the given string.
*
* NEEDSDOC @param s
*
* NEEDSDOC ($objectName$) @return
*/
public final boolean contains(StringToStringTable s)
{
for (int i = 0; i < m_firstFree; i++)
{
if (m_map[i].equals(s))
return true;
}
return false;
}
}
1.1 xml-xalan/java/src/org/apache/xml/utils/StringVector.java
Index: StringVector.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* <meta name="usage" content="internal"/>
* A very simple table that stores a list of strings, optimized
* for small lists.
*/
public class StringVector
{
/** NEEDSDOC Field m_blocksize */
protected int m_blocksize;
/** NEEDSDOC Field m_map[] */
protected String m_map[];
/** NEEDSDOC Field m_firstFree */
protected int m_firstFree = 0;
/** NEEDSDOC Field m_mapSize */
protected int m_mapSize;
/**
* Default constructor. Note that the default
* block size is very small, for small lists.
*/
public StringVector()
{
m_blocksize = 8;
m_mapSize = m_blocksize;
m_map = new String[m_blocksize];
}
/**
* Construct a StringVector, using the given block size.
*
* NEEDSDOC @param blocksize
*/
public StringVector(int blocksize)
{
m_blocksize = blocksize;
m_mapSize = blocksize;
m_map = new String[blocksize];
}
/**
* Get the length of the list.
*
* NEEDSDOC ($objectName$) @return
*/
public int getLength()
{
return m_firstFree;
}
/**
* Get the length of the list.
*
* NEEDSDOC ($objectName$) @return
*/
public final int size()
{
return m_firstFree;
}
/**
* Append a string onto the vector.
*
* NEEDSDOC @param value
*/
public final void addElement(String value)
{
if ((m_firstFree + 1) >= m_mapSize)
{
m_mapSize += m_blocksize;
String newMap[] = new String[m_mapSize];
System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
m_map = newMap;
}
m_map[m_firstFree] = value;
m_firstFree++;
}
/**
* Get the nth element.
*
* NEEDSDOC @param i
*
* NEEDSDOC ($objectName$) @return
*/
public final String elementAt(int i)
{
return m_map[i];
}
/**
* Tell if the table contains the given string.
*
* NEEDSDOC @param s
*
* NEEDSDOC ($objectName$) @return
*/
public final boolean contains(String s)
{
if (null == s)
return false;
for (int i = 0; i < m_firstFree; i++)
{
if (m_map[i].equals(s))
return true;
}
return false;
}
/**
* Tell if the table contains the given string.
*
* NEEDSDOC @param s
*
* NEEDSDOC ($objectName$) @return
*/
public final boolean containsIgnoreCase(String s)
{
if (null == s)
return false;
for (int i = 0; i < m_firstFree; i++)
{
if (m_map[i].equalsIgnoreCase(s))
return true;
}
return false;
}
/**
* Tell if the table contains the given string.
*
* NEEDSDOC @param s
*/
public final void push(String s)
{
if ((m_firstFree + 1) >= m_mapSize)
{
m_mapSize += m_blocksize;
String newMap[] = new String[m_mapSize];
System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
m_map = newMap;
}
m_map[m_firstFree] = s;
m_firstFree++;
}
/**
* Tell if the table contains the given string.
*
* NEEDSDOC ($objectName$) @return
*/
public final String pop()
{
if (m_firstFree <= 0)
return null;
m_firstFree--;
String s = m_map[m_firstFree];
m_map[m_firstFree] = null;
return s;
}
/**
* Tell if the table contains the given string.
*
* NEEDSDOC ($objectName$) @return
*/
public final String peek()
{
return (m_firstFree <= 0) ? null : m_map[m_firstFree - 1];
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/SystemIDResolver.java
Index: SystemIDResolver.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import javax.xml.transform.TransformerException;
import org.apache.xml.utils.URI;
import org.apache.xml.utils.URI.MalformedURIException;
import java.io.*;
import java.lang.StringBuffer;
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class SystemIDResolver <needs-comment/>
*/
public class SystemIDResolver
{
/**
* NEEDSDOC Method getAbsoluteURIFromRelative
*
*
* NEEDSDOC @param uri
*
* NEEDSDOC (getAbsoluteURIFromRelative) @return
*/
public static String getAbsoluteURIFromRelative(String uri)
{
String curdir = System.getProperty("user.dir");
if (null != curdir)
{
uri = "file:///" + curdir + System.getProperty("file.separator") + uri;
}
if (null != uri && (uri.indexOf('\\') > -1))
uri = uri.replace('\\', '/');
return uri;
}
/**
* Take a SystemID string and try and turn it into a good absolute URL.
*
* NEEDSDOC @param urlString
* NEEDSDOC @param base
*
* NEEDSDOC ($objectName$) @return
* @exception TransformerException thrown if the string can't be turned
into a URL.
*/
public static String getAbsoluteURI(String urlString, String base)
throws TransformerException
{
if ((urlString.indexOf(':') < 0) && (null != base)
&& (base.indexOf(':') < 0))
{
base = getAbsoluteURIFromRelative(base);
}
// bit of a hack here. Need to talk to URI person to see if this can be
fixed.
if ((null != base) && urlString.startsWith("file:")
&& (urlString.charAt(5) != '/'))
{
urlString = urlString.substring(5);
}
// This is probably a bad idea, we should at least check for quotes...
if (null != base && (base.indexOf('\\') > -1))
base = base.replace('\\', '/');
if (null != urlString && (urlString.indexOf('\\') > -1))
urlString = urlString.replace('\\', '/');
URI uri;
try
{
if ((null == base) || (base.length() == 0))
{
uri = new URI(urlString);
}
else
{
URI baseURI = new URI(base);
uri = new URI(baseURI, urlString);
}
}
catch (MalformedURIException mue)
{
throw new TransformerException(mue);
}
String uriStr = uri.toString();
return uriStr;
}
}
1.1 xml-xalan/java/src/org/apache/xml/utils/TreeWalker.java
Index: TreeWalker.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import org.w3c.dom.*;
import org.xml.sax.*;
import org.xml.sax.ext.LexicalHandler;
import org.apache.xpath.DOM2Helper;
import org.apache.xpath.DOMHelper;
import org.apache.xml.utils.NodeConsumer;
/**
* <meta name="usage" content="advanced"/>
* This class does a pre-order walk of the DOM tree, calling a ContentHandler
* interface as it goes.
*/
public class TreeWalker
{
/** NEEDSDOC Field m_contentHandler */
private ContentHandler m_contentHandler = null;
// ARGHH!! JAXP Uses Xerces without setting the namespace processing to ON!
// DOM2Helper m_dh = new DOM2Helper();
/** NEEDSDOC Field m_dh */
protected DOMHelper m_dh = new DOM2Helper();
/**
* Get the ContentHandler used for the tree walk.
*
* NEEDSDOC ($objectName$) @return
*/
public ContentHandler getcontentHandler()
{
return m_contentHandler;
}
/**
* Constructor.
* @param contentHandler The implemention of the
* contentHandler operation (toXMLString, digest, ...)
*/
public TreeWalker(ContentHandler contentHandler)
{
this.m_contentHandler = contentHandler;
}
/**
* Perform a pre-order traversal non-recursive style.
*
* NEEDSDOC @param pos
*
* @throws TransformerException
*/
public void traverse(Node pos) throws org.xml.sax.SAXException
{
Node top = pos;
while (null != pos)
{
startNode(pos);
Node nextNode = pos.getFirstChild();
while (null == nextNode)
{
endNode(pos);
if (top.equals(pos))
break;
nextNode = pos.getNextSibling();
if (null == nextNode)
{
pos = pos.getParentNode();
if ((null == pos) || (top.equals(pos)))
{
if (null != pos)
endNode(pos);
nextNode = null;
break;
}
}
}
pos = nextNode;
}
}
/**
* Perform a pre-order traversal non-recursive style.
*
* NEEDSDOC @param pos
* NEEDSDOC @param top
*
* @throws TransformerException
*/
public void traverse(Node pos, Node top) throws org.xml.sax.SAXException
{
while (null != pos)
{
startNode(pos);
Node nextNode = pos.getFirstChild();
while (null == nextNode)
{
endNode(pos);
if ((null != top) && top.equals(pos))
break;
nextNode = pos.getNextSibling();
if (null == nextNode)
{
pos = pos.getParentNode();
if ((null == pos) || ((null != top) && top.equals(pos)))
{
nextNode = null;
break;
}
}
}
pos = nextNode;
}
}
/*
public void traverse(Node pos) throws TransformerException
{
startNode(pos);
NodeList children = pos.getChildNodes();
if(null != children)
{
int nChildren = children.getLength();
for(int i = 0; i < nChildren; i++)
{
traverse(children.item(i));
}
}
endNode(pos);
}
*/
/** NEEDSDOC Field nextIsRaw */
boolean nextIsRaw = false;
/**
* NEEDSDOC Method startNode
*
*
* NEEDSDOC @param node
*
* @throws TransformerException
*/
protected void startNode(Node node) throws org.xml.sax.SAXException
{
if (m_contentHandler instanceof NodeConsumer)
{
((NodeConsumer) m_contentHandler).setOriginatingNode(node);
}
switch (node.getNodeType())
{
case Node.COMMENT_NODE :
{
String data = ((Comment) node).getData();
if (m_contentHandler instanceof LexicalHandler)
{
LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);
lh.comment(data.toCharArray(), 0, data.length());
}
}
break;
case Node.DOCUMENT_FRAGMENT_NODE :
// ??;
break;
case Node.DOCUMENT_NODE :
this.m_contentHandler.startDocument();
break;
case Node.ELEMENT_NODE :
NamedNodeMap atts = ((Element) node).getAttributes();
int nAttrs = atts.getLength();
for (int i = 0; i < nAttrs; i++)
{
Node attr = atts.item(i);
String attrName = attr.getNodeName();
if (attrName.equals("xmlns") || attrName.startsWith("xmlns:"))
{
int index;
// Use "" instead of null, as Xerces likes "" for the
// name of the default namespace. Fix attributed
// to "Steven Murray" <[EMAIL PROTECTED]>.
String prefix = (index = attrName.indexOf(":")) < 0
? "" : attrName.substring(index + 1);
this.m_contentHandler.startPrefixMapping(prefix,
attr.getNodeValue());
}
}
// System.out.println("m_dh.getNamespaceOfNode(node):
"+m_dh.getNamespaceOfNode(node));
// System.out.println("m_dh.getLocalNameOfNode(node):
"+m_dh.getLocalNameOfNode(node));
this.m_contentHandler.startElement(m_dh.getNamespaceOfNode(node),
m_dh.getLocalNameOfNode(node),
node.getNodeName(),
new AttList(atts, m_dh));
break;
case Node.PROCESSING_INSTRUCTION_NODE :
{
ProcessingInstruction pi = (ProcessingInstruction) node;
String name = pi.getNodeName();
// String data = pi.getData();
if (name.equals("xslt-next-is-raw"))
{
nextIsRaw = true;
}
else
{
this.m_contentHandler.processingInstruction(pi.getNodeName(),
pi.getData());
}
}
break;
case Node.CDATA_SECTION_NODE :
{
String data = ((Text) node).getData();
boolean isLexH = (m_contentHandler instanceof LexicalHandler);
LexicalHandler lh = isLexH
? ((LexicalHandler) this.m_contentHandler) : null;
if (isLexH)
{
lh.startCDATA();
}
this.m_contentHandler.characters(data.toCharArray(), 0, data.length());
{
if (isLexH)
{
lh.endCDATA();
}
}
}
break;
case Node.TEXT_NODE :
{
String data = ((Text) node).getData();
if (nextIsRaw)
{
nextIsRaw = false;
m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING,
"");
m_contentHandler.characters(data.toCharArray(), 0,
data.length());
m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING,
"");
}
else
{
this.m_contentHandler.characters(data.toCharArray(), 0,
data.length());
}
}
break;
case Node.ENTITY_REFERENCE_NODE :
{
EntityReference eref = (EntityReference) node;
if (m_contentHandler instanceof LexicalHandler)
{
((LexicalHandler) this.m_contentHandler).startEntity(
eref.getNodeName());
}
else
{
// warning("Can not output entity to a pure SAX ContentHandler");
}
}
break;
default :
}
}
/**
* NEEDSDOC Method endNode
*
*
* NEEDSDOC @param node
*
* @throws TransformerException
*/
protected void endNode(Node node) throws org.xml.sax.SAXException
{
switch (node.getNodeType())
{
case Node.DOCUMENT_NODE :
this.m_contentHandler.endDocument();
break;
case Node.ELEMENT_NODE :
this.m_contentHandler.endElement("", "", node.getNodeName());
NamedNodeMap atts = ((Element) node).getAttributes();
int nAttrs = atts.getLength();
for (int i = 0; i < nAttrs; i++)
{
Node attr = atts.item(i);
String attrName = attr.getNodeName();
if (attrName.equals("xmlns") || attrName.startsWith("xmlns:"))
{
int index;
// Use "" instead of null, as Xerces likes "" for the
// name of the default namespace. Fix attributed
// to "Steven Murray" <[EMAIL PROTECTED]>.
String prefix = (index = attrName.indexOf(":")) < 0
? "" : attrName.substring(index + 1);
this.m_contentHandler.endPrefixMapping(prefix);
}
}
break;
case Node.CDATA_SECTION_NODE :
break;
case Node.ENTITY_REFERENCE_NODE :
{
EntityReference eref = (EntityReference) node;
if (m_contentHandler instanceof LexicalHandler)
{
LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);
lh.endEntity(eref.getNodeName());
}
}
break;
default :
}
}
} //TreeWalker
1.1 xml-xalan/java/src/org/apache/xml/utils/Trie.java
Index: Trie.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* <meta name="usage" content="internal"/>
* A digital search trie for 7-bit ASCII text
* The API is a subset of java.util.Hashtable
* The key must be a 7-bit ASCII string
* The value may be any Java Object
*/
public class Trie
{
/** NEEDSDOC Field ALPHA_SIZE */
public static final int ALPHA_SIZE = 128;
/** NEEDSDOC Field m_Root */
Node m_Root;
/**
* Constructor Trie
*
*/
public Trie()
{
m_Root = new Node();
}
/**
* NEEDSDOC Method put
*
*
* NEEDSDOC @param key
* NEEDSDOC @param value
*
* NEEDSDOC (put) @return
*/
public Object put(String key, Object value)
{
final int len = key.length();
Node node = m_Root;
for (int i = 0; i < len; i++)
{
Node nextNode = node.m_nextChar[Character.toUpperCase(key.charAt(i))];
if (nextNode != null)
{
node = nextNode;
}
else
{
for (; i < len; i++)
{
Node newNode = new Node();
node.m_nextChar[Character.toUpperCase(key.charAt(i))] = newNode;
node = newNode;
}
break;
}
}
Object ret = node.m_Value;
node.m_Value = value;
return ret;
}
/**
* NEEDSDOC Method get
*
*
* NEEDSDOC @param key
*
* NEEDSDOC (get) @return
*/
public Object get(String key)
{
final int len = key.length();
Node node = m_Root;
for (int i = 0; i < len; i++)
{
try
{
node = node.m_nextChar[Character.toUpperCase(key.charAt(i))];
}
catch (ArrayIndexOutOfBoundsException e)
{
// the key is not 7-bit ASCII so we won't find it here
node = null;
}
if (node == null)
return null;
}
return node.m_Value;
}
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class Node <needs-comment/>
*/
class Node
{
/**
* Constructor Node
*
*/
Node()
{
m_nextChar = new Node[ALPHA_SIZE];
m_Value = null;
}
/** NEEDSDOC Field m_nextChar[] */
Node m_nextChar[];
/** NEEDSDOC Field m_Value */
Object m_Value;
}
}
1.1 xml-xalan/java/src/org/apache/xml/utils/URI.java
Index: URI.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import java.io.IOException;
import java.io.Serializable;
/**
* A class to represent a Uniform Resource Identifier (URI). This class
* is designed to handle the parsing of URIs and provide access to
* the various components (scheme, host, port, userinfo, path, query
* string and fragment) that may constitute a URI.
* <p>
* Parsing of a URI specification is done according to the URI
* syntax described in RFC 2396
* <http://www.ietf.org/rfc/rfc2396.txt?number=2396>. Every URI consists
* of a scheme, followed by a colon (':'), followed by a scheme-specific
* part. For URIs that follow the "generic URI" syntax, the scheme-
* specific part begins with two slashes ("//") and may be followed
* by an authority segment (comprised of user information, host, and
* port), path segment, query segment and fragment. Note that RFC 2396
* no longer specifies the use of the parameters segment and excludes
* the "user:password" syntax as part of the authority segment. If
* "user:password" appears in a URI, the entire user/password string
* is stored as userinfo.
* <p>
* For URIs that do not follow the "generic URI" syntax (e.g. mailto),
* the entire scheme-specific part is treated as the "path" portion
* of the URI.
* <p>
* Note that, unlike the java.net.URL class, this class does not provide
* any built-in network access functionality nor does it provide any
* scheme-specific functionality (for example, it does not know a
* default port for a specific scheme). Rather, it only knows the
* grammar and basic set of operations that can be applied to a URI.
*
* @version $Id: URI.java,v 1.1 2000/11/23 04:58:46 sboag Exp $
*
*/
public class URI implements Serializable
{
/**
* MalformedURIExceptions are thrown in the process of building a URI
* or setting fields on a URI when an operation would result in an
* invalid URI specification.
*
*/
public static class MalformedURIException extends IOException
{
/**
* Constructs a <code>MalformedURIException</code> with no specified
* detail message.
*/
public MalformedURIException()
{
super();
}
/**
* Constructs a <code>MalformedURIException</code> with the
* specified detail message.
*
* @param p_msg the detail message.
*/
public MalformedURIException(String p_msg)
{
super(p_msg);
}
}
/** reserved characters */
private static final String RESERVED_CHARACTERS = ";/?:@&=+$,";
/**
* URI punctuation mark characters - these, combined with
* alphanumerics, constitute the "unreserved" characters
*/
private static final String MARK_CHARACTERS = "-_.!~*'() ";
/** scheme can be composed of alphanumerics and these characters */
private static final String SCHEME_CHARACTERS = "+-.";
/**
* userinfo can be composed of unreserved, escaped and these
* characters
*/
private static final String USERINFO_CHARACTERS = ";:&=+$,";
/** Stores the scheme (usually the protocol) for this URI. */
private String m_scheme = null;
/** If specified, stores the userinfo for this URI; otherwise null */
private String m_userinfo = null;
/** If specified, stores the host for this URI; otherwise null */
private String m_host = null;
/** If specified, stores the port for this URI; otherwise -1 */
private int m_port = -1;
/** If specified, stores the path for this URI; otherwise null */
private String m_path = null;
/**
* If specified, stores the query string for this URI; otherwise
* null.
*/
private String m_queryString = null;
/** If specified, stores the fragment for this URI; otherwise null */
private String m_fragment = null;
/** NEEDSDOC Field DEBUG */
private static boolean DEBUG = false;
/**
* Construct a new and uninitialized URI.
*/
public URI(){}
/**
* Construct a new URI from another URI. All fields for this URI are
* set equal to the fields of the URI passed in.
*
* @param p_other the URI to copy (cannot be null)
*/
public URI(URI p_other)
{
initialize(p_other);
}
/**
* Construct a new URI from a URI specification string. If the
* specification follows the "generic URI" syntax, (two slashes
* following the first colon), the specification will be parsed
* accordingly - setting the scheme, userinfo, host,port, path, query
* string and fragment fields as necessary. If the specification does
* not follow the "generic URI" syntax, the specification is parsed
* into a scheme and scheme-specific part (stored as the path) only.
*
* @param p_uriSpec the URI specification string (cannot be null or
* empty)
*
* @exception MalformedURIException if p_uriSpec violates any syntax
* rules
*/
public URI(String p_uriSpec) throws MalformedURIException
{
this((URI) null, p_uriSpec);
}
/**
* Construct a new URI from a base URI and a URI specification string.
* The URI specification string may be a relative URI.
*
* @param p_base the base URI (cannot be null if p_uriSpec is null or
* empty)
* @param p_uriSpec the URI specification string (cannot be null or
* empty if p_base is null)
*
* @exception MalformedURIException if p_uriSpec violates any syntax
* rules
*/
public URI(URI p_base, String p_uriSpec) throws MalformedURIException
{
initialize(p_base, p_uriSpec);
}
/**
* Construct a new URI that does not follow the generic URI syntax.
* Only the scheme and scheme-specific part (stored as the path) are
* initialized.
*
* @param p_scheme the URI scheme (cannot be null or empty)
* @param p_schemeSpecificPart the scheme-specific part (cannot be
* null or empty)
*
* @exception MalformedURIException if p_scheme violates any
* syntax rules
*/
public URI(String p_scheme, String p_schemeSpecificPart)
throws MalformedURIException
{
if (p_scheme == null || p_scheme.trim().length() == 0)
{
throw new MalformedURIException(
"Cannot construct URI with null/empty scheme!");
}
if (p_schemeSpecificPart == null
|| p_schemeSpecificPart.trim().length() == 0)
{
throw new MalformedURIException(
"Cannot construct URI with null/empty scheme-specific part!");
}
setScheme(p_scheme);
setPath(p_schemeSpecificPart);
}
/**
* Construct a new URI that follows the generic URI syntax from its
* component parts. Each component is validated for syntax and some
* basic semantic checks are performed as well. See the individual
* setter methods for specifics.
*
* @param p_scheme the URI scheme (cannot be null or empty)
* @param p_host the hostname or IPv4 address for the URI
* @param p_path the URI path - if the path contains '?' or '#',
* then the query string and/or fragment will be
* set from the path; however, if the query and
* fragment are specified both in the path and as
* separate parameters, an exception is thrown
* @param p_queryString the URI query string (cannot be specified
* if path is null)
* @param p_fragment the URI fragment (cannot be specified if path
* is null)
*
* @exception MalformedURIException if any of the parameters violates
* syntax rules or semantic rules
*/
public URI(String p_scheme, String p_host, String p_path, String
p_queryString, String p_fragment)
throws MalformedURIException
{
this(p_scheme, null, p_host, -1, p_path, p_queryString, p_fragment);
}
/**
* Construct a new URI that follows the generic URI syntax from its
* component parts. Each component is validated for syntax and some
* basic semantic checks are performed as well. See the individual
* setter methods for specifics.
*
* @param p_scheme the URI scheme (cannot be null or empty)
* @param p_userinfo the URI userinfo (cannot be specified if host
* is null)
* @param p_host the hostname or IPv4 address for the URI
* @param p_port the URI port (may be -1 for "unspecified"; cannot
* be specified if host is null)
* @param p_path the URI path - if the path contains '?' or '#',
* then the query string and/or fragment will be
* set from the path; however, if the query and
* fragment are specified both in the path and as
* separate parameters, an exception is thrown
* @param p_queryString the URI query string (cannot be specified
* if path is null)
* @param p_fragment the URI fragment (cannot be specified if path
* is null)
*
* @exception MalformedURIException if any of the parameters violates
* syntax rules or semantic rules
*/
public URI(String p_scheme, String p_userinfo, String p_host, int p_port,
String p_path, String p_queryString, String p_fragment)
throws MalformedURIException
{
if (p_scheme == null || p_scheme.trim().length() == 0)
{
throw new MalformedURIException("Scheme is required!");
}
if (p_host == null)
{
if (p_userinfo != null)
{
throw new MalformedURIException(
"Userinfo may not be specified if host is not specified!");
}
if (p_port != -1)
{
throw new MalformedURIException(
"Port may not be specified if host is not specified!");
}
}
if (p_path != null)
{
if (p_path.indexOf('?') != -1 && p_queryString != null)
{
throw new MalformedURIException(
"Query string cannot be specified in path and query string!");
}
if (p_path.indexOf('#') != -1 && p_fragment != null)
{
throw new MalformedURIException(
"Fragment cannot be specified in both the path and fragment!");
}
}
setScheme(p_scheme);
setHost(p_host);
setPort(p_port);
setUserinfo(p_userinfo);
setPath(p_path);
setQueryString(p_queryString);
setFragment(p_fragment);
}
/**
* Initialize all fields of this URI from another URI.
*
* @param p_other the URI to copy (cannot be null)
*/
private void initialize(URI p_other)
{
m_scheme = p_other.getScheme();
m_userinfo = p_other.getUserinfo();
m_host = p_other.getHost();
m_port = p_other.getPort();
m_path = p_other.getPath();
m_queryString = p_other.getQueryString();
m_fragment = p_other.getFragment();
}
/**
* Initializes this URI from a base URI and a URI specification string.
* See RFC 2396 Section 4 and Appendix B for specifications on parsing
* the URI and Section 5 for specifications on resolving relative URIs
* and relative paths.
*
* @param p_base the base URI (may be null if p_uriSpec is an absolute
* URI)
* @param p_uriSpec the URI spec string which may be an absolute or
* relative URI (can only be null/empty if p_base
* is not null)
*
* @exception MalformedURIException if p_base is null and p_uriSpec
* is not an absolute URI or if
* p_uriSpec violates syntax rules
*/
private void initialize(URI p_base, String p_uriSpec)
throws MalformedURIException
{
if (p_base == null
&& (p_uriSpec == null || p_uriSpec.trim().length() == 0))
{
throw new MalformedURIException(
"Cannot initialize URI with empty parameters.");
}
// just make a copy of the base if spec is empty
if (p_uriSpec == null || p_uriSpec.trim().length() == 0)
{
initialize(p_base);
return;
}
String uriSpec = p_uriSpec.trim();
int uriSpecLen = uriSpec.length();
int index = 0;
// check for scheme
if (uriSpec.indexOf(':') == -1)
{
if (p_base == null)
{
throw new MalformedURIException("No scheme found in URI.");
}
}
else
{
initializeScheme(uriSpec);
index = m_scheme.length() + 1;
}
// two slashes means generic URI syntax, so we get the authority
if (((index + 1) < uriSpecLen)
&& (uriSpec.substring(index).startsWith("//")))
{
index += 2;
int startPos = index;
// get authority - everything up to path, query or fragment
char testChar = '\0';
while (index < uriSpecLen)
{
testChar = uriSpec.charAt(index);
if (testChar == '/' || testChar == '?' || testChar == '#')
{
break;
}
index++;
}
// if we found authority, parse it out, otherwise we set the
// host to empty string
if (index > startPos)
{
initializeAuthority(uriSpec.substring(startPos, index));
}
else
{
m_host = "";
}
}
initializePath(uriSpec.substring(index));
// Resolve relative URI to base URI - see RFC 2396 Section 5.2
// In some cases, it might make more sense to throw an exception
// (when scheme is specified is the string spec and the base URI
// is also specified, for example), but we're just following the
// RFC specifications
if (p_base != null)
{
// check to see if this is the current doc - RFC 2396 5.2 #2
// note that this is slightly different from the RFC spec in that
// we don't include the check for query string being null
// - this handles cases where the urispec is just a query
// string or a fragment (e.g. "?y" or "#s") -
// see <http://www.ics.uci.edu/~fielding/url/test1.html> which
// identified this as a bug in the RFC
if (m_path.length() == 0 && m_scheme == null && m_host == null)
{
m_scheme = p_base.getScheme();
m_userinfo = p_base.getUserinfo();
m_host = p_base.getHost();
m_port = p_base.getPort();
m_path = p_base.getPath();
if (m_queryString == null)
{
m_queryString = p_base.getQueryString();
}
return;
}
// check for scheme - RFC 2396 5.2 #3
// if we found a scheme, it means absolute URI, so we're done
if (m_scheme == null)
{
m_scheme = p_base.getScheme();
}
else
{
return;
}
// check for authority - RFC 2396 5.2 #4
// if we found a host, then we've got a network path, so we're done
if (m_host == null)
{
m_userinfo = p_base.getUserinfo();
m_host = p_base.getHost();
m_port = p_base.getPort();
}
else
{
return;
}
// check for absolute path - RFC 2396 5.2 #5
if (m_path.length() > 0 && m_path.startsWith("/"))
{
return;
}
// if we get to this point, we need to resolve relative path
// RFC 2396 5.2 #6
String path = new String();
String basePath = p_base.getPath();
// 6a - get all but the last segment of the base URI path
if (basePath != null)
{
int lastSlash = basePath.lastIndexOf('/');
if (lastSlash != -1)
{
path = basePath.substring(0, lastSlash + 1);
}
}
// 6b - append the relative URI path
path = path.concat(m_path);
// 6c - remove all "./" where "." is a complete path segment
index = -1;
while ((index = path.indexOf("/./")) != -1)
{
path = path.substring(0, index + 1).concat(path.substring(index + 3));
}
// 6d - remove "." if path ends with "." as a complete path segment
if (path.endsWith("/."))
{
path = path.substring(0, path.length() - 1);
}
// 6e - remove all "<segment>/../" where "<segment>" is a complete
// path segment not equal to ".."
index = -1;
int segIndex = -1;
String tempString = null;
while ((index = path.indexOf("/../")) > 0)
{
tempString = path.substring(0, path.indexOf("/../"));
segIndex = tempString.lastIndexOf('/');
if (segIndex != -1)
{
if (!tempString.substring(segIndex++).equals(".."))
{
path = path.substring(0, segIndex).concat(path.substring(index
+ 4));
}
}
}
// 6f - remove ending "<segment>/.." where "<segment>" is a
// complete path segment
if (path.endsWith("/.."))
{
tempString = path.substring(0, path.length() - 3);
segIndex = tempString.lastIndexOf('/');
if (segIndex != -1)
{
path = path.substring(0, segIndex + 1);
}
}
m_path = path;
}
}
/**
* Initialize the scheme for this URI from a URI string spec.
*
* @param p_uriSpec the URI specification (cannot be null)
*
* @exception MalformedURIException if URI does not have a conformant
* scheme
*/
private void initializeScheme(String p_uriSpec) throws MalformedURIException
{
int uriSpecLen = p_uriSpec.length();
int index = 0;
String scheme = null;
char testChar = '\0';
while (index < uriSpecLen)
{
testChar = p_uriSpec.charAt(index);
if (testChar == ':' || testChar == '/' || testChar == '?'
|| testChar == '#')
{
break;
}
index++;
}
scheme = p_uriSpec.substring(0, index);
if (scheme.length() == 0)
{
throw new MalformedURIException("No scheme found in URI.");
}
else
{
setScheme(scheme);
}
}
/**
* Initialize the authority (userinfo, host and port) for this
* URI from a URI string spec.
*
* @param p_uriSpec the URI specification (cannot be null)
*
* @exception MalformedURIException if p_uriSpec violates syntax rules
*/
private void initializeAuthority(String p_uriSpec)
throws MalformedURIException
{
int index = 0;
int start = 0;
int end = p_uriSpec.length();
char testChar = '\0';
String userinfo = null;
// userinfo is everything up @
if (p_uriSpec.indexOf('@', start) != -1)
{
while (index < end)
{
testChar = p_uriSpec.charAt(index);
if (testChar == '@')
{
break;
}
index++;
}
userinfo = p_uriSpec.substring(start, index);
index++;
}
// host is everything up to ':'
String host = null;
start = index;
while (index < end)
{
testChar = p_uriSpec.charAt(index);
if (testChar == ':')
{
break;
}
index++;
}
host = p_uriSpec.substring(start, index);
int port = -1;
if (host.length() > 0)
{
// port
if (testChar == ':')
{
index++;
start = index;
while (index < end)
{
index++;
}
String portStr = p_uriSpec.substring(start, index);
if (portStr.length() > 0)
{
for (int i = 0; i < portStr.length(); i++)
{
if (!isDigit(portStr.charAt(i)))
{
throw new MalformedURIException(
portStr + " is invalid. Port should only contain digits!");
}
}
try
{
port = Integer.parseInt(portStr);
}
catch (NumberFormatException nfe)
{
// can't happen
}
}
}
}
setHost(host);
setPort(port);
setUserinfo(userinfo);
}
/**
* Initialize the path for this URI from a URI string spec.
*
* @param p_uriSpec the URI specification (cannot be null)
*
* @exception MalformedURIException if p_uriSpec violates syntax rules
*/
private void initializePath(String p_uriSpec) throws MalformedURIException
{
if (p_uriSpec == null)
{
throw new MalformedURIException(
"Cannot initialize path from null string!");
}
int index = 0;
int start = 0;
int end = p_uriSpec.length();
char testChar = '\0';
// path - everything up to query string or fragment
while (index < end)
{
testChar = p_uriSpec.charAt(index);
if (testChar == '?' || testChar == '#')
{
break;
}
// check for valid escape sequence
if (testChar == '%')
{
if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1))
||!isHex(p_uriSpec.charAt(index + 2)))
{
throw new MalformedURIException(
"Path contains invalid escape sequence!");
}
}
else if (!isReservedCharacter(testChar)
&&!isUnreservedCharacter(testChar))
{
if ('\\' != testChar)
throw new MalformedURIException("Path contains invalid character: "
+ testChar);
}
index++;
}
m_path = p_uriSpec.substring(start, index);
// query - starts with ? and up to fragment or end
if (testChar == '?')
{
index++;
start = index;
while (index < end)
{
testChar = p_uriSpec.charAt(index);
if (testChar == '#')
{
break;
}
if (testChar == '%')
{
if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1))
||!isHex(p_uriSpec.charAt(index + 2)))
{
throw new MalformedURIException(
"Query string contains invalid escape sequence!");
}
}
else if (!isReservedCharacter(testChar)
&&!isUnreservedCharacter(testChar))
{
throw new MalformedURIException(
"Query string contains invalid character:" + testChar);
}
index++;
}
m_queryString = p_uriSpec.substring(start, index);
}
// fragment - starts with #
if (testChar == '#')
{
index++;
start = index;
while (index < end)
{
testChar = p_uriSpec.charAt(index);
if (testChar == '%')
{
if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1))
||!isHex(p_uriSpec.charAt(index + 2)))
{
throw new MalformedURIException(
"Fragment contains invalid escape sequence!");
}
}
else if (!isReservedCharacter(testChar)
&&!isUnreservedCharacter(testChar))
{
throw new MalformedURIException(
"Fragment contains invalid character:" + testChar);
}
index++;
}
m_fragment = p_uriSpec.substring(start, index);
}
}
/**
* Get the scheme for this URI.
*
* @return the scheme for this URI
*/
public String getScheme()
{
return m_scheme;
}
/**
* Get the scheme-specific part for this URI (everything following the
* scheme and the first colon). See RFC 2396 Section 5.2 for spec.
*
* @return the scheme-specific part for this URI
*/
public String getSchemeSpecificPart()
{
StringBuffer schemespec = new StringBuffer();
if (m_userinfo != null || m_host != null || m_port != -1)
{
schemespec.append("//");
}
if (m_userinfo != null)
{
schemespec.append(m_userinfo);
schemespec.append('@');
}
if (m_host != null)
{
schemespec.append(m_host);
}
if (m_port != -1)
{
schemespec.append(':');
schemespec.append(m_port);
}
if (m_path != null)
{
schemespec.append((m_path));
}
if (m_queryString != null)
{
schemespec.append('?');
schemespec.append(m_queryString);
}
if (m_fragment != null)
{
schemespec.append('#');
schemespec.append(m_fragment);
}
return schemespec.toString();
}
/**
* Get the userinfo for this URI.
*
* @return the userinfo for this URI (null if not specified).
*/
public String getUserinfo()
{
return m_userinfo;
}
/**
* Get the host for this URI.
*
* @return the host for this URI (null if not specified).
*/
public String getHost()
{
return m_host;
}
/**
* Get the port for this URI.
*
* @return the port for this URI (-1 if not specified).
*/
public int getPort()
{
return m_port;
}
/**
* Get the path for this URI (optionally with the query string and
* fragment).
*
* @param p_includeQueryString if true (and query string is not null),
* then a "?" followed by the query string
* will be appended
* @param p_includeFragment if true (and fragment is not null),
* then a "#" followed by the fragment
* will be appended
*
* @return the path for this URI possibly including the query string
* and fragment
*/
public String getPath(boolean p_includeQueryString,
boolean p_includeFragment)
{
StringBuffer pathString = new StringBuffer(m_path);
if (p_includeQueryString && m_queryString != null)
{
pathString.append('?');
pathString.append(m_queryString);
}
if (p_includeFragment && m_fragment != null)
{
pathString.append('#');
pathString.append(m_fragment);
}
return pathString.toString();
}
/**
* Get the path for this URI. Note that the value returned is the path
* only and does not include the query string or fragment.
*
* @return the path for this URI.
*/
public String getPath()
{
return m_path;
}
/**
* Get the query string for this URI.
*
* @return the query string for this URI. Null is returned if there
* was no "?" in the URI spec, empty string if there was a
* "?" but no query string following it.
*/
public String getQueryString()
{
return m_queryString;
}
/**
* Get the fragment for this URI.
*
* @return the fragment for this URI. Null is returned if there
* was no "#" in the URI spec, empty string if there was a
* "#" but no fragment following it.
*/
public String getFragment()
{
return m_fragment;
}
/**
* Set the scheme for this URI. The scheme is converted to lowercase
* before it is set.
*
* @param p_scheme the scheme for this URI (cannot be null)
*
* @exception MalformedURIException if p_scheme is not a conformant
* scheme name
*/
public void setScheme(String p_scheme) throws MalformedURIException
{
if (p_scheme == null)
{
throw new MalformedURIException("Cannot set scheme from null string!");
}
if (!isConformantSchemeName(p_scheme))
{
throw new MalformedURIException("The scheme is not conformant.");
}
m_scheme = p_scheme.toLowerCase();
}
/**
* Set the userinfo for this URI. If a non-null value is passed in and
* the host value is null, then an exception is thrown.
*
* @param p_userinfo the userinfo for this URI
*
* @exception MalformedURIException if p_userinfo contains invalid
* characters
*/
public void setUserinfo(String p_userinfo) throws MalformedURIException
{
if (p_userinfo == null)
{
m_userinfo = null;
}
else
{
if (m_host == null)
{
throw new MalformedURIException(
"Userinfo cannot be set when host is null!");
}
// userinfo can contain alphanumerics, mark characters, escaped
// and ';',':','&','=','+','$',','
int index = 0;
int end = p_userinfo.length();
char testChar = '\0';
while (index < end)
{
testChar = p_userinfo.charAt(index);
if (testChar == '%')
{
if (index + 2 >= end ||!isHex(p_userinfo.charAt(index + 1))
||!isHex(p_userinfo.charAt(index + 2)))
{
throw new MalformedURIException(
"Userinfo contains invalid escape sequence!");
}
}
else if (!isUnreservedCharacter(testChar)
&& USERINFO_CHARACTERS.indexOf(testChar) == -1)
{
throw new MalformedURIException(
"Userinfo contains invalid character:" + testChar);
}
index++;
}
}
m_userinfo = p_userinfo;
}
/**
* Set the host for this URI. If null is passed in, the userinfo
* field is also set to null and the port is set to -1.
*
* @param p_host the host for this URI
*
* @exception MalformedURIException if p_host is not a valid IP
* address or DNS hostname.
*/
public void setHost(String p_host) throws MalformedURIException
{
if (p_host == null || p_host.trim().length() == 0)
{
m_host = p_host;
m_userinfo = null;
m_port = -1;
}
else if (!isWellFormedAddress(p_host))
{
throw new MalformedURIException("Host is not a well formed address!");
}
m_host = p_host;
}
/**
* Set the port for this URI. -1 is used to indicate that the port is
* not specified, otherwise valid port numbers are between 0 and 65535.
* If a valid port number is passed in and the host field is null,
* an exception is thrown.
*
* @param p_port the port number for this URI
*
* @exception MalformedURIException if p_port is not -1 and not a
* valid port number
*/
public void setPort(int p_port) throws MalformedURIException
{
if (p_port >= 0 && p_port <= 65535)
{
if (m_host == null)
{
throw new MalformedURIException(
"Port cannot be set when host is null!");
}
}
else if (p_port != -1)
{
throw new MalformedURIException("Invalid port number!");
}
m_port = p_port;
}
/**
* Set the path for this URI. If the supplied path is null, then the
* query string and fragment are set to null as well. If the supplied
* path includes a query string and/or fragment, these fields will be
* parsed and set as well. Note that, for URIs following the "generic
* URI" syntax, the path specified should start with a slash.
* For URIs that do not follow the generic URI syntax, this method
* sets the scheme-specific part.
*
* @param p_path the path for this URI (may be null)
*
* @exception MalformedURIException if p_path contains invalid
* characters
*/
public void setPath(String p_path) throws MalformedURIException
{
if (p_path == null)
{
m_path = null;
m_queryString = null;
m_fragment = null;
}
else
{
initializePath(p_path);
}
}
/**
* Append to the end of the path of this URI. If the current path does
* not end in a slash and the path to be appended does not begin with
* a slash, a slash will be appended to the current path before the
* new segment is added. Also, if the current path ends in a slash
* and the new segment begins with a slash, the extra slash will be
* removed before the new segment is appended.
*
* @param p_addToPath the new segment to be added to the current path
*
* @exception MalformedURIException if p_addToPath contains syntax
* errors
*/
public void appendPath(String p_addToPath) throws MalformedURIException
{
if (p_addToPath == null || p_addToPath.trim().length() == 0)
{
return;
}
if (!isURIString(p_addToPath))
{
throw new MalformedURIException("Path contains invalid character!");
}
if (m_path == null || m_path.trim().length() == 0)
{
if (p_addToPath.startsWith("/"))
{
m_path = p_addToPath;
}
else
{
m_path = "/" + p_addToPath;
}
}
else if (m_path.endsWith("/"))
{
if (p_addToPath.startsWith("/"))
{
m_path = m_path.concat(p_addToPath.substring(1));
}
else
{
m_path = m_path.concat(p_addToPath);
}
}
else
{
if (p_addToPath.startsWith("/"))
{
m_path = m_path.concat(p_addToPath);
}
else
{
m_path = m_path.concat("/" + p_addToPath);
}
}
}
/**
* Set the query string for this URI. A non-null value is valid only
* if this is an URI conforming to the generic URI syntax and
* the path value is not null.
*
* @param p_queryString the query string for this URI
*
* @exception MalformedURIException if p_queryString is not null and this
* URI does not conform to the generic
* URI syntax or if the path is null
*/
public void setQueryString(String p_queryString)
throws MalformedURIException
{
if (p_queryString == null)
{
m_queryString = null;
}
else if (!isGenericURI())
{
throw new MalformedURIException(
"Query string can only be set for a generic URI!");
}
else if (getPath() == null)
{
throw new MalformedURIException(
"Query string cannot be set when path is null!");
}
else if (!isURIString(p_queryString))
{
throw new MalformedURIException(
"Query string contains invalid character!");
}
else
{
m_queryString = p_queryString;
}
}
/**
* Set the fragment for this URI. A non-null value is valid only
* if this is a URI conforming to the generic URI syntax and
* the path value is not null.
*
* @param p_fragment the fragment for this URI
*
* @exception MalformedURIException if p_fragment is not null and this
* URI does not conform to the generic
* URI syntax or if the path is null
*/
public void setFragment(String p_fragment) throws MalformedURIException
{
if (p_fragment == null)
{
m_fragment = null;
}
else if (!isGenericURI())
{
throw new MalformedURIException(
"Fragment can only be set for a generic URI!");
}
else if (getPath() == null)
{
throw new MalformedURIException(
"Fragment cannot be set when path is null!");
}
else if (!isURIString(p_fragment))
{
throw new MalformedURIException("Fragment contains invalid character!");
}
else
{
m_fragment = p_fragment;
}
}
/**
* Determines if the passed-in Object is equivalent to this URI.
*
* @param p_test the Object to test for equality.
*
* @return true if p_test is a URI with all values equal to this
* URI, false otherwise
*/
public boolean equals(Object p_test)
{
if (p_test instanceof URI)
{
URI testURI = (URI) p_test;
if (((m_scheme == null && testURI.m_scheme == null) || (m_scheme !=
null && testURI.m_scheme != null && m_scheme.equals(
testURI.m_scheme))) && ((m_userinfo == null &&
testURI.m_userinfo == null) || (m_userinfo != null && testURI.m_userinfo !=
null && m_userinfo.equals(
testURI.m_userinfo))) && ((m_host == null && testURI.m_host ==
null) || (m_host != null && testURI.m_host != null && m_host.equals(
testURI.m_host))) && m_port == testURI.m_port && ((m_path ==
null && testURI.m_path == null) || (m_path != null && testURI.m_path != null &&
m_path.equals(
testURI.m_path))) && ((m_queryString == null &&
testURI.m_queryString == null) || (m_queryString != null &&
testURI.m_queryString != null && m_queryString.equals(
testURI.m_queryString))) && ((m_fragment == null &&
testURI.m_fragment == null) || (m_fragment != null && testURI.m_fragment !=
null && m_fragment.equals(
testURI.m_fragment))))
{
return true;
}
}
return false;
}
/**
* Get the URI as a string specification. See RFC 2396 Section 5.2.
*
* @return the URI string specification
*/
public String toString()
{
StringBuffer uriSpecString = new StringBuffer();
if (m_scheme != null)
{
uriSpecString.append(m_scheme);
uriSpecString.append(':');
}
uriSpecString.append(getSchemeSpecificPart());
return uriSpecString.toString();
}
/**
* Get the indicator as to whether this URI uses the "generic URI"
* syntax.
*
* @return true if this URI uses the "generic URI" syntax, false
* otherwise
*/
public boolean isGenericURI()
{
// presence of the host (whether valid or empty) means
// double-slashes which means generic uri
return (m_host != null);
}
/**
* Determine whether a scheme conforms to the rules for a scheme name.
* A scheme is conformant if it starts with an alphanumeric, and
* contains only alphanumerics, '+','-' and '.'.
*
*
* NEEDSDOC @param p_scheme
* @return true if the scheme is conformant, false otherwise
*/
public static boolean isConformantSchemeName(String p_scheme)
{
if (p_scheme == null || p_scheme.trim().length() == 0)
{
return false;
}
if (!isAlpha(p_scheme.charAt(0)))
{
return false;
}
char testChar;
for (int i = 1; i < p_scheme.length(); i++)
{
testChar = p_scheme.charAt(i);
if (!isAlphanum(testChar) && SCHEME_CHARACTERS.indexOf(testChar) == -1)
{
return false;
}
}
return true;
}
/**
* Determine whether a string is syntactically capable of representing
* a valid IPv4 address or the domain name of a network host. A valid
* IPv4 address consists of four decimal digit groups separated by a
* '.'. A hostname consists of domain labels (each of which must
* begin and end with an alphanumeric but may contain '-') separated
* & by a '.'. See RFC 2396 Section 3.2.2.
*
*
* NEEDSDOC @param p_address
* @return true if the string is a syntactically valid IPv4 address
* or hostname
*/
public static boolean isWellFormedAddress(String p_address)
{
if (p_address == null)
{
return false;
}
String address = p_address.trim();
int addrLength = address.length();
if (addrLength == 0 || addrLength > 255)
{
return false;
}
if (address.startsWith(".") || address.startsWith("-"))
{
return false;
}
// rightmost domain label starting with digit indicates IP address
// since top level domain label can only start with an alpha
// see RFC 2396 Section 3.2.2
int index = address.lastIndexOf('.');
if (address.endsWith("."))
{
index = address.substring(0, index).lastIndexOf('.');
}
if (index + 1 < addrLength && isDigit(p_address.charAt(index + 1)))
{
char testChar;
int numDots = 0;
// make sure that 1) we see only digits and dot separators, 2) that
// any dot separator is preceded and followed by a digit and
// 3) that we find 3 dots
for (int i = 0; i < addrLength; i++)
{
testChar = address.charAt(i);
if (testChar == '.')
{
if (!isDigit(address.charAt(i - 1))
|| (i + 1 < addrLength &&!isDigit(address.charAt(i + 1))))
{
return false;
}
numDots++;
}
else if (!isDigit(testChar))
{
return false;
}
}
if (numDots != 3)
{
return false;
}
}
else
{
// domain labels can contain alphanumerics and '-"
// but must start and end with an alphanumeric
char testChar;
for (int i = 0; i < addrLength; i++)
{
testChar = address.charAt(i);
if (testChar == '.')
{
if (!isAlphanum(address.charAt(i - 1)))
{
return false;
}
if (i + 1 < addrLength &&!isAlphanum(address.charAt(i + 1)))
{
return false;
}
}
else if (!isAlphanum(testChar) && testChar != '-')
{
return false;
}
}
}
return true;
}
/**
* Determine whether a char is a digit.
*
*
* NEEDSDOC @param p_char
* @return true if the char is betweeen '0' and '9', false otherwise
*/
private static boolean isDigit(char p_char)
{
return p_char >= '0' && p_char <= '9';
}
/**
* Determine whether a character is a hexadecimal character.
*
*
* NEEDSDOC @param p_char
* @return true if the char is betweeen '0' and '9', 'a' and 'f'
* or 'A' and 'F', false otherwise
*/
private static boolean isHex(char p_char)
{
return (isDigit(p_char) || (p_char >= 'a' && p_char <= 'f')
|| (p_char >= 'A' && p_char <= 'F'));
}
/**
* Determine whether a char is an alphabetic character: a-z or A-Z
*
*
* NEEDSDOC @param p_char
* @return true if the char is alphabetic, false otherwise
*/
private static boolean isAlpha(char p_char)
{
return ((p_char >= 'a' && p_char <= 'z')
|| (p_char >= 'A' && p_char <= 'Z'));
}
/**
* Determine whether a char is an alphanumeric: 0-9, a-z or A-Z
*
*
* NEEDSDOC @param p_char
* @return true if the char is alphanumeric, false otherwise
*/
private static boolean isAlphanum(char p_char)
{
return (isAlpha(p_char) || isDigit(p_char));
}
/**
* Determine whether a character is a reserved character:
* ';', '/', '?', ':', '@', '&', '=', '+', '$' or ','
*
*
* NEEDSDOC @param p_char
* @return true if the string contains any reserved characters
*/
private static boolean isReservedCharacter(char p_char)
{
return RESERVED_CHARACTERS.indexOf(p_char) != -1;
}
/**
* Determine whether a char is an unreserved character.
*
*
* NEEDSDOC @param p_char
* @return true if the char is unreserved, false otherwise
*/
private static boolean isUnreservedCharacter(char p_char)
{
return (isAlphanum(p_char) || MARK_CHARACTERS.indexOf(p_char) != -1);
}
/**
* Determine whether a given string contains only URI characters (also
* called "uric" in RFC 2396). uric consist of all reserved
* characters, unreserved characters and escaped characters.
*
*
* NEEDSDOC @param p_uric
* @return true if the string is comprised of uric, false otherwise
*/
private static boolean isURIString(String p_uric)
{
if (p_uric == null)
{
return false;
}
int end = p_uric.length();
char testChar = '\0';
for (int i = 0; i < end; i++)
{
testChar = p_uric.charAt(i);
if (testChar == '%')
{
if (i + 2 >= end ||!isHex(p_uric.charAt(i + 1))
||!isHex(p_uric.charAt(i + 2)))
{
return false;
}
else
{
i += 2;
continue;
}
}
if (isReservedCharacter(testChar) || isUnreservedCharacter(testChar))
{
continue;
}
else
{
return false;
}
}
return true;
}
}
1.1 xml-xalan/java/src/org/apache/xml/utils/UnImplNode.java
Index: UnImplNode.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
import org.w3c.dom.*;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.res.XSLMessages;
/**
* <meta name="usage" content="internal"/>
* To be subclassed by classes that wish to fake being nodes.
*/
public class UnImplNode implements Node, Element, NodeList, Document
{
/**
* Constructor UnImplNode
*
*/
public UnImplNode(){}
/**
* Throw an error.
*
* NEEDSDOC @param msg
*/
public void error(int msg)
{
System.out.println("DOM ERROR! class: " + this.getClass().getName());
throw new RuntimeException(XSLMessages.createMessage(msg, null));
}
/**
* Throw an error.
*
* NEEDSDOC @param msg
* NEEDSDOC @param args
*/
public void error(int msg, Object[] args)
{
System.out.println("DOM ERROR! class: " + this.getClass().getName());
throw new RuntimeException(XSLMessages.createMessage(msg, args));
//"UnImplNode error: "+msg);
}
/**
* Unimplemented.
*
* NEEDSDOC @param newChild
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public Node appendChild(Node newChild) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"appendChild not
supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public boolean hasChildNodes()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"hasChildNodes
not supported!");
return false;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public short getNodeType()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNodeType not
supported!");
return 0;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public Node getParentNode()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getParentNode
not supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public NodeList getChildNodes()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getChildNodes
not supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public Node getFirstChild()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getFirstChild
not supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public Node getLastChild()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getLastChild not
supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public Node getNextSibling()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNextSibling
not supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public int getLength()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getLength not
supported!");
return 0;
} // getLength():int
/**
* Unimplemented.
*
* NEEDSDOC @param index
*
* NEEDSDOC ($objectName$) @return
*/
public Node item(int index)
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"item not
supported!");
return null;
} // item(int):Node
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public Document getOwnerDocument()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getOwnerDocument
not supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public String getTagName()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getTagName not
supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public String getNodeName()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNodeName not
supported!");
return null;
}
/** Unimplemented. */
public void normalize()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"normalize not
supported!");
}
/**
* Unimplemented.
*
* NEEDSDOC @param name
*
* NEEDSDOC ($objectName$) @return
*/
public NodeList getElementsByTagName(String name)
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
//"getElementsByTagName not supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param oldAttr
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public Attr removeAttributeNode(Attr oldAttr) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
//"removeAttributeNode not supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param newAttr
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public Attr setAttributeNode(Attr newAttr) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttributeNode
not supported!");
return null;
}
/**
* NEEDSDOC Method hasAttribute
*
*
* NEEDSDOC @param name
*
* NEEDSDOC (hasAttribute) @return
*/
public boolean hasAttribute(String name)
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"hasAttribute not
supported!");
return false;
}
/**
* NEEDSDOC Method hasAttributeNS
*
*
* NEEDSDOC @param name
* NEEDSDOC @param x
*
* NEEDSDOC (hasAttributeNS) @return
*/
public boolean hasAttributeNS(String name, String x)
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"hasAttributeNS
not supported!");
return false;
}
/**
* NEEDSDOC Method getAttributeNode
*
*
* NEEDSDOC @param name
*
* NEEDSDOC (getAttributeNode) @return
*/
public Attr getAttributeNode(String name)
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttributeNode
not supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param name
*
* @throws DOMException
*/
public void removeAttribute(String name) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"removeAttribute
not supported!");
}
/**
* Unimplemented.
*
* NEEDSDOC @param name
* NEEDSDOC @param value
*
* @throws DOMException
*/
public void setAttribute(String name, String value) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttribute not
supported!");
}
/**
* Unimplemented.
*
* NEEDSDOC @param name
*
* NEEDSDOC ($objectName$) @return
*/
public String getAttribute(String name)
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttribute not
supported!");
return null;
}
/**
* Introduced in DOM Level 2.
*
* NEEDSDOC ($objectName$) @return
*/
public boolean hasAttributes()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"hasAttributes
not supported!");
return false;
}
/**
* Unimplemented.
*
* NEEDSDOC @param namespaceURI
* NEEDSDOC @param localName
*
* NEEDSDOC ($objectName$) @return
*/
public NodeList getElementsByTagNameNS(String namespaceURI,
String localName)
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
//"getElementsByTagNameNS not supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param newAttr
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public Attr setAttributeNodeNS(Attr newAttr) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
//"setAttributeNodeNS not supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param namespaceURI
* NEEDSDOC @param localName
*
* NEEDSDOC ($objectName$) @return
*/
public Attr getAttributeNodeNS(String namespaceURI, String localName)
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
//"getAttributeNodeNS not supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param namespaceURI
* NEEDSDOC @param localName
*
* @throws DOMException
*/
public void removeAttributeNS(String namespaceURI, String localName)
throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
//"removeAttributeNS not supported!");
}
/**
* Unimplemented.
*
* NEEDSDOC @param namespaceURI
* NEEDSDOC @param qualifiedName
* NEEDSDOC @param value
*
* @throws DOMException
*/
public void setAttributeNS(
String namespaceURI, String qualifiedName, String value)
throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttributeNS
not supported!");
}
/**
* Unimplemented.
*
* NEEDSDOC @param namespaceURI
* NEEDSDOC @param localName
*
* NEEDSDOC ($objectName$) @return
*/
public String getAttributeNS(String namespaceURI, String localName)
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttributeNS
not supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public Node getPreviousSibling()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
//"getPreviousSibling not supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param deep
*
* NEEDSDOC ($objectName$) @return
*/
public Node cloneNode(boolean deep)
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"cloneNode not
supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public String getNodeValue() throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNodeValue not
supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param nodeValue
*
* @throws DOMException
*/
public void setNodeValue(String nodeValue) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setNodeValue not
supported!");
}
/**
* Unimplemented.
*
* NEEDSDOC @param value
*
* @throws DOMException
*/
// public String getValue ()
// {
// error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getValue not
supported!");
// return null;
// }
/** Unimplemented. */
public void setValue(String value) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setValue not
supported!");
}
/**
* Returns the name of this attribute.
*
* NEEDSDOC ($objectName$) @return
*/
// public String getName()
// {
// return this.getNodeName();
// }
public Element getOwnerElement()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getOwnerElement
not supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public boolean getSpecified()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setValue not
supported!");
return false;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public NamedNodeMap getAttributes()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttributes
not supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param newChild
* NEEDSDOC @param refChild
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public Node insertBefore(Node newChild, Node refChild) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"insertBefore not
supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param newChild
* NEEDSDOC @param oldChild
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"replaceChild not
supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param oldChild
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public Node removeChild(Node oldChild) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"replaceChild not
supported!");
return null;
}
/**
* Tests whether the DOM implementation implements a specific feature and
* that feature is supported by this node.
* @param featureThe name of the feature to test. This is the same name
* which can be passed to the method <code>hasFeature</code> on
* <code>DOMImplementation</code>.
* @param versionThis is the version number of the feature to test. In
* Level 2, version 1, this is the string "2.0". If the version is not
* specified, supporting any version of the feature will cause the
* method to return <code>true</code>.
* @return Returns <code>true</code> if the specified feature is
* supported on this node, <code>false</code> otherwise.
* @since DOM Level 2
*/
public boolean isSupported(String feature, String version)
{
return false;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public String getNamespaceURI()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNamespaceURI
not supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public String getPrefix()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getPrefix not
supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param prefix
*
* @throws DOMException
*/
public void setPrefix(String prefix) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setPrefix not
supported!");
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public String getLocalName()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getLocalName not
supported!");
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public DocumentType getDoctype()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public DOMImplementation getImplementation()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public Element getDocumentElement()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param tagName
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public Element createElement(String tagName) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC ($objectName$) @return
*/
public DocumentFragment createDocumentFragment()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param data
*
* NEEDSDOC ($objectName$) @return
*/
public Text createTextNode(String data)
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param data
*
* NEEDSDOC ($objectName$) @return
*/
public Comment createComment(String data)
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param data
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public CDATASection createCDATASection(String data) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param target
* NEEDSDOC @param data
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public ProcessingInstruction createProcessingInstruction(
String target, String data) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param name
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public Attr createAttribute(String name) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param name
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public EntityReference createEntityReference(String name)
throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param importedNode
* NEEDSDOC @param deep
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public Node importNode(Node importedNode, boolean deep) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param namespaceURI
* NEEDSDOC @param qualifiedName
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public Element createElementNS(String namespaceURI, String qualifiedName)
throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param namespaceURI
* NEEDSDOC @param qualifiedName
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public Attr createAttributeNS(String namespaceURI, String qualifiedName)
throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param elementId
*
* NEEDSDOC ($objectName$) @return
*/
public Element getElementById(String elementId)
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
/**
* NEEDSDOC Method setData
*
*
* NEEDSDOC @param data
*
* @throws DOMException
*/
public void setData(String data) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
}
/**
* Unimplemented.
*
* NEEDSDOC @param offset
* NEEDSDOC @param count
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public String substringData(int offset, int count) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
/**
* Unimplemented.
*
* NEEDSDOC @param arg
*
* @throws DOMException
*/
public void appendData(String arg) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
}
/**
* Unimplemented.
*
* NEEDSDOC @param offset
* NEEDSDOC @param arg
*
* @throws DOMException
*/
public void insertData(int offset, String arg) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
}
/**
* Unimplemented.
*
* NEEDSDOC @param offset
* NEEDSDOC @param count
*
* @throws DOMException
*/
public void deleteData(int offset, int count) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
}
/**
* Unimplemented.
*
* NEEDSDOC @param offset
* NEEDSDOC @param count
* NEEDSDOC @param arg
*
* @throws DOMException
*/
public void replaceData(int offset, int count, String arg)
throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
}
/**
* Unimplemented.
*
* NEEDSDOC @param offset
*
* NEEDSDOC ($objectName$) @return
*
* @throws DOMException
*/
public Text splitText(int offset) throws DOMException
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/WrappedRuntimeException.java
Index: WrappedRuntimeException.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* This class is for throwing important checked exceptions
* over non-checked methods. It should be used with care,
* and in limited circumstances.
*/
public class WrappedRuntimeException extends RuntimeException
{
/** NEEDSDOC Field m_exception */
private Exception m_exception;
/**
* Construct a WrappedRuntimeException from a
* checked exception.
*
* NEEDSDOC @param e
*/
public WrappedRuntimeException(Exception e)
{
super(e.getMessage());
m_exception = e;
}
/**
* Get the checked exception that this runtime exception wraps.
*
* NEEDSDOC ($objectName$) @return
*/
public Exception getException()
{
return m_exception;
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/WrongParserException.java
Index: WrongParserException.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* <meta name="usage" content="general"/>
* Certain functions may throw this error if they are paired with
* the incorrect parser.
*/
public class WrongParserException extends RuntimeException
{
/**
* Create a WrongParserException object.
* @param message The error message that should be reported to the user.
*/
public WrongParserException(String message)
{
super(message);
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/XMLCharacterRecognizer.java
Index: XMLCharacterRecognizer.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils;
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class XMLCharacterRecognizer <needs-comment/>
*/
public class XMLCharacterRecognizer
{
/**
* Returns whether the specified <var>ch</var> conforms to the XML 1.0
definition
* of whitespace. Refer to <A
href="http://www.w3.org/TR/1998/REC-xml-19980210#NT-S">
* the definition of <CODE>S</CODE></A> for details.
* @param ch Character to check as XML whitespace.
* @return =true if <var>ch</var> is XML whitespace; otherwise
=false.
*/
public static boolean isWhiteSpace(char ch)
{
return (ch == 0x20) || (ch == 0x09) || (ch == 0xD) || (ch == 0xA);
}
/**
* Tell if the string is whitespace.
* @param string String to be trimmed.
*
* NEEDSDOC @param ch
* NEEDSDOC @param start
* NEEDSDOC @param length
* @return The trimmed string.
*/
public static boolean isWhiteSpace(char ch[], int start, int length)
{
int end = start + length;
for (int s = start; s < end; s++)
{
if (!isWhiteSpace(ch[s]))
return false;
}
return true;
}
/**
* Tell if the string is whitespace.
* @param string String to be trimmed.
*
* NEEDSDOC @param buf
* @return The trimmed string.
*/
public static boolean isWhiteSpace(StringBuffer buf)
{
int n = buf.length();
for (int i = 0; i < n; i++)
{
if (!isWhiteSpace(buf.charAt(i)))
return false;
}
return true;
}
}
1.1 xml-xalan/java/src/org/apache/xml/utils/package.html
Index: package.html
===================================================================
<html>
<title>Xalan utilities.</title>
<body>
<p>Implementation of Xalan utility classes. This package is also shared
by XPath.
There *should* be no outward dependencies to XPath or Xalan by classes
in this package.<p>
<dl>
<dt><b>Version: </b></dt><dd>Alpha, 2.0.0, July 05, 2000</dd>
<dt><b>Author: </b></dt><dd><a href="mailto:[EMAIL PROTECTED]">Scott
Boag</a></dd>
</dl>
</body>
</html>
1.1
xml-xalan/java/src/org/apache/xml/utils/res/XResourceBundle.java
Index: XResourceBundle.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.res;
import org.apache.xml.utils.res.XResourceBundleBase;
import java.util.*;
/**
* <meta name="usage" content="internal"/>
* The default (english) resource bundle.
*/
public class XResourceBundle extends ListResourceBundle
{
/** Error resource constants */
public static final String ERROR_RESOURCES =
"org.apache.xalan.res.XSLTErrorResources", XSLT_RESOURCE =
"org.apache.xml.utils.res.XResourceBundle", LANG_BUNDLE_NAME =
"org.apache.xalan.res.XSLTResources", MULT_ORDER =
"multiplierOrder", MULT_PRECEDES = "precedes", MULT_FOLLOWS =
"follows", LANG_ORIENTATION = "orientation", LANG_RIGHTTOLEFT =
"rightToLeft", LANG_LEFTTORIGHT = "leftToRight", LANG_NUMBERING =
"numbering", LANG_ADDITIVE = "additive", LANG_MULT_ADD =
"multiplicative-additive", LANG_MULTIPLIER =
"multiplier", LANG_MULTIPLIER_CHAR =
"multiplierChar", LANG_NUMBERGROUPS = "numberGroups", LANG_NUM_TABLES =
"tables", LANG_ALPHABET = "alphabet", LANG_TRAD_ALPHABET = "tradAlphabet";
/**
* Return a named ResourceBundle for a particular locale. This method
mimics the behavior
* of ResourceBundle.getBundle().
*
* @param className Name of local-specific subclass.
* @param locale the locale to prefer when searching for the bundle
*/
public static final XResourceBundle loadResourceBundle(
String className, Locale locale) throws MissingResourceException
{
String suffix = getResourceSuffix(locale);
//System.out.println("resource " + className + suffix);
try
{
// first try with the given locale
return (XResourceBundle) ResourceBundle.getBundle(className
+ suffix, locale);
}
catch (MissingResourceException e)
{
try // try to fall back to en_US if we can't load
{
// Since we can't find the localized property file,
// fall back to en_US.
return (XResourceBundle) ResourceBundle.getBundle(
XSLT_RESOURCE, new Locale("en", "US"));
}
catch (MissingResourceException e2)
{
// Now we are really in trouble.
// very bad, definitely very bad...not going to get very far
throw new MissingResourceException(
"Could not load any resource bundles.", className, "");
}
}
}
/**
* Return the resource file suffic for the indicated locale
* For most locales, this will be based the language code. However
* for Chinese, we do distinguish between Taiwan and PRC
*
* @param locale the locale
* @return an String suffix which canbe appended to a resource name
*/
private static final String getResourceSuffix(Locale locale)
{
String lang = locale.getLanguage();
String country = locale.getCountry();
String variant = locale.getVariant();
String suffix = "_" + locale.getLanguage();
if (lang.equals("zh"))
suffix += "_" + country;
if (country.equals("JP"))
suffix += "_" + country + "_" + variant;
return suffix;
}
/**
* Get the association list.
*
* @return The association list.
*/
public Object[][] getContents()
{
return contents;
}
/** The association list. */
static final Object[][] contents =
{
{ "ui_language", "en" }, { "help_language", "en" }, { "language", "en" },
{ "alphabet",
new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z' } },
{ "tradAlphabet",
new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z' } },
//language orientation
{ "orientation", "LeftToRight" },
//language numbering
{ "numbering", "additive" },
};
}
1.1
xml-xalan/java/src/org/apache/xml/utils/res/XResourceBundleBase.java
Index: XResourceBundleBase.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.res;
import java.util.ListResourceBundle;
/**
* <meta name="usage" content="internal"/>
* This is an interface for error messages. This class is misnamed,
* and should be called XalanResourceBundle, or some such.
*/
abstract public class XResourceBundleBase extends ListResourceBundle
{
/**
* Get the error string associated with the error code
*
* NEEDSDOC @param errorCode
*
* NEEDSDOC ($objectName$) @return
*/
abstract public String getMessageKey(int errorCode);
/**
* Get the error string associated with the error code
*
* NEEDSDOC @param errorCode
*
* NEEDSDOC ($objectName$) @return
*/
abstract public String getWarningKey(int errorCode);
}
1.1
xml-xalan/java/src/org/apache/xml/utils/res/XResources_cy.java
Index: XResources_cy.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.res;
import org.apache.xml.utils.res.XResourceBundle;
import java.util.*;
//
// LangResources_en.properties
//
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class XResources_cy <needs-comment/>
*/
public class XResources_cy extends XResourceBundle
{
/**
* NEEDSDOC Method getContents
*
*
* NEEDSDOC (getContents) @return
*/
public Object[][] getContents()
{
return contents;
}
/** NEEDSDOC Field contents */
static final Object[][] contents =
{
{ "ui_language", "cy" }, { "help_language", "cy" }, { "language", "cy" },
{ "alphabet",
new char[]{ 0x0430, 0x0432, 0x0433, 0x0434, 0x0435, 0x0437, 0x0438,
0x0439, 0x04A9, 0x0457, 0x043A, 0x043B, 0x043C, 0x043D,
0x046F, 0x043E, 0x043F, 0x0447, 0x0440, 0x0441, 0x0442,
0x0443, 0x0444, 0x0445, 0x0470, 0x0460, 0x0446 } },
{ "tradAlphabet",
new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z' } },
//language orientation
{ "orientation", "LeftToRight" },
//language numbering
//{"numbering", "additive"},
{ "numbering", "multiplicative-additive" },
{ "multiplierOrder", "precedes" },
// largest numerical value
//{"MaxNumericalValue", new Integer(10000000000)},
//These would not be used for EN. Only used for traditional numbering
{ "numberGroups", new int[]{ 100, 10, 1 } },
//These only used for mutiplicative-additive numbering
{ "multiplier", new int[]{ 1000 } },
{ "multiplierChar", new char[]{ 0x03D9 } },
// chinese only??
{ "zero", new char[0] },
//{"digits", new char[]{'a','b','c','d','e','f','g','h','i'}},
{ "digits",
new char[]{ 0x0430, 0x0432, 0x0433, 0x0434, 0x0435, 0x0437, 0x0438,
0x0439, 0x04A9 } },
{ "tens",
new char[]{ 0x0457, 0x043A, 0x043B, 0x043C, 0x043D, 0x046F, 0x043E,
0x043F, 0x0447 } },
{ "hundreds",
new char[]{ 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0470,
0x0460, 0x0446 } },
{ "tables", new String[]{ "hundreds", "tens", "digits" } }
};
}
1.1
xml-xalan/java/src/org/apache/xml/utils/res/XResources_el.java
Index: XResources_el.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.res;
import org.apache.xml.utils.res.XResourceBundle;
import java.util.*;
//
// LangResources_en.properties
//
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class XResources_el <needs-comment/>
*/
public class XResources_el extends XResourceBundle
{
/**
* NEEDSDOC Method getContents
*
*
* NEEDSDOC (getContents) @return
*/
public Object[][] getContents()
{
return contents;
}
/** NEEDSDOC Field contents */
static final Object[][] contents =
{
{ "ui_language", "el" }, { "help_language", "el" }, { "language", "el" },
{ "alphabet",
new char[]{ 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be,
0x03bf, 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5,
0x03c6, 0x03c7, 0x03c8, 0x03c9 } },
{ "tradAlphabet",
new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z' } },
//language orientation
{ "orientation", "LeftToRight" },
//language numbering
//{"numbering", "additive"},
{ "numbering", "multiplicative-additive" },
{ "multiplierOrder", "precedes" },
// largest numerical value
//{"MaxNumericalValue", new Integer()},
//These would not be used for EN. Only used for traditional numbering
{ "numberGroups", new int[]{ 100, 10, 1 } },
//These only used for mutiplicative-additive numbering
{ "multiplier", new int[]{ 1000 } },
{ "multiplierChar", new char[]{ 0x03d9 } },
// chinese only??
{ "zero", new char[0] },
//{"digits", new char[]{'a','b','c','d','e','f','g','h','i'}},
{ "digits",
new char[]{ 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03db, 0x03b6,
0x03b7, 0x03b8 } },
{ "tens",
new char[]{ 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
0x03c0, 0x03df } },
{ "hundreds",
new char[]{ 0x03c1, 0x03c2, 0x03c4, 0x03c5, 0x03c6, 0x03c7, 0x03c8,
0x03c9, 0x03e1 } },
//{"thousands", new
char[]{0x10D9,0x10DA,0x10DB,0x10DC,0x10DD,0x10DE,0x10DF,0x10E0,0x10E1}},
//hundreds, etc...
{ "tables", new String[]{ "hundreds", "tens", "digits" } }
};
}
1.1
xml-xalan/java/src/org/apache/xml/utils/res/XResources_en.java
Index: XResources_en.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.res;
import org.apache.xml.utils.res.XResourceBundle;
import java.util.*;
//
// LangResources_en.properties
//
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class XResources_en <needs-comment/>
*/
public class XResources_en extends XResourceBundle
{
/**
* NEEDSDOC Method getContents
*
*
* NEEDSDOC (getContents) @return
*/
public Object[][] getContents()
{
return contents;
}
/** NEEDSDOC Field contents */
static final Object[][] contents =
{
{ "ui_language", "en" }, { "help_language", "en" }, { "language", "en" },
{ "alphabet",
new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z' } },
{ "tradAlphabet",
new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z' } },
//language orientation
{ "orientation", "LeftToRight" },
//language numbering
{ "numbering", "additive" },
// largest numerical value
//{"MaxNumericalValue", new Integer()},
//These would not be used for EN. Only used for traditional numbering
//{"numberGroups", new int[]{10,1}},
//These only used for mutiplicative-additive numbering
//{"multiplier", "10"},
//{"multiplierChar", "M"},
//{"digits", new char[]{'a','b','c','d','e','f','g','h','i'}},
//{"digits", new
char[]{0x10D0,0x10D1,0x10D2,0x10D3,0x10D4,0x10D5,0x10D6,0x10D7,0x10D8}},
//{"tens", new
char[]{0x10D9,0x10DA,0x10DB,0x10DC,0x10DD,0x10DE,0x10DF,0x10E0,0x10E1}},
//hundreds, etc...
//{"tables", new String[]{"tens", "digits"}}
};
}
1.1
xml-xalan/java/src/org/apache/xml/utils/res/XResources_he.java
Index: XResources_he.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.res;
import org.apache.xml.utils.res.XResourceBundle;
import java.util.*;
//
// LangResources_en.properties
//
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class XResources_he <needs-comment/>
*/
public class XResources_he extends XResourceBundle
{
/**
* NEEDSDOC Method getContents
*
*
* NEEDSDOC (getContents) @return
*/
public Object[][] getContents()
{
return contents;
}
/** NEEDSDOC Field contents */
static final Object[][] contents =
{
{ "ui_language", "he" }, { "help_language", "he" }, { "language", "he" },
{ "alphabet",
new char[]{ 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6,
0x05D7, 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD,
0x05DE, 0x05DF, 0x05E0, 0x05E1 } },
{ "tradAlphabet",
new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z' } },
//language orientation
{ "orientation", "RightToLeft" },
//language numbering
{ "numbering", "additive" },
// largest numerical value
//{"MaxNumericalValue", new Integer()},
//These would not be used for EN. Only used for traditional numbering
{ "numberGroups", new int[]{ 10, 1 } },
//These only used for mutiplicative-additive numbering
//{"multiplier", "10"},
//{"multiplierChar", "M"},
//{"digits", new char[]{'a','b','c','d','e','f','g','h','i'}},
{ "digits",
new char[]{ 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6,
0x05D7, 0x05D8 } },
{ "tens",
new char[]{ 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
0x05E0, 0x05E1 } },
//hundreds, etc...
{ "tables", new String[]{ "tens", "digits" } }
};
}
1.1
xml-xalan/java/src/org/apache/xml/utils/res/XResources_hy.java
Index: XResources_hy.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.res;
import org.apache.xml.utils.res.XResourceBundle;
import java.util.*;
//
// LangResources_en.properties
//
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class XResources_hy <needs-comment/>
*/
public class XResources_hy extends XResourceBundle
{
/**
* NEEDSDOC Method getContents
*
*
* NEEDSDOC (getContents) @return
*/
public Object[][] getContents()
{
return contents;
}
/** NEEDSDOC Field contents */
static final Object[][] contents =
{
{ "ui_language", "hy" }, { "help_language", "hy" }, { "language", "hy" },
{ "alphabet",
new char[]{ 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567,
0x0568, 0x0569, 0x056A, 0x056B, 0x056C, 0x056D, 0x056E,
0x056F, 0x0567, 0x0568, 0x0572, 0x0573, 0x0574, 0x0575,
0x0576, 0x0577, 0x0578, 0x0579, 0x057A, 0x057B, 0x057C,
0x057D, 0x057E, 0x057F, 0x0580, 0x0581, 0x0582, 0x0583,
0x0584 } },
{ "tradAlphabet",
new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z' } },
//language orientation
{ "orientation", "LeftToRight" },
//language numbering
{ "numbering", "additive" },
// largest numerical value
//{"MaxNumericalValue", new Integer()},
//These would not be used for EN. Only used for traditional numbering
{ "numberGroups", new int[]{ 1000, 100, 10, 1 } },
//These only used for mutiplicative-additive numbering
//{"multiplier", "10"},
//{"multiplierChar", "M"},
//{"digits", new char[]{'a','b','c','d','e','f','g','h','i'}},
{ "digits",
new char[]{ 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567,
0x0568, 0x0569 } },
{ "tens",
new char[]{ 0x056A, 0x056B, 0x056C, 0x056D, 0x056E, 0x056F, 0x0567,
0x0568, 0x0572 } },
{ "hundreds",
new char[]{ 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, 0x0578, 0x0579,
0x057A, 0x057B } },
{ "thousands",
new char[]{ 0x057C, 0x057D, 0x057E, 0x057F, 0x0580, 0x0581, 0x0582,
0x0583, 0x0584 } },
{ "tables", new String[]{ "thousands", "hundreds", "tens", "digits" } }
};
}
1.1
xml-xalan/java/src/org/apache/xml/utils/res/XResources_ja_JP_A.java
Index: XResources_ja_JP_A.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.res;
import org.apache.xml.utils.res.XResourceBundle;
import java.util.*;
//
// LangResources_en.properties
//
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class XResources_ja_JP_A <needs-comment/>
*/
public class XResources_ja_JP_A extends XResourceBundle
{
/**
* NEEDSDOC Method getContents
*
*
* NEEDSDOC (getContents) @return
*/
public Object[][] getContents()
{
return contents;
}
/** NEEDSDOC Field contents */
static final Object[][] contents =
{
{ "ui_language", "ja" }, { "help_language", "ja" }, { "language", "ja" },
{ "alphabet",
new char[]{ 0x30a2, 0x30a4, 0x30a6, 0x30a8, 0x30aa, 0x30ab, 0x30ad,
0x30af, 0x30b1, 0x30b3, 0x30b5, 0x30b7, 0x30b9, 0x30bb,
0x30bd, 0x30bf, 0x30c1, 0x30c4, 0x30c6, 0x30c8, 0x30ca,
0x30cb, 0x30cc, 0x30cd, 0x30ce, 0x30cf, 0x30d2, 0x30d5,
0x30d8, 0x30db, 0x30de, 0x30df, 0x30e0, 0x30e1, 0x30e2,
0x30e4, 0x30e6, 0x30e8, 0x30e9, 0x30ea, 0x30eb, 0x30ec,
0x30ed, 0x30ef, 0x30f0, 0x30f1, 0x30f2, 0x30f3 } },
{ "tradAlphabet",
new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z' } },
//language orientation
{ "orientation", "LeftToRight" },
//language numbering
{ "numbering", "multiplicative-additive" },
{ "multiplierOrder", "follows" },
// largest numerical value
//{"MaxNumericalValue", new Integer(10000000000)},
//These would not be used for EN. Only used for traditional numbering
{ "numberGroups", new int[]{ 1 } },
//These only used for mutiplicative-additive numbering
{ "multiplier",
new int[]{ 1000000000, 100000000, 10000, 1000, 100, 10 } },
{ "multiplierChar",
new char[]{ 0x4EAC, 0x5146, 0x5104, 0x4E07, 0x5343, 0x767e, 0x5341 } },
// chinese only?
{ "zero", new char[0] },
{ "digits",
new char[]{ 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03,
0x516B, 0x4E5D } }, { "tables", new String[]{ "digits" } }
};
}
1.1
xml-xalan/java/src/org/apache/xml/utils/res/XResources_ja_JP_HA.java
Index: XResources_ja_JP_HA.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.res;
import org.apache.xml.utils.res.XResourceBundle;
import java.util.*;
//
// LangResources_en.properties
//
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class XResources_ja_JP_HA <needs-comment/>
*/
public class XResources_ja_JP_HA extends XResourceBundle
{
/**
* NEEDSDOC Method getContents
*
*
* NEEDSDOC (getContents) @return
*/
public Object[][] getContents()
{
return contents;
}
/** NEEDSDOC Field contents */
static final Object[][] contents =
{
{ "ui_language", "ja" }, { "help_language", "ja" }, { "language", "ja" },
{ "alphabet",
new char[]{ 0x3042, 0x3044, 0x3046, 0x3048, 0x304a, 0x304b, 0x304d,
0x304f, 0x3051, 0x3053, 0x3055, 0x3057, 0x3059, 0x305b,
0x305d, 0x305f, 0x3061, 0x3064, 0x3066, 0x3068, 0x306a,
0x306b, 0x306c, 0x306d, 0x306e, 0x306f, 0x3072, 0x3075,
0x3078, 0x307b, 0x307e, 0x307f, 0x3080, 0x3081, 0x3082,
0x3084, 0x3086, 0x3088, 0x3089, 0x308a, 0x308b, 0x308c,
0x308d, 0x308f, 0x3090, 0x3091, 0x3092, 0x3093 } },
{ "tradAlphabet",
new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z' } },
//language orientation
{ "orientation", "LeftToRight" },
//language numbering
{ "numbering", "multiplicative-additive" },
{ "multiplierOrder", "follows" },
// largest numerical value
//{"MaxNumericalValue", new Integer(10000000000)},
//These would not be used for EN. Only used for traditional numbering
{ "numberGroups", new int[]{ 1 } },
//These only used for mutiplicative-additive numbering
{ "multiplier",
new int[]{ 1000000000, 100000000, 10000, 1000, 100, 10 } },
{ "multiplierChar",
new char[]{ 0x4EAC, 0x5146, 0x5104, 0x4E07, 0x5343, 0x767e, 0x5341 } },
// chinese only?
{ "zero", new char[0] },
{ "digits",
new char[]{ 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03,
0x516B, 0x4E5D } }, { "tables", new String[]{ "digits" } }
};
}
1.1
xml-xalan/java/src/org/apache/xml/utils/res/XResources_ja_JP_HI.java
Index: XResources_ja_JP_HI.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.res;
import org.apache.xml.utils.res.XResourceBundle;
import java.util.*;
//
// LangResources_en.properties
//
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class XResources_ja_JP_HI <needs-comment/>
*/
public class XResources_ja_JP_HI extends XResourceBundle
{
/**
* NEEDSDOC Method getContents
*
*
* NEEDSDOC (getContents) @return
*/
public Object[][] getContents()
{
return contents;
}
/** NEEDSDOC Field contents */
static final Object[][] contents =
{
{ "ui_language", "ja" }, { "help_language", "ja" }, { "language", "ja" },
{ "alphabet",
new char[]{ 0x3044, 0x308d, 0x306f, 0x306b, 0x307b, 0x3078, 0x3068,
0x3061, 0x308a, 0x306c, 0x308b, 0x3092, 0x308f, 0x304b,
0x3088, 0x305f, 0x308c, 0x305d, 0x3064, 0x306d, 0x306a,
0x3089, 0x3080, 0x3046, 0x3090, 0x306e, 0x304a, 0x304f,
0x3084, 0x307e, 0x3051, 0x3075, 0x3053, 0x3048, 0x3066,
0x3042, 0x3055, 0x304d, 0x3086, 0x3081, 0x307f, 0x3057,
0x3091, 0x3072, 0x3082, 0x305b, 0x3059 } },
{ "tradAlphabet",
new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z' } },
//language orientation
{ "orientation", "LeftToRight" },
//language numbering
{ "numbering", "multiplicative-additive" },
{ "multiplierOrder", "follows" },
// largest numerical value
//{"MaxNumericalValue", new Integer(10000000000)},
//These would not be used for EN. Only used for traditional numbering
{ "numberGroups", new int[]{ 1 } },
//These only used for mutiplicative-additive numbering
{ "multiplier",
new int[]{ 1000000000, 100000000, 10000, 1000, 100, 10 } },
{ "multiplierChar",
new char[]{ 0x4EAC, 0x5146, 0x5104, 0x4E07, 0x5343, 0x767e, 0x5341 } },
// chinese only??
{ "zero", new char[0] },
{ "digits",
new char[]{ 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03,
0x516B, 0x4E5D } }, { "tables", new String[]{ "digits" } }
};
}
1.1
xml-xalan/java/src/org/apache/xml/utils/res/XResources_ja_JP_I.java
Index: XResources_ja_JP_I.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.res;
import org.apache.xml.utils.res.XResourceBundle;
import java.util.*;
//
// LangResources_en.properties
//
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class XResources_ja_JP_I <needs-comment/>
*/
public class XResources_ja_JP_I extends XResourceBundle
{
/**
* NEEDSDOC Method getContents
*
*
* NEEDSDOC (getContents) @return
*/
public Object[][] getContents()
{
return contents;
}
/** NEEDSDOC Field contents */
static final Object[][] contents =
{
{ "ui_language", "ja" }, { "help_language", "ja" }, { "language", "ja" },
{ "alphabet",
new char[]{ 0x30a4, 0x30ed, 0x30cf, 0x30cb, 0x30db, 0x30d8, 0x30c8,
0x30c1, 0x30ea, 0x30cc, 0x30eb, 0x30f2, 0x30ef, 0x30ab,
0x30e8, 0x30bf, 0x30ec, 0x30bd, 0x30c4, 0x30cd, 0x30ca,
0x30e9, 0x30e0, 0x30a6, 0x30f0, 0x30ce, 0x30aa, 0x30af,
0x30e4, 0x30de, 0x30b1, 0x30d5, 0x30b3, 0x30a8, 0x30c6,
0x30a2, 0x30b5, 0x30ad, 0x30e6, 0x30e1, 0x30df, 0x30b7,
0x30f1, 0x30d2, 0x30e2, 0x30bb, 0x30b9 } },
{ "tradAlphabet",
new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z' } },
//language orientation
{ "orientation", "LeftToRight" },
//language numbering
{ "numbering", "multiplicative-additive" },
{ "multiplierOrder", "follows" },
// largest numerical value
//{"MaxNumericalValue", new Integer(10000000000)},
//These would not be used for EN. Only used for traditional numbering
{ "numberGroups", new int[]{ 1 } },
//These only used for mutiplicative-additive numbering
{ "multiplier",
new int[]{ 1000000000, 100000000, 10000, 1000, 100, 10 } },
{ "multiplierChar",
new char[]{ 0x4EAC, 0x5146, 0x5104, 0x4E07, 0x5343, 0x767e, 0x5341 } },
// chinese only??
{ "zero", new char[0] },
{ "digits",
new char[]{ 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03,
0x516B, 0x4E5D } }, { "tables", new String[]{ "digits" } }
};
}
1.1
xml-xalan/java/src/org/apache/xml/utils/res/XResources_ka.java
Index: XResources_ka.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.res;
import org.apache.xml.utils.res.XResourceBundle;
import java.util.*;
//
// LangResources_en.properties
//
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class XResources_ka <needs-comment/>
*/
public class XResources_ka extends XResourceBundle
{
/**
* NEEDSDOC Method getContents
*
*
* NEEDSDOC (getContents) @return
*/
public Object[][] getContents()
{
return contents;
}
/** NEEDSDOC Field contents */
static final Object[][] contents =
{
{ "ui_language", "ka" }, { "help_language", "ka" }, { "language", "ka" },
{ "alphabet",
new char[]{ 0x10D0, 0x10D1, 0x10D2, 0x10D3, 0x10D4, 0x10D5, 0x10D6,
0x10f1, 0x10D7, 0x10D8, 0x10D9, 0x10DA, 0x10DB, 0x10DC,
0x10f2, 0x10DD, 0x10DE, 0x10DF, 0x10E0, 0x10E1, 0x10E2,
0x10E3, 0x10E4, 0x10E5, 0x10E6, 0x10E7, 0x10E8, 0x10E9,
0x10EA, 0x10EB, 0x10EC, 0x10ED, 0x10EE, 0x10F4, 0x10EF,
0x10F0 } },
{ "tradAlphabet",
new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z' } },
//language orientation
{ "orientation", "LeftToRight" },
//language numbering
{ "numbering", "additive" },
// largest numerical value
//{"MaxNumericalValue", new Integer(10000000000)},
//These would not be used for EN. Only used for traditional numbering
{ "numberGroups", new int[]{ 1000, 100, 10, 1 } },
//These used for additive numbering
{ "digits",
new char[]{ 0x10D0, 0x10D1, 0x10D2, 0x10D3, 0x10D4, 0x10D5, 0x10D6,
0x10f1, 0x10D7 } },
{ "tens",
new char[]{ 0x10D8, 0x10D9, 0x10DA, 0x10DB, 0x10DC, 0x10f2, 0x10DD,
0x10DE, 0x10DF } },
{ "hundreds",
new char[]{ 0x10E0, 0x10E1, 0x10E2, 0x10E3, 0x10E4, 0x10E5, 0x10E6,
0x10E7, 0x10E8 } },
{ "thousands",
new char[]{ 0x10E9, 0x10EA, 0x10EB, 0x10EC, 0x10ED, 0x10EE, 0x10F4,
0x10EF, 0x10F0 } },
{ "tables", new String[]{ "thousands", "hundreds", "tens", "digits" } }
};
}
1.1
xml-xalan/java/src/org/apache/xml/utils/res/XResources_zh_CN.java
Index: XResources_zh_CN.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.res;
import org.apache.xml.utils.res.XResourceBundle;
import java.util.*;
//
// LangResources_en.properties
//
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class XResources_zh_CN <needs-comment/>
*/
public class XResources_zh_CN extends XResourceBundle
{
/**
* NEEDSDOC Method getContents
*
*
* NEEDSDOC (getContents) @return
*/
public Object[][] getContents()
{
return contents;
}
/** NEEDSDOC Field contents */
static final Object[][] contents =
{
{ "ui_language", "zh" }, { "help_language", "zh" }, { "language", "zh" },
{ "alphabet",
new char[]{ 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27,
0xff28, 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e,
0xff2f, 0xff30, 0xff31, 0xff32, 0xff33, 0xff34, 0xff35,
0xff36, 0xff37, 0xff38, 0xff39, 0xff3a } },
{ "tradAlphabet",
new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z' } },
//language orientation
{ "orientation", "LeftToRight" },
//language numbering
{ "numbering", "multiplicative-additive" },
{ "multiplierOrder", "follows" },
// largest numerical value
//{"MaxNumericalValue", new Integer(100000000)},
//These would not be used for EN. Only used for traditional numbering
{ "numberGroups", new int[]{ 1 } },
// simplified chinese
{ "zero", new char[]{ 0x96f6 } },
//These only used for mutiplicative-additive numbering
{ "multiplier", new int[]{ 100000000, 10000, 1000, 100, 10 } },
{ "multiplierChar",
new char[]{ 0x4ebf, 0x4e07, 0x5343, 0x767e, 0x5341 } },
{ "digits",
new char[]{ 0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x4e94, 0x516d, 0x4e03,
0x516b, 0x4e5d } }, { "tables", new String[]{ "digits" } }
};
}
1.1
xml-xalan/java/src/org/apache/xml/utils/res/XResources_zh_TW.java
Index: XResources_zh_TW.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.res;
import org.apache.xml.utils.res.XResourceBundle;
import java.util.*;
//
// LangResources_en.properties
//
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class XResources_zh_TW <needs-comment/>
*/
public class XResources_zh_TW extends XResourceBundle
{
/**
* NEEDSDOC Method getContents
*
*
* NEEDSDOC (getContents) @return
*/
public Object[][] getContents()
{
return contents;
}
/** NEEDSDOC Field contents */
static final Object[][] contents =
{
{ "ui_language", "zh" }, { "help_language", "zh" }, { "language", "zh" },
{ "alphabet",
new char[]{ 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27,
0xff28, 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e,
0xff2f, 0xff30, 0xff31, 0xff32, 0xff33, 0xff34, 0xff35,
0xff36, 0xff37, 0xff38, 0xff39, 0xff3a } },
{ "tradAlphabet",
new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z' } },
//language orientation
{ "orientation", "LeftToRight" },
//language numbering
{ "numbering", "multiplicative-additive" },
{ "multiplierOrder", "follows" },
// largest numerical value
//{"MaxNumericalValue", new Integer(100000000)},
//These would not be used for EN. Only used for traditional numbering
{ "numberGroups", new int[]{ 1 } },
// simplified chinese
{ "zero", new char[]{ 0x96f6 } },
//These only used for mutiplicative-additive numbering
{ "multiplier", new int[]{ 100000000, 10000, 1000, 100, 10 } },
{ "multiplierChar",
new char[]{ 0x5104, 0x842c, 0x4edf, 0x4f70, 0x62fe } },
{ "digits",
new char[]{ 0x58f9, 0x8cb3, 0x53c3, 0x8086, 0x4f0d, 0x9678, 0x67d2,
0x634c, 0x7396 } }, { "tables", new String[]{ "digits" } }
};
}
1.1
xml-xalan/java/src/org/apache/xml/utils/synthetic/Class.java
Index: Class.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.synthetic;
import org.apache.xml.utils.synthetic.SynthesisException;
import org.apache.xml.utils.synthetic.reflection.Constructor;
import org.apache.xml.utils.synthetic.reflection.Method;
import org.apache.xml.utils.synthetic.reflection.Field;
import java.lang.reflect.Modifier;
/* ***** WORK NEEDED:
Factories/Libraries: We currently have forClass and
forName(request reified, complain if no real class),
and declareClass (request unreified, create unreified
if it doesn't exist). What about ther user expectations
-- should we have a full matrix, rather than asking
users to write wrappers?
Reflection doesn't tell us about deprecation. If we want
that info, MFC advises mousing our way into the bytecodes.
(Ugh). Should we at least model that for synthetics?
*/
/**
* org.apache.xml.utils.synthetic.Class is a mutable equivalent of
java.lang.Class.
* Instances represent classes and interfaces in a running Java
* application, or class descriptions under construction. In the
* former case, org.apache.xml.utils.synthetic.Class operates as a proxy for
the
* "real" java.lang.Class object; in the latter, it consults
* data structures defined in the org.apache.xml.utils.synthetic.reflection.*
package.
* <p>
* Unlike java.lang.Class, org.apache.xml.utils.synthetic.Class has a pair of
factories
* (fromName and fromClass). It can also be switched from synthetic
* to proxy operation after construction, by setting the realClass
* property; this is intended to allow these definitions to be
* "compiled in place".
* <p>
* For convenient use, org.apache.xml.utils.synthetic.Class implements an
extended
* version of the java.lang.Class API -- but is not a subclass
* thereof, since java.lang.Class is Final (presumably for
* security reasons).
* <p>
* DEVELOPMENT NOTE: Methods not yet implemented will throw
* IllegalStateException
* <p>
* I've added code to convert primitive names into their TYPEs,
* to accept foo[] as a synonym for [Lfoo, and to generate
* the right thing on output (getJava[Short]Name).
* Useful extension for code generation from Java-like
* source. We may want to factor these and toSource out, making
* org.apache.xml.utils.synthetic.Class addess only the JVM level and
providing
* subclasses or access tools that handle language syntax
* (Java source, NetRexx source, etc.)
*
* @since 2000/2/10
* @see java.lang.class
* @see defineClass
*/
public class Class extends Object implements java.io.Serializable
{
/** Class descriptions currently existing. */
private static java.util.Hashtable global_classtable =
new java.util.Hashtable();
/** fully-qualified path.classname */
private java.lang.String name;
/**
* Actual Java class object. When present, all interactions
* are redirected to it. Allows our Class to function as a
* wrapper for the Java version (in lieu of subclassing or
* a shared Interface), and allows "in-place compilation"
* to replace a generated description with an
* directly runnable class.
*/
private java.lang.Class realclass = null;
/** NEEDSDOC Field modifiers */
private int modifiers;
/** NEEDSDOC Field isInterface */
private boolean isInterface = false;
/** NEEDSDOC Field superclass */
private Class superclass = null;
/** NEEDSDOC Field declaringclass */
private Class declaringclass = null;
/** NEEDSDOC Field interfaces */
private Class[] interfaces = new Class[0];
/** NEEDSDOC Field allclasses */
private Class[] allclasses = new Class[0];
/** NEEDSDOC Field declaredclasses */
private Class[] declaredclasses = new Class[0];
/** NEEDSDOC Field allconstructors */
private Constructor[] allconstructors = new Constructor[0];
/** NEEDSDOC Field declaredconstructors */
private Constructor[] declaredconstructors = new Constructor[0];
/** NEEDSDOC Field allmethods */
private Method[] allmethods = new Method[0];
/** NEEDSDOC Field declaredmethods */
private Method[] declaredmethods = new Method[0];
/** NEEDSDOC Field allfields */
private Field[] allfields = new Field[0];
/** NEEDSDOC Field declaredfields */
private Field[] declaredfields = new Field[0];
/** NEEDSDOC Field innerclasses */
private Class[] innerclasses = new Class[0];
/**
* Construct a synthetic class as proxy/wrapper for an existing
* Java Class. Non-public; most folks should use
* .forName and .forClass to request these wrappers, so they
* get the shared instances.
* <p>
* Creation date: (12-25-99 12:16:15 PM)
* @param realclass java.lang.Class
*/
Class(java.lang.Class realclass)
{
this(realclass.getName());
try
{
setRealClass(realclass);
}
catch (SynthesisException e)
{
e.printStackTrace();
}
}
/**
* Construct a named-but-empty synthetic Class object.
* Non-public; most folks should use
* .forName and .forClass to request these wrappers, so they
* get the shared instances.
* <p>
* Creation date: (12-25-99 12:15:23 PM)
* @param name java.lang.String
*
* NEEDSDOC @param fullname
*/
Class(String fullname)
{
this.name = fullname;
global_classtable.put(fullname, this);
}
/**
* Returns the synthetic Class object associated with the "real"
* class specified, creating one if it didn't already exist.
* <p>
* For example, the following code fragment returns
* the runtime Class descriptor for the class named
* mypackage.MyClass.
* <code>
* Class t =
* Class.forName(java.lang.Class.forName("mypackage.MyClass"))
* </code>
* <p>
* Note that if the user has manually created a
org.apache.xml.utils.synthetic.Class
* with the same name before this call is issued, that object
* will be found instead. See also the declareClass call.
* <p>
* We need a better way to declare/define array classes,
* given a class object (synthetic or not).
*
* @param cls the desired Java class.
* @return the synthetic Class descriptor for the specified class.
*/
public static Class forClass(java.lang.Class cls)
{
if (cls == null)
return null;
Class ret = (Class) (global_classtable.get(cls.getName()));
if (null == ret)
ret = new Class(cls);
return ret;
}
/**
* Like forName, but if the classname doesn't have a package
* prefix we first attempt to look it up as one of our own
* inner clases. As with forName, if this can not be resolved
* we throw an exception.
*
* NEEDSDOC @param classname
*
* NEEDSDOC ($objectName$) @return
*
* @throws ClassNotFoundException
*/
public Class forNameInContext(String classname)
throws ClassNotFoundException
{
for (int i = innerclasses.length - 1; i >= 0; --i)
{
if (classname.equals(innerclasses[i].getShortName()))
return innerclasses[i];
}
return forName(classname);
}
/**
* Returns the synthetic Class object associated with the class
* with the given fully-qualified name. If there isn't one, this
* method attempts to locate, load and link the standard java Class.
* If it succeeds, it returns a wrapped version of the Class object
* representing the class. If it fails, the method throws a
* ClassNotFoundException.
* <p>
* For example, the following code fragment returns
* the runtime Class descriptor for the class named
* mypackage.MyClass -- either as a synthetic or as
* a standard Java class.
* <code>
* Class t =
* Class.forName("mypackage.MyClass")
* </code>
* <p>
* I've added support for arrays -- assuming any name
* that ends with ']' is an array. It probably needs to be
* made smarter, possibly via a subclass of
org.apache.xml.utils.synthetic.Class.
*
* @param className the fully qualified name of the desired class.
* @return the synthetic Class descriptor for the class with the specified
name.
* @throws ClassNotFoundException if the class could not be found.
*/
public static Class forName(String className) throws ClassNotFoundException
{
// ***** Experimental support for array syntax expressed
// per Java source rather than per JVM type formalism.
// Simpleminded, asssumes balanced []'s.
if (className.endsWith("]"))
{
StringBuffer arrayname = new StringBuffer();
for (int i = className.indexOf('['); i != -1;
i = className.indexOf('[', i + 1))
{
arrayname.append('[');
}
// Convert the classname to array-formalism
// Primitives have letters; objects are Lname;
// (Don't ask why long is spelled with a J and
// object is spelled with an L...)
String classname = className.substring(0, className.indexOf('['));
if ("byte".equals(classname))
arrayname.append('B');
else if ("char".equals(classname))
arrayname.append('C');
else if ("double".equals(classname))
arrayname.append('D');
else if ("float".equals(classname))
arrayname.append('F');
else if ("int".equals(classname))
arrayname.append('I');
else if ("long".equals(classname))
arrayname.append('J');
else if ("short".equals(classname))
arrayname.append('S');
else if ("boolean".equals(classname))
arrayname.append('Z');
else
arrayname.append('L').append(classname).append(';');
// Tail-call.
return forName(arrayname.toString());
}
Class ret = (Class) (global_classtable.get(className));
if (null == ret)
{
// ***** Experimental support for Java primitives
// Seems to me that mapping them into the "Type" is
// probably most useful
if ("boolean".equals(className))
{
ret = new Class(className);
ret.realclass = java.lang.Boolean.TYPE;
}
else if ("byte".equals(className))
{
ret = new Class(className);
ret.realclass = java.lang.Byte.TYPE;
}
else if ("char".equals(className))
{
ret = new Class(className);
ret.realclass = java.lang.Character.TYPE;
}
else if ("short".equals(className))
{
ret = new Class(className);
ret.realclass = java.lang.Short.TYPE;
}
else if ("int".equals(className))
{
ret = new Class(className);
ret.realclass = java.lang.Integer.TYPE;
}
else if ("long".equals(className))
{
ret = new Class(className);
ret.realclass = java.lang.Long.TYPE;
}
else if ("float".equals(className))
{
ret = new Class(className);
ret.realclass = java.lang.Float.TYPE;
}
else if ("double".equals(className))
{
ret = new Class(className);
ret.realclass = java.lang.Double.TYPE;
}
else if ("void".equals(className))
{
// ***** Void is an "absence of type". We might want to create
// a special object to represent it. This is a placeholder.
ret = new Class(className);
ret.realclass = java.lang.Class.forName("java.lang.Object");
}
// Other classes are just wrappered. Unknown classes throw a
// ClassNotFoundException; the user can switch to declareClass()
// if they're sure that an unreified class is OK.
else
ret = new Class(java.lang.Class.forName(className));
}
return ret;
}
/**
* Start to create a synthetic Class with the given fully-qualified
* name. If a Class by that name already exists, and it is not
* reified, it will be returned instead. If a reified Class _does_
* exist, we throw a synthesis exception.
*
* @param className the fully qualified name of the desired class.
* @return the synthetic Class descriptor for the class with the specified
name.
* @throws SynthesisException
* if the class has been reified.
*/
public static Class declareClass(String className) throws SynthesisException
{
Class ret = (Class) (global_classtable.get(className));
if (null == ret)
ret = new Class(className);
if (ret.realclass != null)
throw new SynthesisException(SynthesisException.REIFIED);
return ret;
}
/**
* Start to create a synthetic Class with the given fully-qualified
* name. If a Class by that name already exists,whether reified or
* not, it will be removed from the table and replaced by the new synthesis.
*
* NOTE THAT the replacement will not affect classes which
* have already refernced the old version. We could change that by
* having everyone reference everyone else via an indirection table.
*
* @param className the fully qualified name of the desired class.
* @return the synthetic Class descriptor for the class with the specified
name.
*/
public static Class reallyDeclareClass(String className)
{
Class ret = (Class) (global_classtable.get(className));
if (null != ret)
global_classtable.remove(ret);
ret = new Class(className);
return ret;
}
/**
* Returns an array containing Class objects
* representing all the public classes and interfaces
* that are members of the class represented by this
* Class object. This includes public class and
* interface members inherited from superclasses and
* public class and interface members declared by the
* class. Returns an array of length 0 if the class has
* no public member classes or interfaces, or if this
* Class object represents a primitive type.
* <p>
* NOTE: In a significant number of existing Java environments,
* this method is not implemented by the official Class object
* and always returns an empty array. So if you don't get any
* useful information from a proxied java.lang.Class, don't
* be surprised. I'm not sure if someone decided it was a
* potential security issue, or if Sun was lazy and everyone
* else followed suit.
* <p>
* ALSO NOTE: The above spec, as taken from java.lang.Class,
* doesn't provide any good way to distinguish the immediate
* superclass from all other superclasses. That makes it only
* marginally useful, which is no doubt one of the reasons folks
* have declined to implement it.
*
* NEEDSDOC ($objectName$) @return
*/
public Class[] getClasses()
{
if (realclass != null && allclasses == null)
{
java.lang.Class[] realDE = realclass.getClasses();
allclasses = new Class[realDE.length];
for (int i = 0; i < realDE.length; ++i)
{
allclasses[i] = forClass(realDE[i]);
}
}
return allclasses;
}
/**
* Determines the class loader for the class.
*
* @return
* the class loader that created the class or
* interface represented by this object, or null
* if the org.apache.xml.utils.synthetic.Class was not created by a class
loader.
* @see
* ClassLoader
*/
public ClassLoader getClassLoader()
{
return (realclass == null) ? null : realclass.getClassLoader();
}
/**
* If this class represents an array type, returns the
* Class object representing the component type of
* the array; otherwise returns null.
* <p>
* NOTE: Since org.apache.xml.utils.synthetic.Class doesn't yet attempt to
model array
* types, this will currently return false unless we are
* proxying such a type.
*
* @see Array
*
* NEEDSDOC ($objectName$) @return
*/
public Class getComponentType()
{
return realclass == null ? null : new Class(realclass.getComponentType());
}
/**
* Returns a Constructor object that reflects the
* specified public constructor of the class
* represented by this Class object. The
* parameterTypes parameter is an array of Class
* objects that identify the constructor's formal
* parameter types, in declared order.
* <p>
* The constructor to reflect is located by searching
* all the constructors of the class represented by this
* Class object for a public constructor with the
* exactly the same formal parameter types.
*
*
* NEEDSDOC @param parameterTypes
*
* NEEDSDOC ($objectName$) @return
* @throws NoSuchMethodException
* if a matching method is not found.
* @throws SecurityException
* if access to the information is denied.
* @see
* Constructor
* @throws SynthesisException
*/
public Constructor getConstructor(Class parameterTypes[])
throws NoSuchMethodException, SecurityException, SynthesisException
{
if (realclass == null)
throw new SynthesisException(SynthesisException.UNREIFIED);
java.lang.Class[] real = new java.lang.Class[parameterTypes.length];
for (int i = 0; i < parameterTypes.length; ++i)
{
if ((real[i] = parameterTypes[i].getRealClass()) == null)
throw new SynthesisException(SynthesisException.UNREIFIED);
}
return new Constructor(realclass.getConstructor(real), this);
}
/**
* Returns an array containing Constructor objects
* reflecting all the public constructors of the class
* represented by this Class object. An array of length
* 0 is returned if the class has no public
* constructors.
*
*
* NEEDSDOC ($objectName$) @return
* @throws SecurityException
* if access to the information is denied.
* @see
* Constructor
*/
public Constructor[] getConstructors() throws SecurityException
{
if (realclass != null && allconstructors == null)
{
java.lang.reflect.Constructor[] realDC = realclass.getConstructors();
allconstructors = new Constructor[realDC.length];
for (int i = 0; i < realDC.length; ++i)
{
allconstructors[i] = new Constructor(realDC[i], this);
}
}
return allconstructors;
}
/**
* This method is not implemented in VAJAVA 3.0
* <p>
* Returns an array of Class objects reflecting all the
* classes and interfaces declared as members of the
* class represented by this Class object. This
* includes public, protected, default (package)
* access, and private classes and interfaces declared
* by the class, but excludes inherited classes and
* interfaces. Returns an array of length 0 if the class
* declares no classes or interfaces as members, or if
* this Class object represents a primitive type.
*
*
* NEEDSDOC ($objectName$) @return
* @throws SecurityException
* if access to the information is denied.
*/
public Class[] getDeclaredClasses() throws SecurityException
{
// ***** This should really be a single class plus declared interfaces.
if (realclass != null && declaredclasses == null)
{
java.lang.Class[] realDE = realclass.getDeclaredClasses();
declaredclasses = new Class[realDE.length];
for (int i = 0; i < realDE.length; ++i)
{
declaredclasses[i] = forClass(realDE[i]);
if (!realDE[i].isInterface())
superclass = declaredclasses[i];
}
}
return declaredclasses;
}
/**
* Adds an "extends" description for the class or
* interface represented by this Class object
*
*
* NEEDSDOC @param newclass
* @throws SynthesisException
* if the class has been reified.
* @see
* class
*/
public void addExtends(Class newclass) throws SynthesisException
{
if (realclass != null)
throw new SynthesisException(SynthesisException.REIFIED);
Class[] scratch = new Class[declaredclasses.length + 1];
System.arraycopy(declaredclasses, 0, scratch, 0, declaredclasses.length);
scratch[declaredclasses.length] = newclass;
declaredclasses = scratch;
}
/**
* Returns a Constructor object that reflects the
* specified declared constructor of the class or
* interface represented by this Class object. The
* parameterTypes parameter is an array of Class
* objects that identify the constructor's formal
* parameter types, in declared order.
*
*
* NEEDSDOC @param parameterTypes
*
* NEEDSDOC ($objectName$) @return
* @throws NoSuchMethodException
* if a matching method is not found.
* @throws SecurityException
* if access to the information is denied.
* @see
* Constructor
*/
public Constructor getDeclaredConstructor(Class parameterTypes[])
throws NoSuchMethodException, SecurityException
{
throw new java.lang.IllegalStateException();
}
/**
* Adds a Constructor description for the class or
* interface represented by this Class object
*
*
* NEEDSDOC ($objectName$) @return
* @throws SynthesisException
* if the class has been reified.
* @see
* Constructor
*/
public Constructor declareConstructor() throws SynthesisException
{
if (realclass != null)
throw new SynthesisException(SynthesisException.REIFIED);
Constructor newctor = new Constructor(this);
Constructor[] scratch = new Constructor[declaredconstructors.length + 1];
System.arraycopy(declaredconstructors, 0, scratch, 0,
declaredconstructors.length);
scratch[declaredconstructors.length] = newctor;
declaredconstructors = scratch;
scratch = new Constructor[allconstructors.length + 1];
System.arraycopy(allconstructors, 0, scratch, 0, allconstructors.length);
scratch[allconstructors.length] = newctor;
allconstructors = scratch;
return newctor;
}
/**
* State that this class implements a specified interface.
* This does not yet update allMethods or otherwise
* attempt to inherit data.
*
* @param newifce org.apache.xml.utils.synthetic.Class representing the
interface we want to add.
*
* NEEDSDOC ($objectName$) @return
* @exception org.apache.xml.utils.synthetic.SynthesisException if the
Class isn't an interface
* @see setSuperClass
* @see declareConstructor
* @see declareMethod
* @see declareField
*
* @throws SynthesisException
*/
public Class declareInterface(Class newifce) throws SynthesisException
{
if (realclass != null)
throw new SynthesisException(SynthesisException.REIFIED);
if (!newifce.isInterface())
throw new SynthesisException(SynthesisException.SYNTAX,
newifce.getName() + " isn't an interface");
Class[] scratch = new Class[interfaces.length + 1];
System.arraycopy(interfaces, 0, scratch, 0, interfaces.length);
scratch[interfaces.length] = newifce;
interfaces = scratch;
scratch = new Class[allclasses.length + 1];
System.arraycopy(allclasses, 0, scratch, 0, allclasses.length);
scratch[allclasses.length] = newifce;
allclasses = scratch;
return newifce;
}
/**
* Returns an array of Constructor objects reflecting
* all the constructors declared by the class
* represented by this Class object. These are public,
* protected, default (package) access, and private
* constructors. Returns an array of length 0 if this
* Class object represents an interface or a primitive
* type.
* <p>
* See The Java Language Specification, section 8.2.
*
*
* NEEDSDOC ($objectName$) @return
* @throws SecurityException
* if access to the information is denied.
* @see
* Constructor
*/
public Constructor[] getDeclaredConstructors() throws SecurityException
{
if (realclass != null && declaredconstructors == null)
{
java.lang.reflect.Constructor[] realDC =
realclass.getDeclaredConstructors();
declaredconstructors = new Constructor[realDC.length];
for (int i = 0; i < realDC.length; ++i)
{
declaredconstructors[i] = new Constructor(realDC[i], this);
}
}
return declaredconstructors;
}
/**
* Returns a Field object that reflects the specified
* declared field of the class or interface represented
* by this Class object. The name parameter is a
* String that specifies the simple name of the desired
* field.
*
*
* NEEDSDOC @param name
*
* NEEDSDOC ($objectName$) @return
* @throws NoSuchFieldException
* if a field with the specified name is not found.
* @throws SecurityException
* if access to the information is denied.
* @see
* Field
*/
public Field getDeclaredField(String name)
throws NoSuchFieldException, SecurityException
{
throw new java.lang.IllegalStateException();
}
/**
* Adds a Field description for the class or
* interface represented by this Class object
*
*
* NEEDSDOC @param name
*
* NEEDSDOC ($objectName$) @return
* @throws SynthesisException
* if the class has been reified.
* @see
* Constructor
*/
public Field declareField(String name) throws SynthesisException
{
if (realclass != null)
throw new SynthesisException(SynthesisException.REIFIED);
Field newfield = new Field(name, this);
Field[] scratch = new Field[declaredfields.length + 1];
System.arraycopy(declaredfields, 0, scratch, 0, declaredfields.length);
scratch[declaredfields.length] = newfield;
declaredfields = scratch;
scratch = new Field[allfields.length + 1];
System.arraycopy(allfields, 0, scratch, 0, allfields.length);
scratch[allfields.length] = newfield;
allfields = scratch;
return newfield;
}
/**
* Returns an array of Field objects reflecting all the
* fields declared by the class or interface represented
* by this Class object. This includes public,
* protected, default (package) access, and private
* fields, but excludes inherited fields. Returns an
* array of length 0 if the class or interface declares
* no fields, or if this Class object represents a
* primitive type. See The Java Language
* Specification, sections 8.2 and 8.3.
*
*
* NEEDSDOC ($objectName$) @return
* @throws SecurityException
* if access to the information is denied.
* @see
* Field
*/
public Field[] getDeclaredFields() throws SecurityException
{
if (realclass != null && declaredfields == null)
{
java.lang.reflect.Field[] realDF = realclass.getDeclaredFields();
declaredfields = new Field[realDF.length];
for (int i = 0; i < realDF.length; ++i)
{
declaredfields[i] = new Field(realDF[i], this);
}
}
return declaredfields;
}
/**
* Returns a Method object that reflects the specified
* declared method of the class or interface
* represented by this Class object. The name
* parameter is a String that specifies the simple
* name of the desired method, and the
* parameterTypes parameter is an array of Class
* objects that identify the method's formal parameter
* types, in declared order.
*
*
* NEEDSDOC @param name
* NEEDSDOC @param parameterTypes
*
* NEEDSDOC ($objectName$) @return
* @throws NoSuchMethodException
* if a matching method is not found.
* @throws SecurityException
* if access to the information is denied.
* @see
* Method
*/
public Method getDeclaredMethod(String name, Class parameterTypes[])
throws NoSuchMethodException, SecurityException
{
throw new java.lang.IllegalStateException();
}
/**
* Adds a Method description for the class or
* interface represented by this Class object
*
*
* NEEDSDOC @param name
*
* NEEDSDOC ($objectName$) @return
* @throws SynthesisException
* if the class has been reified.
* @see
* Constructor
*/
public Method declareMethod(String name) throws SynthesisException
{
if (realclass != null)
throw new SynthesisException(SynthesisException.REIFIED);
Method newMethod = new Method(name, this);
Method[] scratch = new Method[declaredmethods.length + 1];
System.arraycopy(declaredmethods, 0, scratch, 0, declaredmethods.length);
scratch[declaredmethods.length] = newMethod;
declaredmethods = scratch;
scratch = new Method[allmethods.length + 1];
System.arraycopy(allmethods, 0, scratch, 0, allmethods.length);
scratch[allmethods.length] = newMethod;
allmethods = scratch;
return newMethod;
}
/**
* Returns an array of Method objects reflecting all
* the methods declared by the class or interface
* represented by this Class object. This includes
* public, protected, default (package) access, and
* private methods, but excludes inherited methods.
* Returns an array of length 0 if the class or interface
* declares no methods, or if this Class object
* represents a primitive type.
* <p>
* See The Java Language Specification, section 8.2.
*
*
* NEEDSDOC ($objectName$) @return
* @throws SecurityException
* if access to the information is denied.
* @see
* Method
*/
public Method[] getDeclaredMethods() throws SecurityException
{
if (realclass != null && declaredmethods == null)
{
java.lang.reflect.Method[] realDM = realclass.getDeclaredMethods();
declaredmethods = new Method[realDM.length];
for (int i = 0; i < realDM.length; ++i)
{
declaredmethods[i] = new Method(realDM[i], this);
}
}
return declaredmethods;
}
/**
* This method is not implemented in VAJava 3.0
* <p>
* If the class or interface represented by this Class
* object is a member of another class, returns the
* Class object representing the class of which it is a
* member (its declaring class). Returns null if this
* class or interface is not a member of any other
* class.
*
* NEEDSDOC ($objectName$) @return
*/
public Class getDeclaringClass()
{
if (realclass != null && declaringclass == null)
{
java.lang.Class dc = realclass.getDeclaringClass();
if (dc == null)
declaringclass = null;
else
declaringclass = forClass(dc);
}
return declaringclass;
}
/**
* Declare that this class is an inner class of another.
*
* NEEDSDOC @param newclass
*
* @throws SynthesisException
*/
private void addInnerClass(Class newclass) throws SynthesisException
{
if (realclass != null)
throw new SynthesisException(SynthesisException.REIFIED);
if (newclass.getDeclaringClass() != this)
throw new SynthesisException(SynthesisException.WRONG_OWNER);
Class[] scratch = new Class[innerclasses.length + 1];
System.arraycopy(innerclasses, 0, scratch, 0, innerclasses.length);
scratch[innerclasses.length] = newclass;
innerclasses = scratch;
}
/**
* Declare a class contained within this class. This doesn't
* address anonymous classes (those go inside method bodies
* and similar code), just local classes.
* <p>
* ***** This requires lookup methods that operate in the
* context of a specific class, and per-class registries!
*
* @param className Local name of inner class to create. This should _not_
be a
* qualified name, unlike the normal forName() call. Its
* hierarchy is established by the class within which it is
* created.
* @return org.apache.xml.utils.synthetic.Class object for the contained
class.
* @exception org.apache.xml.utils.synthetic.SynthesisException if class
could not be created.
* @since 2/2000
* @see forName
*
* @throws SynthesisException
*/
public Class declareInnerClass(String className) throws SynthesisException
{
if (realclass != null)
throw new SynthesisException(SynthesisException.REIFIED);
String relativeName = getName() + "$" + className;
Class newclass = (Class) (global_classtable.get(relativeName));
if (newclass != null)
throw new SynthesisException(SynthesisException.SYNTAX,
"Inner class " + name + " already exists");
newclass = new Class(className);
newclass.declaringclass = this;
Class[] scratch = new Class[innerclasses.length + 1];
System.arraycopy(innerclasses, 0, scratch, 0, innerclasses.length);
scratch[innerclasses.length] = newclass;
innerclasses = scratch;
return newclass;
}
/**
* Fetch a list of classes contained within this class.
* This doesn't address anonymous classes (those go
* inside method bodies and similar code), just local classes.
*
* @return org.apache.xml.utils.synthetic.Class[] object for the contained
classes.
* This may be empty if none such exist, or if the class is
* reified (since reflection doesn't report this information).
* @since 3/2000
* @see forName
*/
public Class[] getInnerClasses()
{
return innerclasses;
}
/**
* Returns a Field object that reflects the specified
* public member field of the class or interface
* represented by this Class object. The name
* parameter is a String specifying the simple name of
* the desired field.
* <p>
* The field to be reflected is located by searching all
* the member fields of the class or interface
* represented by this Class object for a public field
* with the specified name.
* <p>
* See The Java Language Specification, sections 8.2
* and 8.3.
*
*
* NEEDSDOC @param name
*
* NEEDSDOC ($objectName$) @return
* @throws NoSuchFieldException
* if a field with the specified name is not
* found.
* @throws SecurityException
* if access to the information is denied.
* @see
* Field
*/
public Field getField(String name)
throws NoSuchFieldException, SecurityException
{
throw new java.lang.IllegalStateException();
}
/**
* Returns an array containing Field objects
* reflecting all the accessible public fields of the
* class or interface represented by this Class object.
* Returns an array of length 0 if the class or interface
* has no accessible public fields, or if it represents
* an array type or a primitive type.
* <p>
* Specifically, if this Class object represents a class,
* returns the public fields of this class and of all its
* superclasses. If this Class object represents an
* interface, returns the fields of this interface and of
* all its superinterfaces. If this Class object
* represents an array type or a primitive type, returns
* an array of length 0.
* <p>
* The implicit length field for array types is not
* reflected by this method. User code should use the
* methods of class Array to manipulate arrays.
* <p>
* See The Java Language Specification, sections 8.2
* and 8.3.
*
*
* NEEDSDOC ($objectName$) @return
* @throws SecurityException
* if access to the information is denied.
* @see Field
*/
public Field[] getFields() throws SecurityException
{
if (realclass != null && allfields == null)
{
java.lang.reflect.Field[] realDF = realclass.getFields();
allfields = new Field[realDF.length];
for (int i = 0; i < realDF.length; ++i)
{
allfields[i] = new Field(realDF[i], this);
}
}
return allfields;
}
/**
* Determines the interfaces implemented by the
* class or interface represented by this object.
* <p>
* If this object represents a class, the return value is
* an array containing objects representing all
* interfaces implemented by the class. The order of
* the interface objects in the array corresponds to the
* order of the interface names in the implements
* clause of the declaration of the class represented by
* this object.
* <p>
* If this object represents an interface, the array
* contains objects representing all interfaces
* extended by the interface. The order of the
* interface objects in the array corresponds to the
* order of the interface names in the extends clause
* of the declaration of the interface represented by
* this object.
* <p>
* If the class or interface implements no interfaces,
* the method returns an array of length 0.
*
* @return
* an array of interfaces implemented by this
* class.
*/
public Class[] getInterfaces()
{
if (realclass != null && interfaces == null)
{
java.lang.Class[] realI = realclass.getInterfaces();
interfaces = new Class[realI.length];
for (int i = 0; i < realI.length; ++i)
{
interfaces[i] = forClass(realI[i]);
}
}
return interfaces;
}
/**
* Adds an "implements" description for the class or
* interface represented by this Class object
*
*
* NEEDSDOC @param newclass
* @throws SynthesisException
* if the class has been reified.
* @see
* class
*/
public void addImplements(Class newclass) throws SynthesisException
{
if (realclass != null)
throw new SynthesisException(SynthesisException.REIFIED);
Class[] scratch = new Class[interfaces.length + 1];
System.arraycopy(interfaces, 0, scratch, 0, interfaces.length);
scratch[interfaces.length] = newclass;
interfaces = scratch;
}
/**
* Returns a Method object that reflects the specified
* public member method of the class or interface
* represented by this Class object. The name
* parameter is a String specifying the simple name
* the desired method, and the parameterTypes
* parameter is an array of Class objects that identify
* the method's formal parameter types, in declared
* order.
* <p>
* The method to reflect is located by searching all
* the member methods of the class or interface
* represented by this Class object for a public
* method with the specified name and exactly the
* same formal parameter types.
* <p>
* See The Java Language Specification, sections 8.2
* and 8.4.
*
*
* NEEDSDOC @param name
* NEEDSDOC @param parameterTypes
*
* NEEDSDOC ($objectName$) @return
* @throws NoSuchMethodException
* if a matching method is not found.
* @throws SecurityException
* if access to the information is denied.
* @see
* Method
*/
public Method getMethod(String name, Class parameterTypes[])
throws NoSuchMethodException, SecurityException
{
throw new java.lang.IllegalStateException();
}
/**
* Returns an array containing Method objects
* reflecting all the public member methods of the
* class or interface represented by this Class object,
* including those declared by the class or interface
* and and those inherited from superclasses and
* superinterfaces. Returns an array of length 0 if the
* class or interface has no public member methods.
* <p>
* See The Java Language Specification, sections 8.2
* and 8.4.
*
*
* NEEDSDOC ($objectName$) @return
* @throws SecurityException
* if access to the information is denied.
* @see Method
*/
public Method[] getMethods() throws SecurityException
{
if (realclass != null && allmethods == null)
{
java.lang.reflect.Method[] realDM = realclass.getMethods();
allmethods = new Method[realDM.length];
for (int i = 0; i < realDM.length; ++i)
{
allmethods[i] = new Method(realDM[i], this);
}
}
return allmethods;
}
/**
* Returns the Java language modifiers for this class
* or interface, encoded in an integer. The modifiers
* consist of the Java Virtual Machine's constants for
* public, protected, private, final, and interface; they
* should be decoded using the methods of class
* Modifier.
*
* The modifier encodings are defined in The Java
* Virtual Machine Specification, table 4.1.
*
* See Also:
* java.lang.reflect.Modifier
*
* NEEDSDOC ($objectName$) @return
*/
public int getModifiers()
{
return modifiers;
}
/**
* Set the Java language modifiers for this class
* or interface, encoded in an integer. The modifiers
* consist of the Java Virtual Machine's constants for
* public, protected, private, final, and interface; they
* should be decoded using the methods of class
* Modifier.
*
* The modifier encodings are defined in The Java
* Virtual Machine Specification, table 4.1.
*
* See Also:
* java.lang.reflect.Modifier
*
* NEEDSDOC @param modifiers
*
* @throws SynthesisException
*/
public void setModifiers(int modifiers) throws SynthesisException
{
if (this.realclass != null)
throw new SynthesisException(SynthesisException.REIFIED);
this.modifiers = modifiers;
}
/**
* Retrieve the fully-qualified classname. If it's an array,
* it will be returned in JVM syntax, not Java syntax.
*
* @return java.lang.String
* @since 12/95
* @see getShortName
* @see getJavaName
* @see getJavaShortName
*/
public java.lang.String getName()
{
return name;
}
/**
* Like getName, but back-convert array notation escapes.
* ***** DOESN'T YET HANDLE ARRAYS OF PRIMITIVES!
*
* @return java.lang.String
* @since 3/2000
* @see getName
* @see getJavaShortName
*/
public java.lang.String getJavaName()
{
if (name.charAt(0) != '[')
return name;
// Object array syntax is [Ltypename;
// add another [ for each level of array
int count = name.lastIndexOf('[');
StringBuffer jname = new StringBuffer(name.substring(count + 2));
// Trim the trailing ';'
jname.setLength(jname.length() - 1);
while (count-- >= 0)
{
jname.append("[]");
}
return jname.toString();
}
/**
* Extract just the local name of this class, minus the package
* prefix.
*
* ***** I don't think this handles array types properly yet.
*
* @return java.lang.String
* @since 12/99
* @see getName
* @see getPackageName
* @see getJavaName
* @see getJavaShortName
*/
public java.lang.String getShortName()
{
int start = name.lastIndexOf(".");
if (start != 0 || name.charAt(0) == '.')
++start;
if (declaringclass != null)
{
int d = name.lastIndexOf('$', start);
if (d != 0)
start = d + 1;
}
return name.substring(start);
}
/**
* Like getShortName, but back-convert array notation escapes.
* ***** DOESN'T YET HANDLE ARRAYS OF PRIMITIVES!
*
* @return java.lang.String
* @since 3/2000
* @see getJavaName
* @see getShortName
*/
public java.lang.String getJavaShortName()
{
String shortname = getShortName();
if (shortname.charAt(0) != '[')
return shortname;
// Object array syntax is [Ltypename;
// add another [ for each level of array
int count = shortname.lastIndexOf('[');
StringBuffer jname = new StringBuffer(shortname.substring(count + 2));
// Trim the trailing ';'
jname.setLength(jname.length() - 1);
while (count-- >= 0)
{
jname.append("[]");
}
return jname.toString();
}
/**
* Extract the package name for this class.
* ***** I don't think this handles array classes properly yet.
*
* @return java.lang.String
* @since 12/95
* @see getName
* @see getShortName
* @see getJavaName
* @see getJavaShortName
*/
public java.lang.String getPackageName()
{
int start = name.lastIndexOf(".");
return name.substring(0, start);
}
/**
* If this synthetic class is a wrapper for a "real"
* java.lang.Class -- either because it was instantiated as such
* or because it has been compiled -- this method will return
* that class. Otherwise it returns null.
* Creation date: (12-25-99 12:26:01 PM)
* @return org.apache.xml.utils.synthetic.Class
*/
public java.lang.Class getRealClass()
{
return realclass;
}
/**
* This call is intended to allow an existing
org.apache.xml.utils.synthetic.Class
* to be switched from purely descriptive mode to proxy mode
* ("reified").
* The primary intent is to allow a org.apache.xml.utils.synthetic.Class to
be
* "compiled in place"
* <p>
* This should have the side-effect of limiting further mutation
* of the org.apache.xml.utils.synthetic.Class to things which can not be
obtained
* from the real Class object, to avoid "lying" to the user
* <p>
* NOTE: Not all information defined by the Java libraries is
* in fact available in all Java environments. We assume the
* calls will work; if they return null or empty lists, there's
* nothing we can do about it. Note that this may mean that a
* reified class tells us less about itself than the
* synthetic description used to generate it.
* <p>
* Creation date: (12-25-99 12:26:01 PM)
* @param java.lang.class realclass nonsynthetic Class object to proxy
*
* NEEDSDOC @param realclass
*
* @throws SynthesisException
*/
public void setRealClass(java.lang.Class realclass)
throws SynthesisException
{
if (this.realclass != null)
throw new SynthesisException(SynthesisException.REIFIED);
this.realclass = realclass;
this.modifiers = realclass.getModifiers();
this.isInterface = realclass.isInterface();
// DEFERRED -- set them null now, reconstruct when requested
this.declaringclass = null;
this.interfaces = null;
this.declaredconstructors = null;
this.allconstructors = null;
this.declaredmethods = null;
this.allmethods = null;
this.declaredfields = null;
this.allfields = null;
this.declaredclasses = null;
this.allclasses = null;
this.superclass = null;
}
/**
* Set the superclass for this synthetic class.
* Object is equivalent to Null.
* Creation date: (12-25-99 12:26:01 PM)
*
* NEEDSDOC @param superclass
* @return org.apache.xml.utils.synthetic.Class
*
* @throws SynthesisException
*/
public void setSuperClass(Class superclass) throws SynthesisException
{
if (realclass != null)
throw new SynthesisException(SynthesisException.REIFIED);
this.superclass = superclass;
}
/**
* Set the superclass for this synthetic class.
* Creation date: (12-25-99 12:26:01 PM)
*
* NEEDSDOC @param superclass
* @return org.apache.xml.utils.synthetic.Class
*
* @throws ClassNotFoundException
* @throws SynthesisException
*/
public void setSuperClass(java.lang.Class superclass)
throws ClassNotFoundException, SynthesisException
{
if (realclass != null)
throw new SynthesisException(SynthesisException.REIFIED);
this.superclass = Class.forClass(superclass);
}
/**
* Finds a resource with the specified name. The
* rules for searching for resources associated with a
* given class are implemented by the class loader of
* the class.
* <p>
* The Class methods delegate to ClassLoader
* methods, after applying a naming convention: if
* the resource name starts with "/", it is used as is.
* Otherwise, the name of the package is prepended,
* after converting "." to "/".
*
* @param
* name - the string representing the resource to
* be found.
* @return
* the URL object having the specified name, or
* null if no resource with the specified name
* is found.
* @see ClassLoader
* @see getResourceAsStream
*/
public java.net.URL getResource(String name)
{
throw new java.lang.IllegalStateException();
}
/**
* Finds a resource with a given name. Will return
* null if no resource with this name is found. The
* rules for searching a resources associated with a
* given class are implemented by the ClassLoader of
* the class.
* <p>
* The Class methods delegate to ClassLoader
* methods, after applying a naming convention: if
* the resource name starts with "/", it is used as is.
* Otherwise, the name of the package is prepended,
* after converting "." to "/".
*
* @param
* name - the string representing the resource to
* be found
* @return
* the InputStream object having the
* specified name, or null if no resource with
* the specified name is found.
* @see ClassLoader
* @see getResource
*/
public java.io.InputStream getResourceAsStream(String name)
{
throw new java.lang.IllegalStateException();
}
/**
* Get the signers of this class.
*
* NEEDSDOC ($objectName$) @return
*/
public Object[] getSigners()
{
throw new java.lang.IllegalStateException();
}
/**
* If this object represents any class other than the
* class Object, then the object that represents the
* superclass of that class is returned.
* <p>
* If this object is the one that represents the class
* Object or this object represents an interface, null is
* returned.
*
* @return
* the superclass of the class represented by this
* object.
*/
public Class getSuperclass()
{
if (realclass != null && superclass == null)
{
superclass = forClass(realclass.getSuperclass());
// getDeclaredClasses(); // Sets superclass as a side-effect
}
if (superclass == null)
superclass = forClass(Object.class);
return superclass;
}
/**
* If this Class object represents an array type, returns
* true, otherwise returns false.
*
* NEEDSDOC ($objectName$) @return
*/
public boolean isArray()
{
return realclass != null && realclass.isArray();
}
/**
* Determines if the class or interface represented by
* this Class object is either the same as, or is a
* superclass or superinterface of, the class or
* interface represented by the specified Class
* parameter. It returns true if so, false otherwise. If
* this Class object represents a primitive type,
* returns true if the specified Class parameter is
* exactly this Class object, false otherwise.
* <p>
* Specifically, this method tests whether the type
* represented by the specified Class parameter can
* be converted to the type represented by this Class
* object via an identity conversion or via a widening
* reference conversion. See The Java Language
* Specification, sections 5.1.1 and 5.1.4 , for details.
*
*
* NEEDSDOC @param cls
*
* NEEDSDOC ($objectName$) @return
* @throws NullPointerException if the specified Class parameter is null.
*/
public boolean isAssignableFrom(Class cls)
{
if (realclass != null && cls.realclass != null)
return realclass.isAssignableFrom(cls.realclass);
throw new java.lang.IllegalStateException();
}
/**
* Determines if the class or interface represented by
* this Class object is either the same as, or is a
* superclass or superinterface of, the class or
* interface represented by the specified Class
* parameter. It returns true if so, false otherwise. If
* this Class object represents a primitive type,
* returns true if the specified Class parameter is
* exactly this Class object, false otherwise.
* <p>
* Specifically, this method tests whether the type
* represented by the specified Class parameter can
* be converted to the type represented by this Class
* object via an identity conversion or via a widening
* reference conversion. See The Java Language
* Specification, sections 5.1.1 and 5.1.4 , for details.
*
*
* NEEDSDOC @param cls
*
* NEEDSDOC ($objectName$) @return
* @throws NullPointerException if the specified Class parameter is null.
*/
public boolean isAssignableFrom(java.lang.Class cls)
{
if (realclass != null)
return realclass.isAssignableFrom((java.lang.Class) cls);
throw new java.lang.IllegalStateException();
}
/**
* This method is the dynamic equivalent of the Java
* language instanceof operator. The method
* returns true if the specified Object argument is
* non-null and can be cast to the reference type
* represented by this Class object without raising a
* ClassCastException. It returns false otherwise.
* <p>
* Specifically, if this Class object represents a
* declared class, returns true if the specified Object
* argument is an instance of the represented class (or
* of any of its subclasses); false otherwise. If this
* Class object represents an array class, returns true
* if the specified Object argument can be converted
* to an object of the array type by an identity
* conversion or by a widening reference conversion;
* false otherwise. If this Class object represents an
* interface, returns true if the class or any superclass
* of the specified Object argument implements this
* interface; false otherwise. If this Class object
* represents a primitive type, returns false.
*
* @param obj The object to check
*
* NEEDSDOC ($objectName$) @return
*/
public boolean isInstance(Object obj)
{
if (realclass != null)
return realclass.isInstance(obj);
// Scan inheritances? (reliable).
// Check name? (not reliable).
throw new java.lang.IllegalStateException();
}
/**
* Determines if the specified Class object represents
* an interface type.
*
* @return
* true if this object represents an interface;
* false otherwise.
*/
public boolean isInterface()
{
return (realclass != null) ? realclass.isInterface() : isInterface;
}
/**
* Assert that the specified Class object represents
* an interface type. Can't be changed after real class loaded.
*
* @param
* true if this object represents an interface;
* false otherwise.
*
* NEEDSDOC @param isInterface
*
* @throws SynthesisException
*/
public void isInterface(boolean isInterface) throws SynthesisException
{
if (realclass == null)
this.isInterface = isInterface;
else if (realclass.isInterface() != isInterface)
throw new SynthesisException(SynthesisException.REIFIED);
}
/**
* Determines if the specified Class object represents
* a primitive Java type.
* <p>
* There are nine predefined Class objects to
* represent the eight primitive Java types and void.
* These are created by the Java Virtual Machine, and
* have the same names as the primitive types that
* they represent, namely boolean, byte, char, short,
* int, long, float, and double, and void.
* <p>
* These objects may only be accessed via the
* following public static final variables, and are the
* only Class objects for which this method returns
* true.
*
* NEEDSDOC ($objectName$) @return
*/
public boolean isPrimitive()
{
return realclass != null && realclass.isPrimitive();
}
/**
* Creates a new instance of a class.
*
* @return
* a newly allocated instance of the class
* represented by this object. This is done
* exactly as if by a new expression with an
* empty argument list.
* @throws IllegalAccessException
* if the class or initializer is not accessible.
* @throws InstantiationException
* if an application tries to instantiate an
* abstract class or an interface, or if the
* instantiation fails for some other reason.
*/
public Object newInstance()
throws InstantiationException, IllegalAccessException
{
throw new java.lang.IllegalStateException();
}
/**
* Converts the object to a string. The string
* representation is the string "class" or
* "interface" followed by a space and then the
* fully qualified name of the class. If this Class
* object represents a primitive type, returns the
* name of the primitive type.
* <p>
* Should this say "synthetic" as well as "class" or
* "interface"? Or should that be gated on whether we're proxy
* to a realclass?
*
* @return a string representation of this class object.
*/
public String toString()
{
if (realclass != null)
return realclass.toString();
else if (isInterface())
return "interface " + name;
else
return "class " + name;
}
/**
* Convenience for writing to, eg, System.out
*
* NEEDSDOC @param out
* NEEDSDOC @param depth
*/
public void toSource(java.io.OutputStream out, int depth)
{
java.io.PrintWriter writer = new java.io.PrintWriter(out);
toSource(writer, depth);
}
/**
* Converts the object to a Java code stream. The string
* representation is as full a Java definition of the class
* as we are able to achieve. If this Class
* object represents a primitive type, returns the
* name of the primitive type.
*
* NEEDSDOC @param out
* NEEDSDOC @param depth
*/
public void toSource(java.io.PrintWriter out, int depth)
{
String tab = tabset(depth);
if (realclass != null)
out.println(
tab
+ "/** Code back-generated from a \"real\" Class; accuracy limited by
reflection APIs. */");
else
out.println(
tab
+ "/** Code generated via org.apache.xml.utils.synthetic.Class */");
/* Package should not be printed for inner classes */
if (getDeclaringClass() == null)
out.println(tab + "package " + getPackageName() + ";");
out.print(tab + Modifier.toString(getModifiers()));
if (isInterface())
out.print(" interface ");
else
out.print(" class ");
out.println(getJavaShortName());
if (superclass != null)
{
out.print('\n' + tab + " extends " + superclass.getJavaName());
}
Class[] ext = getInterfaces();
if (ext != null & ext.length > 0)
{
// Interfaces extend other interfaces,
// Classes implement interfaces.
out.print('\n' + tab + (isInterface ? " extends " : " implements ")
+ ext[0].getName());
for (int i = 1; i < ext.length; ++i)
{
out.print(", " + ext[i].getJavaName());
}
out.print("\n");
}
out.print(tab + "{\n");
tab = tabset(++depth);
// Fields--------------------------------
Field[] fields = null;
try
{
fields = getDeclaredFields();
}
catch (SecurityException e)
{
out.println(tab + "//SecurityException retrieving fields");
}
if (fields != null)
{
for (int i = 0; i < fields.length; ++i)
{
out.println(tab + fields[i].toSource());
}
}
// Constructors--------------------------
Constructor[] ctors = null;
try
{
ctors = getDeclaredConstructors();
}
catch (SecurityException e)
{
out.println(tab + "//SecurityException retrieving ctors");
}
if (ctors != null)
{
for (int i = 0; i < ctors.length; ++i)
{
out.print(ctors[i].toSource(tab));
}
}
// Methods-------------------------------
Method[] methods = null;
try
{
methods = getDeclaredMethods();
}
catch (SecurityException e)
{
out.println(tab + "//SecurityException retrieving methods");
}
if (methods != null)
{
for (int i = 0; i < methods.length; ++i)
{
out.print('\n');
out.print(methods[i].toSource(tab));
}
}
// Inner classes --------------------------------
Class[] inners = getInnerClasses();
if (inners != null)
{
for (int i = 0; i < inners.length; ++i)
{
out.print('\n');
inners[i].toSource(out, depth);
}
}
// Done------------------------------
tab = tabset(--depth);
out.print(tab + "}\n");
out.flush();
}
/**
* NEEDSDOC Method tabset
*
*
* NEEDSDOC @param depth
*
* NEEDSDOC (tabset) @return
*/
private String tabset(int depth)
{
StringBuffer t = new StringBuffer();
while (depth-- > 0)
{
t.append(" ");
}
return t.toString();
}
// Ignores any keywords we don't recognize
/** NEEDSDOC Field val */
static final int[] val = { Modifier.ABSTRACT, Modifier.FINAL,
Modifier.INTERFACE, Modifier.NATIVE,
Modifier.PRIVATE, Modifier.PROTECTED,
Modifier.PUBLIC, Modifier.STATIC,
Modifier.SYNCHRONIZED, Modifier.TRANSIENT,
Modifier.VOLATILE };
/** NEEDSDOC Field kwd */
static final String[] kwd = { "abstract", "final", "interface", "native",
"private", "protected", "public", "static",
"synchronized", "transient", "volatile" };
/**
* NEEDSDOC Method modifierFromString
*
*
* NEEDSDOC @param t
*
* NEEDSDOC (modifierFromString) @return
*/
static public int modifierFromString(String t)
{
for (int i = 0; i < kwd.length; ++i)
{
if (kwd[i].equals(t))
return val[i];
}
return 0;
}
/**
* NEEDSDOC Method modifiersFromString
*
*
* NEEDSDOC @param s
*
* NEEDSDOC (modifiersFromString) @return
*/
static public int modifiersFromString(String s)
{
int mods = 0;
java.util.StringTokenizer parts = new java.util.StringTokenizer(s);
while (parts.hasMoreTokens())
{
String t = parts.nextToken();
mods |= modifierFromString(t);
}
return mods;
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/synthetic/JavaUtils.java
Index: JavaUtils.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: JavaUtils.java,v 1.1 2000/11/23 04:58:52 sboag Exp $
*/
package org.apache.xml.utils.synthetic;
import java.io.IOException;
/** This class supports invoking Java compilation from within
* a Java program. Recent versions of the Java environment have
* provided such an API (in tools.jar). But that isn't available
* on all platforms, and a fallback to the command line may be needed
* (though this too may not always be available, eg. for security
* reasons).
* <p>
* There's an additional complication in some environments --
* such as Microsoft's VJ++ -- where the classpath as seen in
* the System Properties may not be the one the user expects.
* The code here is parameterized to try to deal with that.
*/
public class JavaUtils
{
// One-time flag for whether we could dynamically load compiler API
private static boolean cantLoadCompiler=false;
// Debug flag - generates debug stuff if true.
private static boolean debug = false;
/** Control whether compilation occurs with the -g option
* (debugging information included in generated classfile).
* This is an attribute, rather than a parameter on the compile
* method, largely because it tends to be an all-or-nothing decision;
* generally you're either doing program development and want it,
* or running in production mode and don't. But that may not match
* the needs of future users...
* <p>
* TODO: Consider whether debug should be a parameter.
*
* @param boolean newDebug True to request debugging data,
* false to request optimized output. (It's uncommon to
* want both or neither!)
*/
public static void setDebug(boolean newDebug)
{
debug=newDebug;
}
/** Try to compile a .java file on disk. This will first attempt to
* use the sun.java.tools.javac() method, then (if that is
unavailable)
* fall back upon shelling out to a command line and running javac
* there.
* <p>
* NOTE: This must be _compiled_ with sun.java.tools.* (tools.jar)
* available. We could change that to use reflection instead, if we
* accept some overhead... minor compared to the cost of running the
* compiler!
* <p>
* This has complications on some platforms. For example, under
* Microsoft Visual Java ++ (at least, as installed on my test
system),
* I found that I had to specify paths to both javac and xerces.jar
* rather than counting on the shell's path and classpath having
* been set to reach these. For that reason I've parameterized this
* method with a few system properties, so you can adapt it to your
* own system's needs without modifying the code:
* <dl>
* <dt>org.apache.xml.utils.synthetic.javac
* <dd>Command line issued to invoke the compiler. Defaults to
"javac",
* which should work in most systems. In VJ++, try setting it to
* "cmd /c %JAVA_HOME%\\bin\javac.exe"
* <dt>org.apache.xml.utils.synthetic.moreclasspath
* <dd>Additional classpath, to be prepended to the one retrieved from
* java.class.path. Defaults to "" (empty). In VJ++, try setting it to
* point to your copy of xerces.jar, which may not be found otherwise.
* TODO: Reconsider prepend versus append!
* </dl>
*
* @param String fileName Which .java file to compile. Note that this
may
* be relative to the "current directory".
* @param String classPath Additional places to look for classes that
* this .java file depends upon. Becomes the javac command's
* -classpath parameter value.
* @return boolean True iff compilation succeeded.
*/
public static boolean JDKcompile(String fileName, String classPath)
{
String moreClassPath=
System.getProperty("org.apache.xml.utils.synthetic.moreclasspath","")
.trim();
if(moreClassPath.length()>0)
classPath=moreClassPath+';'+classPath;
if (debug)
{
System.err.println ("JavaEngine: Compiling " +
fileName);
System.err.println ("JavaEngine: Classpath is " +
classPath);
}
String code_option = debug ? "-g" : "-O";
// Start by trying Sun's compiler API
if(!cantLoadCompiler)
{
String args[] = {
code_option,
"-classpath", classPath,
fileName
};
try
{
return new sun.tools.javac.Main(System.err,
"javac").compile(args);
}
catch (Throwable th)
{
System.err.println("INFORMATIONAL: Unable to
load Java compiler API (eg tools.jar).");
System.err.println("\tSwitching to
command-line invocation.");
cantLoadCompiler=true;
}
}
// FALLTHRU:
// Can't load javac() method; try shelling out to the command
// line and invoking it via exec().
String javac_command=
System.getProperty("org.apache.xml.utils.synthetic.javac","javac");
String args[] = {
javac_command,
code_option,
"-classpath", classPath,
fileName
};
try
{
Process p=java.lang.Runtime.getRuntime().exec(args);
int compileOK=waitHardFor(p); // pause for
debugging...
return compileOK==0; //0 == no error reported
}
catch(IOException e)
{
System.err.println("ERROR: IO exception during
exec(javac).");
}
catch(SecurityException e)
{
System.err.println("ERROR: Unable to create
subprocess to exec(javac).");
}
// FALLTHRU: All attempts failed.
return false;
}
/** Subroutine: Like p.waitFor, but discards the InterruptedException
* and goes right back into a wait. I don't want to report compiler
* success or failure until it really has succeeded or failed... I think.
* @param Process p to be waited for
* @return the exitValue() of the process.
*/
static int waitHardFor(java.lang.Process p)
{
boolean done=false;
while(!done)
try
{
p.waitFor();
done=true;
}
catch(InterruptedException e)
{
System.err.println("(Compiler process wait interrupted and
resumed)");
}
int ev=p.exitValue(); // Pause for debugging...
return ev;
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/synthetic/SynthesisException.java
Index: SynthesisException.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.synthetic;
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class SynthesisException <needs-comment/>
*/
public class SynthesisException extends Exception
{
/** NEEDSDOC Field code */
int code;
// Manefest constants
/** NEEDSDOC Field SYNTAX */
public static final int SYNTAX = 0;
/** NEEDSDOC Field UNSUPPORTED */
public static final int UNSUPPORTED = 1;
/** NEEDSDOC Field REIFIED */
public static final int REIFIED = 2;
/** NEEDSDOC Field UNREIFIED */
public static final int UNREIFIED = 3;
/** NEEDSDOC Field WRONG_OWNER */
public static final int WRONG_OWNER = 4;
/** NEEDSDOC Field errToString */
public static final String[] errToString = {
"(Syntax error; specific message should be passed in)",
"Feature not yet supported",
"Can't change features of 'real' class",
"Can't yet instantiate/invoke without 'real' class",
"Can't add Member to an object other than its declarer", };
/**
* Constructor SynthesisException
*
*
* NEEDSDOC @param code
*/
public SynthesisException(int code)
{
super(errToString[code]);
this.code = code;
}
/**
* Constructor SynthesisException
*
*
* NEEDSDOC @param code
* NEEDSDOC @param msg
*/
public SynthesisException(int code, String msg)
{
super(msg);
this.code = code;
}
/**
* NEEDSDOC Method getCode
*
*
* NEEDSDOC (getCode) @return
*/
int getCode()
{
return code;
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/synthetic/TestDriver.java
Index: TestDriver.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
/**
* Test driver for org.apache.xml.utils.synthetic.Class and
org.apache.xml.utils.synthetic.reflection.
* <p>
* toSource should probably be factored out into a separate
* java generator class, so we could generate other languages as well.
*/
package org.apache.xml.utils.synthetic;
import org.apache.xml.utils.synthetic.Class;
import org.apache.xml.utils.synthetic.reflection.*;
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class TestDriver <needs-comment/>
*/
public class TestDriver
{
/** NEEDSDOC Field sampleField */
public static int sampleField = 32;
/** NEEDSDOC Field inTest */
private boolean inTest = false;
/**
* NEEDSDOC Method main
*
*
* NEEDSDOC @param args
*/
public static void main(String[] args)
{
// Proxy a class
try
{
System.out.println("Proxying java.awt.Frame...");
Class myC = Class.forName("java.awt.Frame");
myC.toSource(System.out, 0);
System.out.println(
"\nProxying org.apache.xml.utils.synthetic.TestDriver...");
myC =
Class.forName("com.ibm.org.apache.xml.utils.synthetic.TestDriver");
myC.toSource(System.out, 0);
}
catch (ClassNotFoundException e)
{
System.out.println("Couldn't proxy: ");
e.printStackTrace();
}
// Start getting serious
try
{
System.out.println("\nBuild a new beast...");
Class myC = Class.declareClass(
"com.ibm.org.apache.xml.utils.synthetic.BuildMe");
Class inner = myC.declareInnerClass("island");
inner.addExtends(Class.forName("java.lang.String"));
Method m = inner.declareMethod("getValue");
m.setReturnType(Class.forName("java.lang.String"));
m.getBody().append("return toString();");
myC.toSource(System.out, 0);
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
catch (SynthesisException e)
{
e.printStackTrace();
}
catch (IllegalStateException e)
{
System.out.println("Unwritten function: " + e);
e.printStackTrace();
}
}
/**
* NEEDSDOC Method dumpClass
*
*
* NEEDSDOC @param C
*/
public static void dumpClass(Class C)
{
System.out.println("toString(): " + C);
System.out.println("\tisPrimitive(): " + C.isPrimitive());
System.out.println("\tisInterface(): " + C.isInterface());
System.out.println("\tisInstance(\"foo\"): " + C.isInstance("foo"));
System.out.println("\tisArray(): " + C.isArray());
System.out.println("\tgetRealClass(): " + C.getRealClass());
}
/**
* NEEDSDOC Method quickcheck
*
*/
public void quickcheck()
{
Inner a = new Inner();
a.setTest(!a.getTest());
}
/**
* <meta name="usage" content="internal"/>
* NEEDSDOC Class Inner <needs-comment/>
*/
private class Inner
{
/**
* NEEDSDOC Method getTest
*
*
* NEEDSDOC (getTest) @return
*/
public boolean getTest()
{
return inTest;
}
/**
* NEEDSDOC Method setTest
*
*
* NEEDSDOC @param test
*/
public void setTest(boolean test)
{
inTest = test;
}
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/synthetic/reflection/Constructor.java
Index: Constructor.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.synthetic.reflection;
import java.lang.reflect.InvocationTargetException;
import org.apache.xml.utils.synthetic.SynthesisException;
/**
* Constructor provides information about, and access to, a
* single constructor for a class.
*
* Constructor permits widening conversions to occur when
* matching the actual parameters to newInstance() with
* the underlying constructor's formal parameters, but
* throws an IllegalArgumentException if a narrowing
* conversion would occur.
*
* @see Member
* @see Class
* @see getConstructors
* @see getConstructor
* @see getDeclaredConstructors
*/
public class Constructor extends EntryPoint implements Member
{
/**
* Actual Java class object. When present, all interactions
* are redirected to it. Allows our Class to function as a
* wrapper for the Java version (in lieu of subclassing or
* a shared Interface), and allows "in-place compilation"
* to replace a generated description with an
* directly runnable class.
*/
private org.apache.xml.utils.synthetic.Class declaringclass = null;
/** NEEDSDOC Field realconstructor */
private java.lang.reflect.Constructor realconstructor = null;
/** NEEDSDOC Field parametertypes */
private org.apache.xml.utils.synthetic.Class[] parametertypes;
/** NEEDSDOC Field parameternames */
private String[] parameternames;
/** NEEDSDOC Field exceptiontypes */
private org.apache.xml.utils.synthetic.Class[] exceptiontypes;
/** NEEDSDOC Field modifiers */
private int modifiers;
/**
* Insert the method's description here.
* <p>
* Creation date: (12-27-99 2:31:39 PM)
* @param realConstructor java.lang.reflect.Constructor
*
* NEEDSDOC @param declaringclass
*/
public Constructor(org.apache.xml.utils.synthetic.Class declaringclass)
{
super(declaringclass);
}
/**
* Insert the method's description here.
* <p>
* Creation date: (12-27-99 2:31:39 PM)
* @param realConstructor java.lang.reflect.Constructor
*
* NEEDSDOC @param ctor
* NEEDSDOC @param declaringclass
*/
public Constructor(java.lang.reflect.Constructor ctor,
org.apache.xml.utils.synthetic.Class declaringclass)
{
super(ctor, declaringclass);
}
/**
* Insert the method's description here.
* <p>
* Creation date: (12-27-99 2:31:39 PM)
* @param realConstructor java.lang.reflect.Constructor
*
* NEEDSDOC @param realconstructor
*/
public Constructor(java.lang.reflect.Constructor realconstructor)
{
super(realconstructor);
}
/**
* Returns a hashcode for this Constructor. The
* hashcode is the same as the hashcode for the
* underlying constructor's declaring class name.
*
* NEEDSDOC ($objectName$) @return
*/
public int hashCode()
{
return getDeclaringClass().getName().hashCode();
}
/**
* Uses the constructor represented by this
* Constructor object to create and initialize a new
* instance of the constructor's declaring class, with
* the specified initialization parameters. Individual
* parameters are automatically unwrapped to match
* primitive formal parameters, and both primitive
* and reference parameters are subject to widening
* conversions as necessary. Returns the newly
* created and initialized object.
* <p>
* Creation proceeds with the following steps, in
* order:
* <p>
* If the class that declares the underlying constructor
* represents an abstract class, the creation throws an
* InstantiationException.
* <p>
* If this Constructor object enforces Java language
* access control and the underlying constructor is
* inaccessible, the creation throws an
* IllegalAccessException.
* <p>
* If the number of actual parameters supplied via
* initargs is different from the number of formal
* parameters required by the underlying constructor,
* the creation throws an IllegalArgumentException.
* <p>
* A new instance of the constructor's declaring class
* is created, and its fields are initialized to their
* default initial values.
* <p>
* For each actual parameter in the supplied initargs
* array:
* <p>
* If the corresponding formal parameter has a
* primitive type, an unwrapping conversion is
* attempted to convert the object value to a value of
* the primitive type. If this attempt fails, the
* creation throws an IllegalArgumentException.
* <p>
*
* If, after possible unwrapping, the parameter value
* cannot be converted to the corresponding formal
* parameter type by an identity or widening
* conversion, the creation throws an
* IllegalArgumentException.
* <p>
* Control transfers to the underlying constructor to
* initialize the new instance. If the constructor
* completes abruptly by throwing an exception, the
* exception is placed in an
* InvocationTargetException and thrown in turn to
* the caller of newInstance.
* <p>
* If the constructor completes normally, returns the
* newly created and initialized instance.
*
*
* NEEDSDOC @param initargs
*
* NEEDSDOC ($objectName$) @return
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the number of actual and formal
* parameters differ, or if an unwrapping
* conversion fails.
* @throws InstantiationException
* if the class that declares the underlying
* constructor represents an abstract class.
* @throws InvocationTargetException
* if the underlying constructor throws an
* exception.
* @throws java.lang.reflect.InvocationTargetException
*/
public Object newInstance(Object initargs[])
throws InstantiationException, IllegalAccessException,
IllegalArgumentException,
java.lang.reflect.InvocationTargetException
{
if (realep != null)
return ((java.lang.reflect.Constructor) realep).newInstance(initargs);
else
throw new InstantiationException(
"Un-reified org.apache.xml.utils.synthetic.Class doesn't yet support
invocation");
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/synthetic/reflection/EntryPoint.java
Index: EntryPoint.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.synthetic.reflection;
import java.lang.reflect.InvocationTargetException;
import org.apache.xml.utils.synthetic.SynthesisException;
/**
* *** OPEN ISSUES:
* Reflection doesn't tell us about deprecation; if we want
* that info, MFC advises mousing our way into the class (ugh).
* Should we at least model that for synthetics?
*/
/**
* API/behaviors shared between Constructors and Methods.
* They're mostly similar, except for what they proxy and
* a few specific calls (name, invoke/getInstance).
*/
abstract public class EntryPoint implements Member
{
/** NEEDSDOC Field realep */
protected Object realep;
/** NEEDSDOC Field declaringclass */
private org.apache.xml.utils.synthetic.Class declaringclass = null;
/** NEEDSDOC Field returntype */
protected org.apache.xml.utils.synthetic.Class returntype = null;
/** NEEDSDOC Field parameternames */
private String[] parameternames = new String[0];
/** NEEDSDOC Field parametertypes */
private org.apache.xml.utils.synthetic.Class[] parametertypes =
new org.apache.xml.utils.synthetic.Class[0];
/** NEEDSDOC Field exceptiontypes */
private org.apache.xml.utils.synthetic.Class[] exceptiontypes =
new org.apache.xml.utils.synthetic.Class[0];
;
/** NEEDSDOC Field modifiers */
private int modifiers;
/** NEEDSDOC Field name */
protected String name = null; // for Methods
// For synthesis:
/** NEEDSDOC Field body */
private StringBuffer body = null;
/** NEEDSDOC Field language */
private String language = null;
// For reifying:
/** NEEDSDOC Field realE, realP */
Class[] realE, realP;
/**
* Insert the method's description here.
* <p>
* Creation date: (12-27-99 2:31:39 PM)
* @param realConstructor java.lang.reflect.Constructor
*
* NEEDSDOC @param declaringclass
*/
public EntryPoint(org.apache.xml.utils.synthetic.Class declaringclass)
{
this.declaringclass = declaringclass;
}
/**
* Nonpublic constructor. Wrap this to appropriate "real" type
*
* NEEDSDOC @param ep
* NEEDSDOC @param declaringclass
*
* @throws IllegalArgumentException
*/
protected EntryPoint(
Object ep, org.apache.xml.utils.synthetic.Class declaringclass)
throws IllegalArgumentException
{
realep = ep;
this.declaringclass = declaringclass;
if (ep instanceof java.lang.reflect.Method)
{
java.lang.reflect.Method m = (java.lang.reflect.Method) ep;
if (declaringclass == null)
{
declaringclass = org.apache.xml.utils.synthetic.Class.forClass(
m.getDeclaringClass());
}
name = m.getName();
modifiers = m.getModifiers();
returntype =
org.apache.xml.utils.synthetic.Class.forClass(m.getReturnType());
realP = m.getParameterTypes();
realE = m.getExceptionTypes();
}
else if (ep instanceof java.lang.reflect.Constructor)
{
java.lang.reflect.Constructor c = (java.lang.reflect.Constructor) ep;
if (declaringclass == null)
{
declaringclass = org.apache.xml.utils.synthetic.Class.forClass(
c.getDeclaringClass());
}
name = declaringclass.getShortName();
modifiers = c.getModifiers();
returntype = declaringclass;
realP = c.getParameterTypes();
realE = c.getExceptionTypes();
}
else
throw new IllegalArgumentException();
}
/**
* Nonpublic constructor. Wrap this to appropriate "real" type
*
* NEEDSDOC @param ep
*
* @throws IllegalArgumentException
*/
protected EntryPoint(Object ep) throws IllegalArgumentException
{
this(ep, null);
}
/**
* Compares this against the specified
* object. Returns true if the objects are the same.
* Two EntryPoints are the same if they were
* declared by the same class, have the same name
* (or are both ctors) and have the same
* formal parameter types.
*
* NEEDSDOC @param obj
*
* NEEDSDOC ($objectName$) @return
*/
public boolean equals(Object obj)
{
EntryPoint otherep = null;
if (obj instanceof EntryPoint)
otherep = (EntryPoint) obj;
else if (obj instanceof java.lang.reflect.Constructor
|| obj instanceof java.lang.reflect.Method)
otherep = (EntryPoint) obj;
return (otherep != null && ((this instanceof Constructor && otherep
instanceof Constructor) || (this instanceof Method && otherep instanceof Method
&& this.getName().equals(
otherep.getName()))) && otherep.getDeclaringClass().equals(
declaringclass) && otherep.getParameterTypes().equals(
parametertypes));
}
/**
* Returns the Class object representing the class that
* declares the constructor represented by this
* Constructor object.
*
* NEEDSDOC ($objectName$) @return
*/
public org.apache.xml.utils.synthetic.Class getDeclaringClass()
{
return declaringclass;
}
/**
* Returns the Class object representing the class that
* will be returned by this EntryPoint. Needed by the Method
* API, but made meaningful for Constructors as well.
*
* NEEDSDOC ($objectName$) @return
*/
public org.apache.xml.utils.synthetic.Class getReturnType()
{
return returntype;
}
/**
* Returns an array of Class objects that represent the
* types of the checked exceptions thrown by the
* underlying constructor represented by this
* Constructor object. Returns an array of length 0 if
* the constructor throws no checked exceptions.
*
* NEEDSDOC ($objectName$) @return
*/
public org.apache.xml.utils.synthetic.Class[] getExceptionTypes()
{
if (realep != null && exceptiontypes == null)
{
exceptiontypes =
new org.apache.xml.utils.synthetic.Class[realE.length];
for (int i = 0; i < realE.length; ++i)
{
exceptiontypes[i] =
org.apache.xml.utils.synthetic.Class.forClass(realE[i]);
}
realE = null;
}
return exceptiontypes;
}
/**
* NEEDSDOC Method addExceptionType
*
*
* NEEDSDOC @param exception
*
* @throws SynthesisException
*/
public void addExceptionType(
org.apache.xml.utils.synthetic.Class exception)
throws SynthesisException
{
if (realep != null)
throw new SynthesisException(SynthesisException.REIFIED);
org.apache.xml.utils.synthetic.Class[] e =
new org.apache.xml.utils.synthetic.Class[exceptiontypes.length + 1];
System.arraycopy(exceptiontypes, 0, e, 0, exceptiontypes.length);
e[exceptiontypes.length] = exception;
exceptiontypes = e;
}
/**
* Returns the Java language modifiers for the
* constructor represented by this Constructor object,
* as an integer. The Modifier class should be used to
* decode the modifiers.
*
* @see
* Modifier
*
* NEEDSDOC ($objectName$) @return
*/
public int getModifiers()
{
return modifiers;
}
/**
* Member method. C'tor's name is always that of the defining class.
* Methods have a "real" name.
* Creation date: (12-25-99 1:32:06 PM)
* @return java.lang.String
*/
public java.lang.String getName()
{
if (this instanceof Constructor)
return declaringclass.getShortName();
return name;
}
/**
* Member method. C'tor's name is always that of the defining class.
* Methods have a "real" name.
* Creation date: (12-25-99 1:32:06 PM)
*
* NEEDSDOC @param name
* @return java.lang.String
*
* @throws SynthesisException
*/
public void setName(String name) throws SynthesisException
{
if (realep != null)
throw new SynthesisException(SynthesisException.REIFIED);
this.name = name;
}
/**
* Returns an array of Class objects that represent the
* formal parameter types, in declaration order, of the
* constructor represented by this Constructor object.
* Returns an array of length 0 if the underlying
* constructor takes no parameters.
*
* NEEDSDOC ($objectName$) @return
*/
public org.apache.xml.utils.synthetic.Class[] getParameterTypes()
{
if (realep != null && parametertypes == null)
{
parametertypes =
new org.apache.xml.utils.synthetic.Class[realP.length];
for (int i = 0; i < realP.length; ++i)
{
parametertypes[i] =
org.apache.xml.utils.synthetic.Class.forClass(realP[i]);
}
realP = null;
}
return parametertypes;
}
/**
* NEEDSDOC Method getParameterNames
*
*
* NEEDSDOC (getParameterNames) @return
*/
public String[] getParameterNames()
{
return parameternames;
}
/**
* NEEDSDOC Method addParameter
*
*
* NEEDSDOC @param type
* NEEDSDOC @param name
*
* @throws SynthesisException
*/
public void addParameter(
org.apache.xml.utils.synthetic.Class type, String name)
throws SynthesisException
{
if (realep != null)
throw new SynthesisException(SynthesisException.REIFIED);
org.apache.xml.utils.synthetic.Class[] types =
new org.apache.xml.utils.synthetic.Class[parametertypes.length + 1];
System.arraycopy(parametertypes, 0, types, 0, parametertypes.length);
types[parametertypes.length] = type;
parametertypes = types;
String[] names = new String[parameternames.length + 1];
System.arraycopy(parameternames, 0, names, 0, parameternames.length);
names[parameternames.length] = name;
parameternames = names;
}
/**
* Returns a hashcode for this Constructor. The
* hashcode is the same as the hashcode for the
* underlying constructor's declaring class name,
* xor'ed (for Methods) with the method name.
* (Implemented in the subclasses rather than here.)
*
* NEEDSDOC ($objectName$) @return
*/
abstract public int hashCode();
/**
* Assert the Class object representing the class that
* declares the constructor represented by this
* Constructor object.
*
* NEEDSDOC @param declaringClass
*
* @throws SynthesisException
*/
public void setDeclaringClass(
org.apache.xml.utils.synthetic.Class declaringClass)
throws SynthesisException
{
if (realep != null)
throw new SynthesisException(SynthesisException.REIFIED);
this.declaringclass = declaringClass;
}
/**
* Should only be accepted before a "real" entrypoint is bound.
* Creation date: (12-25-99 1:28:28 PM)
* @return int
* @param modifiers int
*
* @throws SynthesisException
*/
public void setModifiers(int modifiers) throws SynthesisException
{
if (realep != null)
throw new SynthesisException(SynthesisException.REIFIED);
this.modifiers = modifiers;
}
/**
* Return a string describing this Constructor. The
* string is formatted as the constructor access
* modifiers, if any, followed by the fully-qualified
* name of the declaring class, followed by a
* parenthesized, comma-separated list of the
* constructor's formal parameter types. For example:
* <code>
* public java.util.Hashtable(int,float)
* </code>
* <p>
* The only possible modifiers for constructors are
* the access modifiers public, protected or
* private. Only one of these may appear, or none
* if the constructor has default (package) access.
* <p>
* Methods will also display their checked exceptions.
*
* NEEDSDOC ($objectName$) @return
*/
public String toString()
{
StringBuffer sb =
new StringBuffer(java.lang.reflect.Modifier.toString(getModifiers()));
if (this instanceof org.apache.xml.utils.synthetic.reflection.Method)
sb.append(' ').append(getReturnType()).append(
getDeclaringClass().getName()).append('.').append(getName());
else
sb.append(getDeclaringClass().getName());
sb.append('(');
org.apache.xml.utils.synthetic.Class[] p = getParameterTypes();
if (p != null && p.length > 0)
{
sb.append(p[0].getName());
for (int i = 1; i < p.length; ++i)
{
sb.append(',').append(p[i].getName());
}
}
sb.append(')');
if (this instanceof org.apache.xml.utils.synthetic.reflection.Method)
{
p = getExceptionTypes();
if (p != null && p.length > 0)
{
sb.append(" throws ").append(p[0].getName());
for (int i = 1; i < p.length; ++i)
{
sb.append(',').append(p[i].getName());
}
}
}
return sb.toString();
}
/**
* Extension: For synthesis, we need a place to hang a
* method body.
*
* NEEDSDOC @param language
* NEEDSDOC @param body
*
* @throws SynthesisException
*/
public void setBody(String language, StringBuffer body)
throws SynthesisException
{
if (realep != null)
throw new SynthesisException(SynthesisException.REIFIED);
this.language = language;
this.body = body;
}
/**
* Extension: For synthesis, we need a place to hang a
* method body. Note that this returns a mutable object,
* for editing etc. Slightly sloppy first cut.
*
* NEEDSDOC ($objectName$) @return
*/
public StringBuffer getBody()
{
if (body == null)
body = new StringBuffer();
return body;
}
/**
* Extension: For synthesis, we need a place to hang a
* method body.
*
* NEEDSDOC ($objectName$) @return
*/
public String getLanguage()
{
return language;
}
/**
* Generate Java code
*
* NEEDSDOC @param basetab
*
* NEEDSDOC ($objectName$) @return
*/
public String toSource(String basetab)
{
StringBuffer sb = new StringBuffer();
sb.append(basetab).append(
java.lang.reflect.Modifier.toString(getModifiers()));
if (this instanceof org.apache.xml.utils.synthetic.reflection.Method)
{
if (returntype != null)
sb.append(" ").append(getReturnType().getJavaName());
else
sb.append(" void");
}
sb.append(" ").append(getName()).append("(");
org.apache.xml.utils.synthetic.Class[] types = getParameterTypes();
if (types != null & types.length > 0)
{
sb.append(types[0].getJavaName());
if (parameternames != null)
sb.append(' ').append(parameternames[0]);
for (int i = 1; i < types.length; ++i)
{
sb.append(',').append(types[i].getJavaName());
if (parameternames != null)
sb.append(' ').append(parameternames[i]);
}
}
sb.append(')');
types = getExceptionTypes();
if (types != null & types.length > 0)
{
sb.append(" throws ").append(types[0].getJavaName());
for (int i = 1; i < types.length; ++i)
{
sb.append(',').append(types[i].getJavaName());
}
}
if (body == null)
sb.append("; // No method body available\n");
else
{
sb.append("\n" + basetab + "{\n");
if (language == null || "java".equals(language))
{
sb.append(basetab + "// ***** Should prettyprint this code...\n");
sb.append(basetab + body + "\n");
}
else
{
sb.append(basetab + "// ***** Generate BSF invocation!?\n");
}
sb.append(basetab + "}\n");
}
return sb.toString();
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/synthetic/reflection/Field.java
Index: Field.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.synthetic.reflection;
import org.apache.xml.utils.synthetic.Class;
import org.apache.xml.utils.synthetic.SynthesisException;
/**
* A Field provides information about, and dynamic access
* to, a single field of a class or an interface. The reflected
* field may be a class (static) field or an instance field.
* <p>
* A Field permits widening conversions to occur during a
* get or set access operation, but throws an
* IllegalArgumentException if a narrowing conversion
* would occur.
*
* @see Member
* @see Class
* @see getFields
* @see getField
* @see getDeclaredFields
* @see getDeclaredField
*/
public class Field extends Object implements Member
{
/** NEEDSDOC Field name, initializer */
public String name, initializer = null;
/** NEEDSDOC Field modifiers */
int modifiers;
/** NEEDSDOC Field realfield */
java.lang.reflect.Field realfield = null;
/** NEEDSDOC Field declaringClass, type */
Class declaringClass, type;
/**
* Proxy constructor
*
* NEEDSDOC @param realfield
* NEEDSDOC @param declaringClass
*/
public Field(java.lang.reflect.Field realfield,
org.apache.xml.utils.synthetic.Class declaringClass)
{
this(realfield.getName(), declaringClass);
this.realfield = realfield;
this.type =
org.apache.xml.utils.synthetic.Class.forClass(realfield.getType());
}
/**
* Synthesis constructor
*
* NEEDSDOC @param name
* NEEDSDOC @param declaringClass
*/
public Field(String name,
org.apache.xml.utils.synthetic.Class declaringClass)
{
this.name = name;
this.declaringClass = declaringClass;
}
/**
* Compares this Field against the specified object.
* Returns true if the objects are the same. Two
* Fields are the same if they were declared by the
* same class and have the same name and type.
*
* NEEDSDOC @param obj
*
* NEEDSDOC ($objectName$) @return
*/
public boolean equals(Object obj)
{
if (realfield != null)
return realfield.equals(obj);
else if (obj instanceof Field)
{
Field objf = (Field) obj;
return (declaringClass.equals(objf.declaringClass)
&& name.equals(objf.name) && type.equals(objf.type));
}
else
return false;
}
/**
* Returns the value of the field represented by this
* Field, on the specified object. The value is
* automatically wrapped in an object if it has a
* primitive type.
* <p>
* The underlying field's value is obtained as follows:
* <p>
* If the underlying field is a static field, the object
* argument is ignored; it may be null.
* <p>
* Otherwise, the underlying field is an instance
* field. If the specified object argument is null, the
* method throws a NullPointerException. If the
* specified object is not an instance of the class or
* interface declaring the underlying field, the
* method throws an IllegalArgumentException.
* <p>
* If this Field object enforces Java language access
* control, and the underlying field is inaccessible,
* the method throws an IllegalAccessException.
* <p>
* Otherwise, the value is retrieved from the
* underlying instance or static field. If the field has a
* primitive type, the value is wrapped in an object
* before being returned, otherwise it is returned as
* is.
*
*
* NEEDSDOC @param obj
*
* NEEDSDOC ($objectName$) @return
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the specified object is not an instance of
* the class or interface declaring the
* underlying field.
* @throws NullPointerException
* if the specified object is null.
*/
public Object get(Object obj)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
return realfield.get(obj);
throw new java.lang.IllegalStateException();
}
/**
* Get the value of a field as a boolean on specified
* object.
*
*
* NEEDSDOC @param obj
*
* NEEDSDOC ($objectName$) @return
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the field value cannot be converted to the
* return type by a widening conversion.
* @see
* get
*/
public boolean getBoolean(Object obj)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
return realfield.getBoolean(obj);
throw new java.lang.IllegalStateException();
}
/**
* Get the value of a field as a byte on specified
* object.
*
*
* NEEDSDOC @param obj
*
* NEEDSDOC ($objectName$) @return
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the field value cannot be converted to the
* return type by a widening conversion.
* @see
* get
*/
public byte getByte(Object obj)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
return realfield.getByte(obj);
throw new java.lang.IllegalStateException();
}
/**
* Get the value of a field as a char on specified
* object.
*
*
* NEEDSDOC @param obj
*
* NEEDSDOC ($objectName$) @return
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the field value cannot be converted to the
* return type by a widening conversion.
* @see
* get
*/
public char getChar(Object obj)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
return realfield.getChar(obj);
throw new java.lang.IllegalStateException();
}
/**
* Returns the Class object representing the class or
* interface that declares the field represented by this
* Field object.
*
* NEEDSDOC ($objectName$) @return
*/
public org.apache.xml.utils.synthetic.Class getDeclaringClass()
{
if (realfield != null)
return org.apache.xml.utils.synthetic.Class.forClass(
realfield.getDeclaringClass());
throw new java.lang.IllegalStateException();
}
/**
* Get the value of a field as a double on specified
* object.
*
*
* NEEDSDOC @param obj
*
* NEEDSDOC ($objectName$) @return
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the field value cannot be converted to the
* return type by a widening conversion.
* @see
* get
*/
public double getDouble(Object obj)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
return realfield.getDouble(obj);
throw new java.lang.IllegalStateException();
}
/**
* Get the value of a field as a float on specified
* object.
*
*
* NEEDSDOC @param obj
*
* NEEDSDOC ($objectName$) @return
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the field value cannot be converted to the
* return type by a widening conversion.
* @see
* get
*/
public float getFloat(Object obj)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
return realfield.getFloat(obj);
throw new java.lang.IllegalStateException();
}
/**
* Get the value of a field as a int on specified object.
*
*
* NEEDSDOC @param obj
*
* NEEDSDOC ($objectName$) @return
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the field value cannot be converted to the
* return type by a widening conversion.
* @see
* get
*/
public int getInt(Object obj)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
return realfield.getInt(obj);
throw new java.lang.IllegalStateException();
}
/**
* Get the value of a field as a long on specified
* object.
*
*
* NEEDSDOC @param obj
*
* NEEDSDOC ($objectName$) @return
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the field value cannot be converted to the
* return type by a widening conversion.
* @see
* get
*/
public long getLong(Object obj)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
return realfield.getLong(obj);
throw new java.lang.IllegalStateException();
}
/**
* Returns the Java language modifiers for the field
* represented by this Field object, as an integer. The
* Modifier class should be used to decode the
* modifiers.
*
* @see
* Modifier
*
* NEEDSDOC ($objectName$) @return
*/
public int getModifiers()
{
if (realfield != null)
modifiers = realfield.getModifiers();
return modifiers;
}
/**
* NEEDSDOC Method getInitializer
*
*
* NEEDSDOC (getInitializer) @return
*/
public String getInitializer()
{
return initializer;
}
/**
* NEEDSDOC Method setInitializer
*
*
* NEEDSDOC @param i
*
* @throws SynthesisException
*/
public void setInitializer(String i) throws SynthesisException
{
if (realfield != null)
throw new SynthesisException(SynthesisException.REIFIED);
initializer = i;
}
/**
* Insert the method's description here.
* Creation date: (12-25-99 2:02:26 PM)
* @return java.lang.String
*/
public java.lang.String getName()
{
return name;
}
/**
* Get the value of a field as a short on specified
* object.
*
*
* NEEDSDOC @param obj
*
* NEEDSDOC ($objectName$) @return
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the field value cannot be converted to the
* return type by a widening conversion.
* @see
* get
*/
public short getShort(Object obj)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
return realfield.getShort(obj);
throw new java.lang.IllegalStateException();
}
/**
* Returns a Class object that identifies the declared
* type for the field represented by this Field object.
*
* NEEDSDOC ($objectName$) @return
*/
public Class getType()
{
if (realfield != null)
type = Class.forClass(realfield.getType());
return type;
}
/**
* NEEDSDOC Method setType
*
*
* NEEDSDOC @param type
*
* @throws SynthesisException
*/
public void setType(org.apache.xml.utils.synthetic.Class type)
throws SynthesisException
{
if (realfield != null)
throw new SynthesisException(SynthesisException.REIFIED);
this.type = type;
}
/**
* Returns a hashcode for this Field. This is
* computed as the exclusive-or of the hashcodes for
* the underlying field's declaring class name and its
* name.
*
* NEEDSDOC ($objectName$) @return
*/
public int hashCode()
{
if (realfield != null)
return realfield.hashCode();
else
return declaringClass.getName().hashCode() ^ name.hashCode();
}
/**
* Sets the field represented by this Field object on
* the specified object argument to the specified new
* value. The new value is automatically unwrapped
* if the underlying field has a primitive type.
*
* The operation proceeds as follows:
*
* If the underlying field is static, the object
* argument is ignored; it may be null.
*
* Otherwise the underlying field is an instance field.
* If the specified object argument is null, the
* method throws a NullPointerException. If the
* specified object argument is not an instance of the
* class or interface declaring the underlying field,
* the method throws an IllegalArgumentException.
*
* If this Field object enforces Java language access
* control, and the underlying field is inaccessible,
* the method throws an IllegalAccessException.
*
* If the underlying field is final, the method throws
* an IllegalAccessException.
*
* If the underlying field is of a primitive type, an
* unwrapping conversion is attempted to convert the
* new value to a value of a primitive type. If this
* attempt fails, the method throws an
* IllegalArgumentException.
*
* If, after possible unwrapping, the new value
* cannot be converted to the type of the underlying
* field by an identity or widening conversion, the
* method throws an IllegalArgumentException.
*
* The field is set to the possibly unwrapped and
* widened new value.
*
*
* NEEDSDOC @param obj
* NEEDSDOC @param value
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the specified object is not an instance of
* the class or interface declaring the
* underlying field, or if an unwrapping
* conversion fails.
* @throws NullPointerException
* if the specified object is null.
*/
public void set(Object obj, Object value)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
realfield.set(obj, value);
throw new java.lang.IllegalStateException();
}
/**
* Set the value of a field as a boolean on specified
* object.
*
*
* NEEDSDOC @param obj
* NEEDSDOC @param z
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the specified object is not an instance of
* the class or interface declaring the
* underlying field, or if an unwrapping
* conversion fails.
* @see
* set
*/
public void setBoolean(Object obj, boolean z)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
realfield.setBoolean(obj, z);
throw new java.lang.IllegalStateException();
}
/**
* Set the value of a field as a byte on specified
* object.
*
*
* NEEDSDOC @param obj
* NEEDSDOC @param b
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the specified object is not an instance of
* the class or interface declaring the
* underlying field, or if an unwrapping
* conversion fails.
* @see
* set
*/
public void setByte(Object obj, byte b)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
realfield.setByte(obj, b);
throw new java.lang.IllegalStateException();
}
/**
* Set the value of a field as a char on specified
* object.
*
*
* NEEDSDOC @param obj
* NEEDSDOC @param c
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the specified object is not an instance of
* the class or interface declaring the
* underlying field, or if an unwrapping
* conversion fails.
* @see
* set
*/
public void setChar(Object obj, char c)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
realfield.setChar(obj, c);
throw new java.lang.IllegalStateException();
}
/**
* Returns the Class object representing the class that
* declares the constructor represented by this
* Constructor object.
*
* NEEDSDOC @param declaringClass
*/
public void setDeclaringClass(
org.apache.xml.utils.synthetic.Class declaringClass)
{
this.declaringClass = declaringClass;
}
/**
* Set the value of a field as a double on specified
* object.
*
*
* NEEDSDOC @param obj
* NEEDSDOC @param d
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the specified object is not an instance of
* the class or interface declaring the
* underlying field, or if an unwrapping
* conversion fails.
* @see
* set
*/
public void setDouble(Object obj, double d)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
realfield.setDouble(obj, d);
throw new java.lang.IllegalStateException();
}
/**
* Set the value of a field as a float on specified
* object.
*
*
* NEEDSDOC @param obj
* NEEDSDOC @param f
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the specified object is not an instance of
* the class or interface declaring the
* underlying field, or if an unwrapping
* conversion fails.
* @see
* set
*/
public void setFloat(Object obj, float f)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
realfield.setFloat(obj, f);
throw new java.lang.IllegalStateException();
}
/**
* Set the value of a field as an int on specified
* object.
*
*
* NEEDSDOC @param obj
* NEEDSDOC @param i
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the specified object is not an instance of
* the class or interface declaring the
* underlying field, or if an unwrapping
* conversion fails.
* @see
* set
*/
public void setInt(Object obj, int i)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
realfield.setInt(obj, i);
throw new java.lang.IllegalStateException();
}
/**
* Set the value of a field as a long on specified
* object.
*
*
* NEEDSDOC @param obj
* NEEDSDOC @param l
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the specified object is not an instance of
* the class or interface declaring the
* underlying field, or if an unwrapping
* conversion fails.
* @see
* set
*/
public void setLong(Object obj, long l)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
realfield.setLong(obj, l);
throw new java.lang.IllegalStateException();
}
/**
* Insert the method's description here.
* Creation date: (12-25-99 1:28:28 PM)
* @return int
* @param modifiers int
*
* @throws SynthesisException
*/
public void setModifiers(int modifiers) throws SynthesisException
{
if (realfield != null)
throw new SynthesisException(SynthesisException.REIFIED);
this.modifiers = modifiers;
}
/**
* Set the value of a field as a short on specified
* object.
*
*
* NEEDSDOC @param obj
* NEEDSDOC @param s
* @throws IllegalAccessException
* if the underlying constructor is inaccessible.
* @throws IllegalArgumentException
* if the specified object is not an instance of
* the class or interface declaring the
* underlying field, or if an unwrapping
* conversion fails.
* @see
* set
*/
public void setShort(Object obj, short s)
throws IllegalArgumentException, IllegalAccessException
{
if (realfield != null)
realfield.setShort(obj, s);
throw new java.lang.IllegalStateException();
}
/**
* Return a string describing this Field. The format is
* the access modifiers for the field, if any, followed
* by the field type, followed by a space, followed by
* the fully-qualified name of the class declaring the
* field, followed by a period, followed by the name
* of the field. For example:
* <code>
* public static final int java.lang.Thread.MIN_PRIORITY
* private int java.io.FileDescriptor.fd
* </code>
*
* The modifiers are placed in canonical order as
* specified by "The Java Language Specification".
* This is public, protected or private first,
* and then other modifiers in the following order:
* static, final, transient, volatile.
*
* NEEDSDOC ($objectName$) @return
*/
public String toString()
{
if (realfield != null)
return realfield.toString();
throw new java.lang.IllegalStateException();
}
/**
* Output the Field as Java sourcecode
*
* NEEDSDOC ($objectName$) @return
*/
public String toSource()
{
StringBuffer sb = new StringBuffer(
java.lang.reflect.Modifier.toString(getModifiers())).append(' ').append(
getType().getJavaName()).append(' ').append(getName());
String i = getInitializer();
if (i != null && i.length() > 0)
sb.append('=').append(i);
sb.append(';');
return sb.toString();
}
}
1.1
xml-xalan/java/src/org/apache/xml/utils/synthetic/reflection/Member.java
Index: Member.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.synthetic.reflection;
import org.apache.xml.utils.synthetic.SynthesisException;
/**
* Member is an interface that reflects identifying
* information about a single member (a field or a method)
* or a constructor.
* <p>
* Note that this is <strong>not</strong> currently derived from
* java.lang.reflect.Member, due to questions about how to handle
* declarignClass.
*
* @see Field
* @see Method
* @see Constructor
* @see org.apache.xml.utils.synthetic.Class
* @see java.lang.reflect.Member
*/
public interface Member
{
/**
* Returns the Class object representing the class or
* interface that declares the member or constructor
* represented by this Member.
*
* NEEDSDOC ($objectName$) @return
*/
public abstract org.apache.xml.utils.synthetic.Class getDeclaringClass();
/**
* Returns the Java language modifiers for the
* member or constructor represented by this
* Member, as an integer. The Modifier class should
* be used to decode the modifiers in the integer.
*
* @see Modifier
*
* NEEDSDOC ($objectName$) @return
*/
public abstract int getModifiers();
/**
* Returns the Class object representing the class or
* interface that declares the member or constructor
* represented by this Member.
*
* NEEDSDOC @param declaringClass
*
* @throws SynthesisException
*/
public abstract void setDeclaringClass(
org.apache.xml.utils.synthetic.Class declaringClass)
throws SynthesisException;
/**
* Returns the Java language modifiers for the
* member or constructor represented by this
* Member, as an integer. The Modifier class should
* be used to decode the modifiers in the integer.
*
* @see Modifier
*
* NEEDSDOC @param modifiers
*
* @throws SynthesisException
*/
public abstract void setModifiers(int modifiers) throws SynthesisException;
}
1.1
xml-xalan/java/src/org/apache/xml/utils/synthetic/reflection/Method.java
Index: Method.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, Lotus
* Development Corporation., http://www.lotus.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xml.utils.synthetic.reflection;
import java.lang.reflect.InvocationTargetException;
import org.apache.xml.utils.synthetic.SynthesisException;
/**
* A Method provides information about, and access to, a
* single method on a class or interface. The reflected
* method may be a class method or an instance method
* (including an abstract method).
* <p>
* A Method permits widening conversions to occur when
* matching the actual parameters to invokewith the
* underlying method's formal parameters, but it throws an
* IllegalArgumentException if a narrowing conversion
* would occur.
* <p>
* Need to add method body, a la Matt's codebuffer.
* That may or may not imply retaining the final return value
* separately and passing in a how-to-use-it mechanism...?
*
* @see Member
* @see Class
* @see getMethods
* @see getMethod
* @see getDeclaredMethods
* @see getDeclaredMethod
*/
public class Method extends EntryPoint implements Member
{
/**
* Insert the method's description here.
* <p>
* Creation date: (12-27-99 2:31:39 PM)
* @param realConstructor java.lang.reflect.Constructor
*
* NEEDSDOC @param name
* NEEDSDOC @param declaringclass
*/
public Method(String name,
org.apache.xml.utils.synthetic.Class declaringclass)
{
super(declaringclass);
this.name = name;
}
/**
* Insert the method's description here.
* <p>
* Creation date: (12-27-99 2:31:39 PM)
* @param realConstructor java.lang.reflect.Constructor
*
* NEEDSDOC @param ctor
* NEEDSDOC @param declaringclass
*/
public Method(java.lang.reflect.Method ctor,
org.apache.xml.utils.synthetic.Class declaringclass)
{
super(ctor, declaringclass);
}
/**
* Insert the method's description here.
* <p>
* Creation date: (12-27-99 2:31:39 PM)
* @param realConstructor java.lang.reflect.Constructor
*
* NEEDSDOC @param realmethod
*/
public Method(java.lang.reflect.Method realmethod)
{
super(realmethod);
}
/**
* Returns a hashcode for this Method. The hashcode
* is computed as the exclusive-or of the hashcodes
* for the underlying method's declaring class name
* and the method's name.
*
* NEEDSDOC ($objectName$) @return
*/
/**
* Returns a hashcode for this Constructor. The
* hashcode for a Method is the hashcode for the
* underlying constructor's declaring class name,
* XORed with the name of this method.
*/
public int hashCode()
{
return getDeclaringClass().getName().hashCode() ^ getName().hashCode();
}
/**
* Invokes the underlying method represented by this
* Method object, on the specified object with the
* specified parameters. Individual parameters are
* automatically unwrapped to match primitive
* formal parameters, and both primitive and
* reference parameters are subject to widening
* conversions as necessary. The value returned by
* the underlying method is automatically wrapped
* in an object if it has a primitive type.
*
* Method invocation proceeds with the following
* steps, in order:
*
* If the underlying method is static, then the
* specified object argument is ignored. It may be
* null.
*
* Otherwise, the method is an instance method. If
* the specified object argument is null, the
* invocation throws a NullPointerException.
* Otherwise, if the specified object argument is not
* an instance of the class or interface declaring the
* underlying method, the invocation throws an
* IllegalArgumentException.
*
* If this Method object enforces Java language access
* control and the underlying method is inaccessible,
* the invocation throws an IllegalAccessException.
*
* If the number of actual parameters supplied via
* args is different from the number of formal
* parameters required by the underlying method, the
* invocation throws an IllegalArgumentException.
*
* For each actual parameter in the supplied args
* array:
*
* If the corresponding formal parameter has a
* primitive type, an unwrapping conversion is
* attempted to convert the object value to a value of
* a primitive type. If this attempt fails, the
* invocation throws an IllegalArgumentException.
*
* If, after possible unwrapping, the parameter value
* cannot be converted to the corresponding formal
* parameter type by an identity or widening
* conversion, the invocation throws an
* IllegalArgumentException.
*
* If the underlying method is an instance method, it
* is invoked using dynamic method lookup as
* documented in The Java Language Specification,
* section 15.11.4.4; in particular, overriding based
* on the runtime type of the target object will occur.
*
* If the underlying method is static, it is invoked as
* exactly the method on the declaring class.
*
* Control transfers to the underlying method. If the
* method completes abruptly by throwing an
* exception, the exception is placed in an
* InvocationTargetException and thrown in turn to
* the caller of invoke.
*
* If the method completes normally, the value it
* returns is returned to the caller of invoke; if the
* value has a primitive type, it is first appropriately
* wrapped in an object. If the underlying method
* return type is void, the invocation returns null.
*
* Throws: IllegalAccessException
* if the underlying method is inaccessible.
* Throws: IllegalArgumentException
* if the number of actual and formal
* parameters differ, or if an unwrapping
* conversion fails.
* Throws: InvocationTargetException
* if the underlying method throws an
* exception.
* Throws: NullPointerException
* if the specified object is null.
*
* NEEDSDOC @param obj
* NEEDSDOC @param args
*
* NEEDSDOC ($objectName$) @return
*
* @throws IllegalAccessException
* @throws IllegalArgumentException
* @throws java.lang.reflect.InvocationTargetException
*/
public Object invoke(Object obj, Object args[])
throws IllegalAccessException, IllegalArgumentException,
java.lang.reflect.InvocationTargetException
{
if (realep != null)
return ((java.lang.reflect.Method) realep).invoke(obj, args);
else
throw new IllegalAccessException(
"Un-reified org.apache.xml.utils.synthetic.Class doesn't yet support
invocation");
}
/**
* NEEDSDOC Method setReturnType
*
*
* NEEDSDOC @param returntype
*
* @throws SynthesisException
*/
public void setReturnType(org.apache.xml.utils.synthetic.Class returntype)
throws SynthesisException
{
if (realep != null)
throw new SynthesisException(SynthesisException.REIFIED);
this.returntype = returntype;
}
}
1.3 +1 -1 xml-xalan/java/src/org/apache/xpath/Arg.java
Index: Arg.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/Arg.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Arg.java 2000/10/30 18:58:20 1.2
+++ Arg.java 2000/11/23 04:58:53 1.3
@@ -56,7 +56,7 @@
*/
package org.apache.xpath;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xpath.objects.XObject;
/**
1.10 +1 -1 xml-xalan/java/src/org/apache/xpath/DOM2Helper.java
Index: DOM2Helper.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/DOM2Helper.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- DOM2Helper.java 2000/11/13 16:27:26 1.9
+++ DOM2Helper.java 2000/11/23 04:58:54 1.10
@@ -210,7 +210,7 @@
*/
parser.setErrorHandler(
- new org.apache.xalan.utils.DefaultErrorHandler());
+ new org.apache.xml.utils.DefaultErrorHandler());
// if(null != m_entityResolver)
// {
1.11 +4 -4 xml-xalan/java/src/org/apache/xpath/DOMHelper.java
Index: DOMHelper.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/DOMHelper.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- DOMHelper.java 2000/11/13 16:27:26 1.10
+++ DOMHelper.java 2000/11/23 04:58:54 1.11
@@ -63,10 +63,10 @@
import javax.xml.transform.TransformerException;
-import org.apache.xalan.utils.NSInfo;
-import org.apache.xalan.utils.QName;
-import org.apache.xalan.utils.StringBufferPool;
-import org.apache.xalan.utils.FastStringBuffer;
+import org.apache.xml.utils.NSInfo;
+import org.apache.xml.utils.QName;
+import org.apache.xml.utils.StringBufferPool;
+import org.apache.xml.utils.FastStringBuffer;
import org.apache.xalan.res.XSLMessages;
import org.apache.xpath.res.XPATHErrorResources;
1.10 +1 -1 xml-xalan/java/src/org/apache/xpath/Expression.java
Index: Expression.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/Expression.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Expression.java 2000/11/13 16:27:26 1.9
+++ Expression.java 2000/11/23 04:58:54 1.10
@@ -66,7 +66,7 @@
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
-import org.apache.xalan.utils.SAXSourceLocator;
+import org.apache.xml.utils.SAXSourceLocator;
import javax.xml.transform.SourceLocator;
import javax.xml.transform.ErrorListener;
1.7 +1 -1 xml-xalan/java/src/org/apache/xpath/NodeSet.java
Index: NodeSet.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/NodeSet.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- NodeSet.java 2000/11/14 23:15:10 1.6
+++ NodeSet.java 2000/11/23 04:58:55 1.7
@@ -63,7 +63,7 @@
import org.w3c.dom.traversal.NodeFilter;
import org.w3c.dom.DOMException;
-import org.apache.xalan.utils.NodeVector;
+import org.apache.xml.utils.NodeVector;
import org.apache.xpath.axes.ContextNodeList;
/**
1.17 +3 -3
xml-xalan/java/src/org/apache/xpath/SourceTreeManager.java
Index: SourceTreeManager.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/SourceTreeManager.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- SourceTreeManager.java 2000/11/16 20:04:50 1.16
+++ SourceTreeManager.java 2000/11/23 04:58:55 1.17
@@ -79,8 +79,8 @@
import org.apache.xalan.res.XSLMessages;
import org.apache.xalan.stree.SourceTreeHandler;
-import org.apache.xalan.utils.SystemIDResolver;
-import org.apache.xalan.utils.SAXSourceLocator;
+import org.apache.xml.utils.SystemIDResolver;
+import org.apache.xml.utils.SAXSourceLocator;
import org.apache.xpath.res.XPATHErrorResources;
import javax.xml.transform.SourceLocator;
@@ -250,7 +250,7 @@
}
catch (TransformerException te)
{
- throw new org.apache.xalan.utils.WrappedRuntimeException(te);
+ throw new org.apache.xml.utils.WrappedRuntimeException(te);
}
}
1.12 +2 -2 xml-xalan/java/src/org/apache/xpath/VariableStack.java
Index: VariableStack.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/VariableStack.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- VariableStack.java 2000/11/15 16:18:46 1.11
+++ VariableStack.java 2000/11/23 04:58:55 1.12
@@ -59,8 +59,8 @@
import java.util.Stack;
import java.util.Vector;
-import org.apache.xalan.utils.QName;
-import org.apache.xalan.utils.IntStack;
+import org.apache.xml.utils.QName;
+import org.apache.xml.utils.IntStack;
import org.apache.xpath.XPathContext;
import org.apache.xpath.objects.XObject;
import org.apache.xpath.objects.XRTreeFrag;
1.12 +5 -5 xml-xalan/java/src/org/apache/xpath/XPath.java
Index: XPath.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/XPath.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- XPath.java 2000/11/14 18:56:26 1.11
+++ XPath.java 2000/11/23 04:58:55 1.12
@@ -67,8 +67,8 @@
import java.io.ObjectInputStream;
import java.io.IOException;
-import org.apache.xalan.utils.PrefixResolver;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.PrefixResolver;
+import org.apache.xml.utils.QName;
import org.apache.xpath.res.XPATHErrorResources;
import org.apache.xpath.functions.Function;
@@ -86,7 +86,7 @@
import javax.xml.transform.TransformerException;
import javax.xml.transform.SourceLocator;
import javax.xml.transform.ErrorListener;
-import org.apache.xalan.utils.SAXSourceLocator;
+import org.apache.xml.utils.SAXSourceLocator;
import org.apache.xpath.patterns.NodeTest;
/**
@@ -264,9 +264,9 @@
}
else
{
- while (e instanceof org.apache.xalan.utils.WrappedRuntimeException)
+ while (e instanceof org.apache.xml.utils.WrappedRuntimeException)
{
- e = ((org.apache.xalan.utils.WrappedRuntimeException)
e).getException();
+ e = ((org.apache.xml.utils.WrappedRuntimeException)
e).getException();
}
1.6 +2 -2 xml-xalan/java/src/org/apache/xpath/XPathAPI.java
Index: XPathAPI.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/XPathAPI.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XPathAPI.java 2000/11/13 16:27:27 1.5
+++ XPathAPI.java 2000/11/23 04:58:55 1.6
@@ -67,8 +67,8 @@
import org.apache.xpath.XPath;
import org.apache.xpath.compiler.XPathParser;
import org.apache.xpath.XPathContext;
-import org.apache.xalan.utils.PrefixResolverDefault;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.PrefixResolverDefault;
+import org.apache.xml.utils.PrefixResolver;
import org.apache.xpath.objects.XObject;
/**
1.14 +6 -6 xml-xalan/java/src/org/apache/xpath/XPathContext.java
Index: XPathContext.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/XPathContext.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- XPathContext.java 2000/11/13 16:27:27 1.13
+++ XPathContext.java 2000/11/23 04:58:56 1.14
@@ -63,11 +63,11 @@
import java.util.Stack;
// Xalan imports
-import org.apache.xalan.utils.IntStack;
-import org.apache.xalan.utils.NSInfo;
-import org.apache.xalan.utils.PrefixResolver;
-import org.apache.xalan.utils.QName;
-import org.apache.xalan.utils.NodeVector;
+import org.apache.xml.utils.IntStack;
+import org.apache.xml.utils.NSInfo;
+import org.apache.xml.utils.PrefixResolver;
+import org.apache.xml.utils.QName;
+import org.apache.xml.utils.NodeVector;
import org.apache.xalan.res.XSLMessages;
import org.apache.xpath.res.XPATHErrorResources;
import org.apache.xpath.axes.ContextNodeList;
@@ -90,7 +90,7 @@
// TRaX imports
import javax.xml.transform.URIResolver;
import javax.xml.transform.TransformerException;
-import org.apache.xalan.utils.SAXSourceLocator;
+import org.apache.xml.utils.SAXSourceLocator;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.dom.DOMSource;
1.4 +1 -1 xml-xalan/java/src/org/apache/xpath/XPathFactory.java
Index: XPathFactory.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/XPathFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XPathFactory.java 2000/11/03 23:28:14 1.3
+++ XPathFactory.java 2000/11/23 04:58:56 1.4
@@ -58,7 +58,7 @@
// import org.xml.sax.Locator;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.PrefixResolver;
import javax.xml.transform.SourceLocator;
1.11 +1 -1 xml-xalan/java/src/org/apache/xpath/axes/AxesWalker.java
Index: AxesWalker.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/axes/AxesWalker.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- AxesWalker.java 2000/11/15 19:41:05 1.10
+++ AxesWalker.java 2000/11/23 04:59:00 1.11
@@ -70,7 +70,7 @@
import org.apache.xpath.Expression;
import org.apache.xpath.patterns.NodeTest;
import org.apache.xpath.patterns.NodeTestFilter;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.PrefixResolver;
// DOM2 imports
import org.w3c.dom.Node;
1.2 +1 -1
xml-xalan/java/src/org/apache/xpath/axes/ChildTestIterator.java
Index: ChildTestIterator.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/axes/ChildTestIterator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ChildTestIterator.java 2000/11/16 20:04:50 1.1
+++ ChildTestIterator.java 2000/11/23 04:59:00 1.2
@@ -152,7 +152,7 @@
}
catch(TransformerException te)
{
- throw new org.apache.xalan.utils.WrappedRuntimeException(te);
+ throw new org.apache.xml.utils.WrappedRuntimeException(te);
}
}
else
1.8 +1 -1
xml-xalan/java/src/org/apache/xpath/axes/FilterExprWalker.java
Index: FilterExprWalker.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/axes/FilterExprWalker.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FilterExprWalker.java 2000/11/13 16:27:30 1.7
+++ FilterExprWalker.java 2000/11/23 04:59:00 1.8
@@ -62,7 +62,7 @@
import org.apache.xpath.XPathContext;
import org.apache.xpath.objects.XObject;
import org.apache.xpath.DOMHelper;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.PrefixResolver;
import org.apache.xpath.compiler.Compiler;
import org.apache.xpath.compiler.OpCodes;
import org.apache.xpath.patterns.NodeTestFilter;
1.15 +3 -3
xml-xalan/java/src/org/apache/xpath/axes/LocPathIterator.java
Index: LocPathIterator.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/axes/LocPathIterator.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- LocPathIterator.java 2000/11/16 20:04:50 1.14
+++ LocPathIterator.java 2000/11/23 04:59:01 1.15
@@ -81,9 +81,9 @@
import org.apache.xpath.Expression;
import org.apache.xpath.XPathContext;
import org.apache.xpath.objects.XObject;
-import org.apache.xalan.utils.IntStack;
-import org.apache.xalan.utils.PrefixResolver;
-import org.apache.xalan.utils.ObjectPool;
+import org.apache.xml.utils.IntStack;
+import org.apache.xml.utils.PrefixResolver;
+import org.apache.xml.utils.ObjectPool;
import org.apache.xpath.objects.XNodeSet;
import org.apache.xpath.axes.AxesWalker;
import org.apache.xpath.VariableStack;
1.10 +1 -1
xml-xalan/java/src/org/apache/xpath/axes/UnionPathIterator.java
Index: UnionPathIterator.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/axes/UnionPathIterator.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- UnionPathIterator.java 2000/11/16 20:04:50 1.9
+++ UnionPathIterator.java 2000/11/23 04:59:01 1.10
@@ -73,7 +73,7 @@
import org.apache.xpath.objects.XNodeSet;
import org.apache.xpath.objects.XObject;
import org.apache.xpath.compiler.Compiler;
-import org.apache.xalan.utils.ObjectPool;
+import org.apache.xml.utils.ObjectPool;
/**
* <meta name="usage" content="advanced"/>
1.15 +3 -3
xml-xalan/java/src/org/apache/xpath/compiler/Compiler.java
Index: Compiler.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/compiler/Compiler.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Compiler.java 2000/11/13 16:27:31 1.14
+++ Compiler.java 2000/11/23 04:59:04 1.15
@@ -84,11 +84,11 @@
import org.apache.xpath.*;
import org.apache.xpath.res.XPATHErrorResources;
import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.utils.QName;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.QName;
+import org.apache.xml.utils.PrefixResolver;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.SourceLocator;
-import org.apache.xalan.utils.SAXSourceLocator;
+import org.apache.xml.utils.SAXSourceLocator;
import javax.xml.transform.ErrorListener;
import javax.xml.transform.TransformerException;
1.4 +1 -1
xml-xalan/java/src/org/apache/xpath/compiler/Keywords.java
Index: Keywords.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/compiler/Keywords.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Keywords.java 2000/11/23 00:01:03 1.3
+++ Keywords.java 2000/11/23 04:59:04 1.4
@@ -58,7 +58,7 @@
import java.util.Hashtable;
-import org.apache.xalan.utils.StringKey;
+import org.apache.xml.utils.StringKey;
/**
* <meta name="usage" content="internal"/>
1.4 +1 -1 xml-xalan/java/src/org/apache/xpath/compiler/Lexer.java
Index: Lexer.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/compiler/Lexer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Lexer.java 2000/11/13 16:27:31 1.3
+++ Lexer.java 2000/11/23 04:59:05 1.4
@@ -56,7 +56,7 @@
*/
package org.apache.xpath.compiler;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.PrefixResolver;
import java.util.Vector;
1.6 +1 -1 xml-xalan/java/src/org/apache/xpath/compiler/OpMap.java
Index: OpMap.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/compiler/OpMap.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- OpMap.java 2000/10/30 18:59:23 1.5
+++ OpMap.java 2000/11/23 04:59:06 1.6
@@ -58,7 +58,7 @@
import java.util.Vector;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xpath.patterns.NodeTest;
/**
1.8 +2 -2
xml-xalan/java/src/org/apache/xpath/compiler/XPathParser.java
Index: XPathParser.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/compiler/XPathParser.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- XPathParser.java 2000/11/13 16:27:31 1.7
+++ XPathParser.java 2000/11/23 04:59:06 1.8
@@ -59,13 +59,13 @@
import java.util.Vector;
import java.util.Hashtable;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.PrefixResolver;
import org.apache.xpath.res.XPATHErrorResources;
import org.apache.xpath.compiler.Compiler;
import org.apache.xpath.objects.XString;
import org.apache.xpath.objects.XNumber;
import org.apache.xalan.res.XSLMessages;
-import org.apache.xalan.utils.StringKey;
+import org.apache.xml.utils.StringKey;
import javax.xml.transform.TransformerException;
import org.xml.sax.Locator;
1.4 +1 -1
xml-xalan/java/src/org/apache/xpath/functions/FuncExtElementAvailable.java
Index: FuncExtElementAvailable.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/functions/FuncExtElementAvailable.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FuncExtElementAvailable.java 2000/11/13 16:27:33 1.3
+++ FuncExtElementAvailable.java 2000/11/23 04:59:11 1.4
@@ -56,7 +56,7 @@
*/
package org.apache.xpath.functions;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.PrefixResolver;
import org.apache.xalan.extensions.ExtensionsTable;
import org.w3c.dom.Node;
1.4 +1 -1
xml-xalan/java/src/org/apache/xpath/functions/FuncExtFunctionAvailable.java
Index: FuncExtFunctionAvailable.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/functions/FuncExtFunctionAvailable.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FuncExtFunctionAvailable.java 2000/11/13 16:27:33 1.3
+++ FuncExtFunctionAvailable.java 2000/11/23 04:59:11 1.4
@@ -56,7 +56,7 @@
*/
package org.apache.xpath.functions;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.PrefixResolver;
import org.apache.xalan.extensions.ExtensionsTable;
import org.w3c.dom.Node;
1.5 +1 -1 xml-xalan/java/src/org/apache/xpath/functions/FuncId.java
Index: FuncId.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/functions/FuncId.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- FuncId.java 2000/11/16 20:04:51 1.4
+++ FuncId.java 2000/11/23 04:59:11 1.5
@@ -73,7 +73,7 @@
import org.apache.xpath.NodeSet;
import org.apache.xpath.objects.XObject;
import org.apache.xpath.objects.XNodeSet;
-import org.apache.xalan.utils.StringVector;
+import org.apache.xml.utils.StringVector;
/**
* <meta name="usage" content="advanced"/>
1.5 +1 -1
xml-xalan/java/src/org/apache/xpath/functions/FuncNormalizeSpace.java
Index: FuncNormalizeSpace.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/functions/FuncNormalizeSpace.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- FuncNormalizeSpace.java 2000/11/13 16:27:33 1.4
+++ FuncNormalizeSpace.java 2000/11/23 04:59:12 1.5
@@ -67,7 +67,7 @@
import org.apache.xpath.objects.XObject;
import org.apache.xpath.objects.XString;
import org.apache.xpath.objects.XNodeSet;
-import org.apache.xalan.utils.XMLCharacterRecognizer;
+import org.apache.xml.utils.XMLCharacterRecognizer;
/**
* <meta name="usage" content="internal"/>
1.4 +1 -1
xml-xalan/java/src/org/apache/xpath/functions/FuncQname.java
Index: FuncQname.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/functions/FuncQname.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FuncQname.java 2000/11/13 16:27:35 1.3
+++ FuncQname.java 2000/11/23 04:59:12 1.4
@@ -68,7 +68,7 @@
import org.apache.xpath.XPath;
import org.apache.xpath.objects.XObject;
import org.apache.xpath.objects.XString;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
/**
* <meta name="usage" content="advanced"/>
1.6 +2 -2
xml-xalan/java/src/org/apache/xpath/functions/FuncSystemProperty.java
Index: FuncSystemProperty.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/functions/FuncSystemProperty.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FuncSystemProperty.java 2000/11/16 20:51:29 1.5
+++ FuncSystemProperty.java 2000/11/23 04:59:12 1.6
@@ -63,7 +63,7 @@
import java.lang.ClassLoader;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.PrefixResolver;
import org.apache.xpath.res.XPATHErrorResources;
import org.w3c.dom.Node;
@@ -225,7 +225,7 @@
catch (Exception ex)
{
// ex.printStackTrace();
- throw new org.apache.xalan.utils.WrappedRuntimeException(ex);
+ throw new org.apache.xml.utils.WrappedRuntimeException(ex);
}
}
}
1.9 +1 -1 xml-xalan/java/src/org/apache/xpath/objects/XNodeSet.java
Index: XNodeSet.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/objects/XNodeSet.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XNodeSet.java 2000/11/13 16:27:45 1.8
+++ XNodeSet.java 2000/11/23 04:59:17 1.9
@@ -65,7 +65,7 @@
import org.apache.xpath.XPathContext;
import org.apache.xpath.NodeSet;
import org.apache.xpath.axes.ContextNodeList;
-import org.apache.xalan.utils.StringVector;
+import org.apache.xml.utils.StringVector;
/**
* <meta name="usage" content="general"/>
1.6 +1 -1
xml-xalan/java/src/org/apache/xpath/operations/Variable.java
Index: Variable.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/operations/Variable.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Variable.java 2000/11/14 18:56:26 1.5
+++ Variable.java 2000/11/23 04:59:21 1.6
@@ -56,7 +56,7 @@
*/
package org.apache.xpath.operations;
-import org.apache.xalan.utils.QName;
+import org.apache.xml.utils.QName;
import org.apache.xpath.Expression;
import org.apache.xpath.XPath;
import org.apache.xpath.XPathContext;
1.7 +1 -1
xml-xalan/java/src/org/apache/xpath/patterns/AncestorStepPattern.java
Index: AncestorStepPattern.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/patterns/AncestorStepPattern.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- AncestorStepPattern.java 2000/11/13 16:27:54 1.6
+++ AncestorStepPattern.java 2000/11/23 04:59:23 1.7
@@ -59,7 +59,7 @@
import org.apache.xpath.Expression;
import org.apache.xpath.objects.XObject;
import org.apache.xpath.XPathContext;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.PrefixResolver;
import org.apache.xpath.axes.LocPathIterator;
import org.w3c.dom.Node;
1.15 +1 -1
xml-xalan/java/src/org/apache/xpath/patterns/StepPattern.java
Index: StepPattern.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/patterns/StepPattern.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- StepPattern.java 2000/11/13 16:27:54 1.14
+++ StepPattern.java 2000/11/23 04:59:24 1.15
@@ -59,7 +59,7 @@
import org.apache.xpath.Expression;
import org.apache.xpath.objects.XObject;
import org.apache.xpath.XPathContext;
-import org.apache.xalan.utils.PrefixResolver;
+import org.apache.xml.utils.PrefixResolver;
import org.apache.xpath.axes.SubContextList;
import org.apache.xpath.compiler.PsuedoNames;
1.5 +3 -2
xml-xalan/java/src/org/apache/xpath/res/XPATHErrorResources.java
Index: XPATHErrorResources.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/res/XPATHErrorResources.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XPATHErrorResources.java 2000/11/03 23:28:17 1.4
+++ XPATHErrorResources.java 2000/11/23 04:59:26 1.5
@@ -56,8 +56,9 @@
*/
package org.apache.xpath.res;
-import org.apache.xalan.res.XSLResourceBundle;
+import org.apache.xml.utils.res.XResourceBundleBase;
+
import java.util.*;
import java.text.DecimalFormat;
@@ -73,7 +74,7 @@
* fill in the actual message string. Follow the instructions
* below.
*/
-public class XPATHErrorResources extends XSLResourceBundle
+public class XPATHErrorResources extends XResourceBundleBase
{
/** NEEDSDOC Field ERROR_SUFFIX */