Commit ed8772d4 authored by Arthur Bogaart's avatar Arthur Bogaart Committed by Bert Leunis

CMS-11897 Move HtmlProcessor interfaces to services-api

(cherry picked from commit fcc57189)
parent 9000849b
/*
* Copyright 2017 Hippo B.V. (http://www.onehippo.com)
*
* Licensed 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.
*/
package org.onehippo.cms7.services.htmlprocessor;
import java.io.IOException;
import java.io.Serializable;
import java.util.List;
public interface HtmlProcessor extends Serializable {
String read(final String html, final List<TagVisitor> visitors) throws IOException;
String write(final String html, final List<TagVisitor> visitors) throws IOException;
}
/*
* Copyright 2017 Hippo B.V. (http://www.onehippo.com)
*
* Licensed 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.
*/
package org.onehippo.cms7.services.htmlprocessor;
import org.onehippo.cms7.services.SingletonService;
@SingletonService
public interface HtmlProcessorService {
/**
* Returns instance of HtmlProcessor or null if the configuration cannot be found
* @param id The HTML processor id
* @return Instance of HTML processor
*/
HtmlProcessor getHtmlProcessor(final String id);
}
/*
* Copyright 2017 Hippo B.V. (http://www.onehippo.com)
*
* Licensed 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.
*/
package org.onehippo.cms7.services.htmlprocessor;
public interface Tag {
String getName();
String getAttribute(final String name);
void addAttribute(final String name, final String value);
boolean hasAttribute(final String name);
void removeAttribute(final String name);
}
/*
* Copyright 2017 Hippo B.V. (http://www.onehippo.com)
*
* Licensed 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.
*/
package org.onehippo.cms7.services.htmlprocessor;
import java.io.Serializable;
import javax.jcr.RepositoryException;
public interface TagVisitor extends Serializable {
void onRead(Tag parent, Tag tag) throws RepositoryException;
void onWrite(Tag parent, Tag tag) throws RepositoryException;
void release();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment