org.xwiki.rendering.parser.xwiki10
Class FilterContext

java.lang.Object
  extended by org.xwiki.rendering.parser.xwiki10.FilterContext

public class FilterContext
extends java.lang.Object

The XWiki 1.0 to 2.0 conversion context.

A filter can register a part of the content to protect it. That way this content is not re-parsed by another filter. for example VelocityCommentsFilter register all Velocity comments.

Since:
1.8M1
Version:
$Id: FilterContext.java 24295 2009-10-07 12:49:11Z tmortagne $

Field Summary
static java.lang.String XWIKI1020TOKEN_C
           
static java.lang.String XWIKI1020TOKEN_CP
           
static java.lang.String XWIKI1020TOKEN_O
           
static java.lang.String XWIKI1020TOKEN_OP
           
static java.util.regex.Pattern XWIKI1020TOKEN_PATTERN
          Match registered content identifier.
static java.lang.String XWIKI1020TOKEN_SF_SPATTERN
           
static java.util.regex.Pattern XWIKI1020TOKENI_PATTERN
          Match registered inline content identifier.
static java.lang.String XWIKI1020TOKENI_SF_SPATTERN
           
static java.util.regex.Pattern XWIKI1020TOKENS_PATTERN
          Match registered content identifier.
static java.lang.String XWIKI1020TOKENS_SF_SPATTERN
           
 
Constructor Summary
FilterContext()
           
 
Method Summary
 java.lang.String addProtectedContent(java.lang.String content, boolean inline)
          Register a content and return the corresponding identifier to be able the reinsert it after the conversion process.
 java.lang.String addProtectedContent(java.lang.String content, java.lang.String suffix, boolean inline)
           
 java.lang.String getProtectedContent(int index)
           
 java.lang.String unProtect(java.lang.String content)
          Re-insert all protected/registered strings in to the global content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XWIKI1020TOKEN_O

public static final java.lang.String XWIKI1020TOKEN_O
See Also:
Constant Field Values

XWIKI1020TOKEN_OP

public static final java.lang.String XWIKI1020TOKEN_OP

XWIKI1020TOKEN_C

public static final java.lang.String XWIKI1020TOKEN_C
See Also:
Constant Field Values

XWIKI1020TOKEN_CP

public static final java.lang.String XWIKI1020TOKEN_CP

XWIKI1020TOKEN_SF_SPATTERN

public static final java.lang.String XWIKI1020TOKEN_SF_SPATTERN
See Also:
Constant Field Values

XWIKI1020TOKENS_SF_SPATTERN

public static final java.lang.String XWIKI1020TOKENS_SF_SPATTERN
See Also:
Constant Field Values

XWIKI1020TOKENI_SF_SPATTERN

public static final java.lang.String XWIKI1020TOKENI_SF_SPATTERN
See Also:
Constant Field Values

XWIKI1020TOKENI_PATTERN

public static final java.util.regex.Pattern XWIKI1020TOKENI_PATTERN
Match registered inline content identifier.


XWIKI1020TOKENS_PATTERN

public static final java.util.regex.Pattern XWIKI1020TOKENS_PATTERN
Match registered content identifier.


XWIKI1020TOKEN_PATTERN

public static final java.util.regex.Pattern XWIKI1020TOKEN_PATTERN
Match registered content identifier.

Constructor Detail

FilterContext

public FilterContext()
Method Detail

addProtectedContent

public java.lang.String addProtectedContent(java.lang.String content,
                                            boolean inline)
Register a content and return the corresponding identifier to be able the reinsert it after the conversion process.

Parameters:
content - the content to protect/register.
inline - indicate if i's a inline or not inline string.
Returns:
the content identifier to insert in place of provided content.

addProtectedContent

public java.lang.String addProtectedContent(java.lang.String content,
                                            java.lang.String suffix,
                                            boolean inline)

getProtectedContent

public java.lang.String getProtectedContent(int index)
Parameters:
index - the identifier of the registered content.
Returns:
the registered content.

unProtect

public java.lang.String unProtect(java.lang.String content)
Re-insert all protected/registered strings in to the global content.

Parameters:
content - the global content.
Returns:
the complete content.


Copyright © 2004-2011 XWiki. All Rights Reserved.