下面列出了怎么用org.w3c.dom.DOMImplementationSource的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Return the first implementation that has the desired
* features, or <code>null</code> if none is found.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return An implementation that has the desired features,
* or <code>null</code> if none found.
*/
public DOMImplementation getDOMImplementation(final String features) {
int size = sources.size();
String name = null;
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementation impl = source.getDOMImplementation(features);
if (impl != null) {
return impl;
}
}
return null;
}
/**
* Return a list of implementations that support the
* desired features.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return A list of DOMImplementations that support the desired features.
*/
public DOMImplementationList getDOMImplementationList(final String features) {
final Vector implementations = new Vector();
int size = sources.size();
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementationList impls =
source.getDOMImplementationList(features);
for (int j = 0; j < impls.getLength(); j++) {
DOMImplementation impl = impls.item(j);
implementations.addElement(impl);
}
}
return new DOMImplementationList() {
public DOMImplementation item(final int index) {
if (index >= 0 && index < implementations.size()) {
try {
return (DOMImplementation)
implementations.elementAt(index);
} catch (ArrayIndexOutOfBoundsException e) {
return null;
}
}
return null;
}
public int getLength() {
return implementations.size();
}
};
}
/**
* Register an implementation.
*
* @param s The source to be registered, may not be <code>null</code>
*/
public void addSource(final DOMImplementationSource s) {
if (s == null) {
throw new NullPointerException();
}
if (!sources.contains(s)) {
sources.addElement(s);
}
}
/**
* Return the first implementation that has the desired
* features, or <code>null</code> if none is found.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return An implementation that has the desired features,
* or <code>null</code> if none found.
*/
public DOMImplementation getDOMImplementation(final String features) {
int size = sources.size();
String name = null;
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementation impl = source.getDOMImplementation(features);
if (impl != null) {
return impl;
}
}
return null;
}
/**
* Return a list of implementations that support the
* desired features.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return A list of DOMImplementations that support the desired features.
*/
public DOMImplementationList getDOMImplementationList(final String features) {
final Vector implementations = new Vector();
int size = sources.size();
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementationList impls =
source.getDOMImplementationList(features);
for (int j = 0; j < impls.getLength(); j++) {
DOMImplementation impl = impls.item(j);
implementations.addElement(impl);
}
}
return new DOMImplementationList() {
public DOMImplementation item(final int index) {
if (index >= 0 && index < implementations.size()) {
try {
return (DOMImplementation)
implementations.elementAt(index);
} catch (ArrayIndexOutOfBoundsException e) {
return null;
}
}
return null;
}
public int getLength() {
return implementations.size();
}
};
}
/**
* Register an implementation.
*
* @param s The source to be registered, may not be <code>null</code>
*/
public void addSource(final DOMImplementationSource s) {
if (s == null) {
throw new NullPointerException();
}
if (!sources.contains(s)) {
sources.addElement(s);
}
}
/**
* Return the first implementation that has the desired
* features, or <code>null</code> if none is found.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return An implementation that has the desired features,
* or <code>null</code> if none found.
*/
public DOMImplementation getDOMImplementation(final String features) {
int size = sources.size();
String name = null;
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementation impl = source.getDOMImplementation(features);
if (impl != null) {
return impl;
}
}
return null;
}
/**
* Return a list of implementations that support the
* desired features.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return A list of DOMImplementations that support the desired features.
*/
public DOMImplementationList getDOMImplementationList(final String features) {
final Vector implementations = new Vector();
int size = sources.size();
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementationList impls =
source.getDOMImplementationList(features);
for (int j = 0; j < impls.getLength(); j++) {
DOMImplementation impl = impls.item(j);
implementations.addElement(impl);
}
}
return new DOMImplementationList() {
public DOMImplementation item(final int index) {
if (index >= 0 && index < implementations.size()) {
try {
return (DOMImplementation)
implementations.elementAt(index);
} catch (ArrayIndexOutOfBoundsException e) {
return null;
}
}
return null;
}
public int getLength() {
return implementations.size();
}
};
}
/**
* Register an implementation.
*
* @param s The source to be registered, may not be <code>null</code>
*/
public void addSource(final DOMImplementationSource s) {
if (s == null) {
throw new NullPointerException();
}
if (!sources.contains(s)) {
sources.addElement(s);
}
}
/**
* Return the first implementation that has the desired
* features, or <code>null</code> if none is found.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return An implementation that has the desired features,
* or <code>null</code> if none found.
*/
public DOMImplementation getDOMImplementation(final String features) {
int size = sources.size();
String name = null;
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementation impl = source.getDOMImplementation(features);
if (impl != null) {
return impl;
}
}
return null;
}
/**
* Return a list of implementations that support the
* desired features.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return A list of DOMImplementations that support the desired features.
*/
public DOMImplementationList getDOMImplementationList(final String features) {
final Vector implementations = new Vector();
int size = sources.size();
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementationList impls =
source.getDOMImplementationList(features);
for (int j = 0; j < impls.getLength(); j++) {
DOMImplementation impl = impls.item(j);
implementations.addElement(impl);
}
}
return new DOMImplementationList() {
public DOMImplementation item(final int index) {
if (index >= 0 && index < implementations.size()) {
try {
return (DOMImplementation)
implementations.elementAt(index);
} catch (ArrayIndexOutOfBoundsException e) {
return null;
}
}
return null;
}
public int getLength() {
return implementations.size();
}
};
}
/**
* Register an implementation.
*
* @param s The source to be registered, may not be <code>null</code>
*/
public void addSource(final DOMImplementationSource s) {
if (s == null) {
throw new NullPointerException();
}
if (!sources.contains(s)) {
sources.addElement(s);
}
}
/**
* Return the first implementation that has the desired
* features, or <code>null</code> if none is found.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return An implementation that has the desired features,
* or <code>null</code> if none found.
*/
public DOMImplementation getDOMImplementation(final String features) {
int size = sources.size();
String name = null;
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementation impl = source.getDOMImplementation(features);
if (impl != null) {
return impl;
}
}
return null;
}
/**
* Return a list of implementations that support the
* desired features.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return A list of DOMImplementations that support the desired features.
*/
public DOMImplementationList getDOMImplementationList(final String features) {
final Vector implementations = new Vector();
int size = sources.size();
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementationList impls =
source.getDOMImplementationList(features);
for (int j = 0; j < impls.getLength(); j++) {
DOMImplementation impl = impls.item(j);
implementations.addElement(impl);
}
}
return new DOMImplementationList() {
public DOMImplementation item(final int index) {
if (index >= 0 && index < implementations.size()) {
try {
return (DOMImplementation)
implementations.elementAt(index);
} catch (ArrayIndexOutOfBoundsException e) {
return null;
}
}
return null;
}
public int getLength() {
return implementations.size();
}
};
}
/**
* Register an implementation.
*
* @param s The source to be registered, may not be <code>null</code>
*/
public void addSource(final DOMImplementationSource s) {
if (s == null) {
throw new NullPointerException();
}
if (!sources.contains(s)) {
sources.addElement(s);
}
}
/**
* Return the first implementation that has the desired
* features, or <code>null</code> if none is found.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return An implementation that has the desired features,
* or <code>null</code> if none found.
*/
public DOMImplementation getDOMImplementation(final String features) {
int size = sources.size();
String name = null;
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementation impl = source.getDOMImplementation(features);
if (impl != null) {
return impl;
}
}
return null;
}
/**
* Return a list of implementations that support the
* desired features.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return A list of DOMImplementations that support the desired features.
*/
public DOMImplementationList getDOMImplementationList(final String features) {
final Vector implementations = new Vector();
int size = sources.size();
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementationList impls =
source.getDOMImplementationList(features);
for (int j = 0; j < impls.getLength(); j++) {
DOMImplementation impl = impls.item(j);
implementations.addElement(impl);
}
}
return new DOMImplementationList() {
public DOMImplementation item(final int index) {
if (index >= 0 && index < implementations.size()) {
try {
return (DOMImplementation)
implementations.elementAt(index);
} catch (ArrayIndexOutOfBoundsException e) {
return null;
}
}
return null;
}
public int getLength() {
return implementations.size();
}
};
}
/**
* Register an implementation.
*
* @param s The source to be registered, may not be <code>null</code>
*/
public void addSource(final DOMImplementationSource s) {
if (s == null) {
throw new NullPointerException();
}
if (!sources.contains(s)) {
sources.addElement(s);
}
}
/**
* Return the first implementation that has the desired
* features, or <code>null</code> if none is found.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return An implementation that has the desired features,
* or <code>null</code> if none found.
*/
public DOMImplementation getDOMImplementation(final String features) {
int size = sources.size();
String name = null;
for (int i = 0; i < size; i++) {
DOMImplementationSource source = sources.get(i);
DOMImplementation impl = source.getDOMImplementation(features);
if (impl != null) {
return impl;
}
}
return null;
}
/**
* Return a list of implementations that support the
* desired features.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return A list of DOMImplementations that support the desired features.
*/
public DOMImplementationList getDOMImplementationList(final String features) {
final List<DOMImplementation> implementations = new ArrayList<>();
int size = sources.size();
for (int i = 0; i < size; i++) {
DOMImplementationSource source = sources.get(i);
DOMImplementationList impls =
source.getDOMImplementationList(features);
for (int j = 0; j < impls.getLength(); j++) {
DOMImplementation impl = impls.item(j);
implementations.add(impl);
}
}
return new DOMImplementationList() {
public DOMImplementation item(final int index) {
if (index >= 0 && index < implementations.size()) {
try {
return implementations.get(index);
} catch (IndexOutOfBoundsException e) {
return null;
}
}
return null;
}
public int getLength() {
return implementations.size();
}
};
}
/**
* Register an implementation.
*
* @param s The source to be registered, may not be <code>null</code>
*/
public void addSource(final DOMImplementationSource s) {
if (s == null) {
throw new NullPointerException();
}
if (!sources.contains(s)) {
sources.add(s);
}
}
/**
* Return the first implementation that has the desired
* features, or <code>null</code> if none is found.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return An implementation that has the desired features,
* or <code>null</code> if none found.
*/
public DOMImplementation getDOMImplementation(final String features) {
int size = sources.size();
String name = null;
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementation impl = source.getDOMImplementation(features);
if (impl != null) {
return impl;
}
}
return null;
}
/**
* Return a list of implementations that support the
* desired features.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return A list of DOMImplementations that support the desired features.
*/
public DOMImplementationList getDOMImplementationList(final String features) {
final Vector implementations = new Vector();
int size = sources.size();
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementationList impls =
source.getDOMImplementationList(features);
for (int j = 0; j < impls.getLength(); j++) {
DOMImplementation impl = impls.item(j);
implementations.addElement(impl);
}
}
return new DOMImplementationList() {
public DOMImplementation item(final int index) {
if (index >= 0 && index < implementations.size()) {
try {
return (DOMImplementation)
implementations.elementAt(index);
} catch (ArrayIndexOutOfBoundsException e) {
return null;
}
}
return null;
}
public int getLength() {
return implementations.size();
}
};
}
/**
* Register an implementation.
*
* @param s The source to be registered, may not be <code>null</code>
*/
public void addSource(final DOMImplementationSource s) {
if (s == null) {
throw new NullPointerException();
}
if (!sources.contains(s)) {
sources.addElement(s);
}
}
/**
* Return the first implementation that has the desired
* features, or <code>null</code> if none is found.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return An implementation that has the desired features,
* or <code>null</code> if none found.
*/
public DOMImplementation getDOMImplementation(final String features) {
int size = sources.size();
String name = null;
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementation impl = source.getDOMImplementation(features);
if (impl != null) {
return impl;
}
}
return null;
}
/**
* Return a list of implementations that support the
* desired features.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return A list of DOMImplementations that support the desired features.
*/
public DOMImplementationList getDOMImplementationList(final String features) {
final Vector implementations = new Vector();
int size = sources.size();
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementationList impls =
source.getDOMImplementationList(features);
for (int j = 0; j < impls.getLength(); j++) {
DOMImplementation impl = impls.item(j);
implementations.addElement(impl);
}
}
return new DOMImplementationList() {
public DOMImplementation item(final int index) {
if (index >= 0 && index < implementations.size()) {
try {
return (DOMImplementation)
implementations.elementAt(index);
} catch (ArrayIndexOutOfBoundsException e) {
return null;
}
}
return null;
}
public int getLength() {
return implementations.size();
}
};
}
/**
* Register an implementation.
*
* @param s The source to be registered, may not be <code>null</code>
*/
public void addSource(final DOMImplementationSource s) {
if (s == null) {
throw new NullPointerException();
}
if (!sources.contains(s)) {
sources.addElement(s);
}
}
/**
* Return the first implementation that has the desired
* features, or <code>null</code> if none is found.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return An implementation that has the desired features,
* or <code>null</code> if none found.
*/
public DOMImplementation getDOMImplementation(final String features) {
int size = sources.size();
String name = null;
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementation impl = source.getDOMImplementation(features);
if (impl != null) {
return impl;
}
}
return null;
}
/**
* Return a list of implementations that support the
* desired features.
*
* @param features
* A string that specifies which features are required. This is
* a space separated list in which each feature is specified by
* its name optionally followed by a space and a version number.
* This is something like: "XML 1.0 Traversal +Events 2.0"
* @return A list of DOMImplementations that support the desired features.
*/
public DOMImplementationList getDOMImplementationList(final String features) {
final Vector implementations = new Vector();
int size = sources.size();
for (int i = 0; i < size; i++) {
DOMImplementationSource source =
(DOMImplementationSource) sources.elementAt(i);
DOMImplementationList impls =
source.getDOMImplementationList(features);
for (int j = 0; j < impls.getLength(); j++) {
DOMImplementation impl = impls.item(j);
implementations.addElement(impl);
}
}
return new DOMImplementationList() {
public DOMImplementation item(final int index) {
if (index >= 0 && index < implementations.size()) {
try {
return (DOMImplementation)
implementations.elementAt(index);
} catch (ArrayIndexOutOfBoundsException e) {
return null;
}
}
return null;
}
public int getLength() {
return implementations.size();
}
};
}
/**
* Register an implementation.
*
* @param s The source to be registered, may not be <code>null</code>
*/
public void addSource(final DOMImplementationSource s) {
if (s == null) {
throw new NullPointerException();
}
if (!sources.contains(s)) {
sources.addElement(s);
}
}