org.apache.abdera.model.ElementWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aem-sdk-api Show documentation
Show all versions of aem-sdk-api Show documentation
The Adobe Experience Manager SDK
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. The ASF licenses this file to You
* under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. For additional information regarding
* copyright in this work, please see the NOTICE file in the top level
* directory of this distribution.
*/
package org.apache.abdera.model;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.activation.DataHandler;
import javax.xml.namespace.QName;
import org.apache.abdera.factory.Factory;
import org.apache.abdera.i18n.iri.IRI;
import org.apache.abdera.i18n.rfc4646.Lang;
import org.apache.abdera.writer.WriterOptions;
/**
* Base implementation used for static extensions.
*
* @deprecated This API is deprecated as Apache Abdera is a retired project since 2017.
*/
@SuppressWarnings("unchecked")
@Deprecated(since = "2021-07-29")
public abstract class ElementWrapper implements Element {
private Element internal;
protected ElementWrapper(Element internal) {
this.internal = internal;
}
protected ElementWrapper(Factory factory, QName qname) {
Element el = factory.newElement(qname);
internal = (el instanceof ElementWrapper) ? ((ElementWrapper) el).getInternal() : el;
}
public T addComment(String value) {
internal.addComment(value);
return (T) this;
}
public Object clone() {
try {
ElementWrapper wrapper = (ElementWrapper) super.clone();
wrapper.internal = (Element) internal.clone();
return wrapper;
} catch (CloneNotSupportedException e) {
// won't happen
return null;
}
}
public T declareNS(String uri, String prefix) {
internal.declareNS(uri, prefix);
return (T) this;
}
public void discard() {
internal.discard();
}
public List getAttributes() {
return internal.getAttributes();
}
public String getAttributeValue(QName qname) {
return internal.getAttributeValue(qname);
}
public String getAttributeValue(String name) {
return internal.getAttributeValue(name);
}
public IRI getBaseUri() {
return internal.getBaseUri();
}
public Document getDocument() {
return internal.getDocument();
}
public List getExtensionAttributes() {
return internal.getExtensionAttributes();
}
public Factory getFactory() {
return internal.getFactory();
}
public T getFirstChild() {
return (T) internal.getFirstChild();
}
public T getFirstChild(QName qname) {
return (T) internal.getFirstChild(qname);
}
public String getLanguage() {
return internal.getLanguage();
}
public Lang getLanguageTag() {
return internal.getLanguageTag();
}
public Locale getLocale() {
return internal.getLocale();
}
public T getNextSibling() {
return (T) internal.getNextSibling();
}
public T getNextSibling(QName qname) {
return (T) internal.getNextSibling(qname);
}
public T getParentElement() {
return (T) internal.getParentElement();
}
public T getPreviousSibling() {
return (T) internal.getPreviousSibling();
}
public T getPreviousSibling(QName qname) {
return (T) internal.getPreviousSibling(qname);
}
public QName getQName() {
return internal.getQName();
}
public IRI getResolvedBaseUri() {
return internal.getResolvedBaseUri();
}
public String getText() {
return internal.getText();
}
public T removeAttribute(QName qname) {
internal.removeAttribute(qname);
return (T) this;
}
public T removeAttribute(String name) {
internal.removeAttribute(name);
return (T) this;
}
public T setAttributeValue(QName qname, String value) {
internal.setAttributeValue(qname, value);
return (T) this;
}
public T setAttributeValue(String name, String value) {
internal.setAttributeValue(name, value);
return (T) this;
}
public T setBaseUri(IRI base) {
internal.setBaseUri(base);
return (T) this;
}
public T setBaseUri(String base) {
internal.setBaseUri(base);
return (T) this;
}
public T setLanguage(String language) {
internal.setLanguage(language);
return (T) this;
}
public T setParentElement(Element parent) {
internal.setParentElement(parent);
return (T) this;
}
public void setText(String text) {
internal.setText(text);
}
public T setText(DataHandler handler) {
internal.setText(handler);
return (T) this;
}
public void writeTo(OutputStream out) throws IOException {
internal.writeTo(out);
}
public void writeTo(Writer writer) throws IOException {
internal.writeTo(writer);
}
public boolean equals(Object other) {
if (other instanceof ElementWrapper)
other = ((ElementWrapper) other).getInternal();
return internal.equals(other);
}
public String toString() {
return internal.toString();
}
public int hashCode() {
return internal.hashCode();
}
public Element getInternal() {
return internal;
}
public List getElements() {
return internal.getElements();
}
public Map getNamespaces() {
return internal.getNamespaces();
}
public boolean getMustPreserveWhitespace() {
return internal.getMustPreserveWhitespace();
}
public T setMustPreserveWhitespace(boolean preserve) {
internal.setMustPreserveWhitespace(preserve);
return (T) this;
}
public void writeTo(OutputStream out, WriterOptions options) throws IOException {
internal.writeTo(out, options);
}
public void writeTo(org.apache.abdera.writer.Writer writer, OutputStream out, WriterOptions options) throws IOException {
internal.writeTo(writer, out, options);
}
public void writeTo(org.apache.abdera.writer.Writer writer, OutputStream out) throws IOException {
internal.writeTo(writer, out);
}
public void writeTo(org.apache.abdera.writer.Writer writer, Writer out, WriterOptions options) throws IOException {
internal.writeTo(writer, out, options);
}
public void writeTo(org.apache.abdera.writer.Writer writer, Writer out) throws IOException {
internal.writeTo(writer, out);
}
public void writeTo(String writer, OutputStream out, WriterOptions options) throws IOException {
internal.writeTo(writer, out, options);
}
public void writeTo(String writer, OutputStream out) throws IOException {
internal.writeTo(writer, out);
}
public void writeTo(String writer, Writer out, WriterOptions options) throws IOException {
internal.writeTo(writer, out, options);
}
public void writeTo(String writer, Writer out) throws IOException {
internal.writeTo(writer, out);
}
public void writeTo(Writer out, WriterOptions options) throws IOException {
internal.writeTo(out, options);
}
public WriterOptions getDefaultWriterOptions() {
return internal.getDefaultWriterOptions();
}
public T complete() {
internal.complete();
return (T) this;
}
public Iterator iterator() {
return internal.iterator();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy