|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RawBlock | Line # 34 | 5 | 0% | 4 | 0 | 100% |
1.0
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (24) | |||
| Result | |||
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
|
1.0
|
org.xwiki.rendering.test.integration.RenderingTest.execute
org.xwiki.rendering.test.integration.RenderingTest.execute
|
1 PASS | |
| 1 | /* | |
| 2 | * See the NOTICE file distributed with this work for additional | |
| 3 | * information regarding copyright ownership. | |
| 4 | * | |
| 5 | * This is free software; you can redistribute it and/or modify it | |
| 6 | * under the terms of the GNU Lesser General Public License as | |
| 7 | * published by the Free Software Foundation; either version 2.1 of | |
| 8 | * the License, or (at your option) any later version. | |
| 9 | * | |
| 10 | * This software is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | * Lesser General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU Lesser General Public | |
| 16 | * License along with this software; if not, write to the Free | |
| 17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
| 18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
| 19 | */ | |
| 20 | package org.xwiki.rendering.block; | |
| 21 | ||
| 22 | import org.xwiki.rendering.listener.Listener; | |
| 23 | import org.xwiki.rendering.syntax.Syntax; | |
| 24 | ||
| 25 | /** | |
| 26 | * Represents some raw content that shouldn't be parsed or modified and that should be injected as is | |
| 27 | * in any output. The content depends on a syntax and listeners decide if they can handle that syntax | |
| 28 | * or not. For example if it's in "xhtml/1.0" syntax then the XHTML Renderer can insert it directly | |
| 29 | * in the XHTML output. | |
| 30 | * | |
| 31 | * @version $Id$ | |
| 32 | * @since 1.8.3 | |
| 33 | */ | |
| 34 | public class RawBlock extends AbstractBlock | |
| 35 | { | |
| 36 | /** | |
| 37 | * @see #getRawContent() | |
| 38 | */ | |
| 39 | private String rawContent; | |
| 40 | ||
| 41 | /** | |
| 42 | * @see #getSyntax() | |
| 43 | */ | |
| 44 | private Syntax syntax; | |
| 45 | ||
| 46 | /** | |
| 47 | * @param rawContent the content to inject as is into the listener (it won't be modified) | |
| 48 | * @param syntax the syntax in which the content is written | |
| 49 | */ | |
| 50 | 29 |
public RawBlock(String rawContent, Syntax syntax) |
| 51 | { | |
| 52 | 29 | this.rawContent = rawContent; |
| 53 | 29 | this.syntax = syntax; |
| 54 | } | |
| 55 | ||
| 56 | 29 |
@Override |
| 57 | public void traverse(Listener listener) | |
| 58 | { | |
| 59 | 29 | listener.onRawText(getRawContent(), getSyntax()); |
| 60 | } | |
| 61 | ||
| 62 | /** | |
| 63 | * @return the content to inject as is into the listener (it won't be modified) | |
| 64 | */ | |
| 65 | 29 |
public String getRawContent() |
| 66 | { | |
| 67 | 29 | return this.rawContent; |
| 68 | } | |
| 69 | ||
| 70 | /** | |
| 71 | * @return the syntax in which the content is written | |
| 72 | */ | |
| 73 | 29 |
public Syntax getSyntax() |
| 74 | { | |
| 75 | 29 | return this.syntax; |
| 76 | } | |
| 77 | } | |
|
||||||||||||