📄 config.java
字号:
}
/**
* Indicates whether {@linkplain FormField#getName() form field names} are treated as case insensitive.
* <p>
* Microsoft Internet Explorer treats field names as case insensitive,
* while Mozilla treats them as case sensitive.
* <p>
* The value of this property in the {@linkplain Config#CurrentCompatibilityMode current compatibility mode}
* affects all instances of the {@link FormFields} class.
* It should be set to the desired configuration before any instances of <code>FormFields</code> are created.
*
* @return <code>true</code> if {@linkplain FormField#getName() form field names} are treated as case insensitive, otherwise <code>false</code>.
* @see #setFormFieldNameCaseInsensitive(boolean)
*/
public boolean isFormFieldNameCaseInsensitive() {
return formFieldNameCaseInsensitive;
}
/**
* Sets whether {@linkplain FormField#getName() form field names} are treated as case insensitive.
* <p>
* See {@link #isFormFieldNameCaseInsensitive()} for the documentation of this property.
*
* @param value the new value of the property
*/
public void setFormFieldNameCaseInsensitive(final boolean value) {
formFieldNameCaseInsensitive=value;
}
/**
* Returns the maximum unicode code point of an <a href="CharacterReference.html#Unterminated">unterminated</a>
* {@linkplain CharacterEntityReference character entity reference} which is to be recognised in the specified context.
* <p>
* For example, if <code>getUnterminatedCharacterEntityReferenceMaxCodePoint(true)</code> has the value <code>0xFF</code> (U+00FF)
* in the {@linkplain Config#CurrentCompatibilityMode current compatibility mode}, then:
* <ul>
* <li>{@link CharacterReference#decode(CharSequence,boolean) CharacterReference.decode("&gt",true)}
* returns "<code>></code>".<br />
* The string is recognised as the character entity reference {@link CharacterEntityReference#_gt &gt;}
* despite the fact that it is <a href="CharacterReference.html#Unterminated">unterminated</a>,
* because its unicode code point U+003E is below the maximum of U+00FF set by this property.
* <li>{@link CharacterReference#decode(CharSequence,boolean) CharacterReference.decode("&euro",true)}
* returns "<code>&euro</code>".<br />
* The string is not recognised as the character entity reference {@link CharacterEntityReference#_euro &euro;}
* because it is <a href="CharacterReference.html#Unterminated">unterminated</a>
* and its unicode code point U+20AC is above the maximum of U+00FF set by this property.
* </ul>
* <p>
* See the documentation of the {@link Attribute#getValue()} method for further discussion.
*
* @param insideAttributeValue the context within an HTML document - <code>true</code> if inside an attribute value or <code>false</code> if outside an attribute value.
* @return the maximum unicode code point of an <a href="CharacterReference.html#Unterminated">unterminated</a> {@linkplain CharacterEntityReference character entity reference} which is to be recognised in the specified context.
* @see #setUnterminatedCharacterEntityReferenceMaxCodePoint(boolean insideAttributeValue, int maxCodePoint)
*/
public int getUnterminatedCharacterEntityReferenceMaxCodePoint(final boolean insideAttributeValue) {
return getUnterminatedCharacterReferenceSettings(insideAttributeValue).characterEntityReferenceMaxCodePoint;
}
/**
* Sets the maximum unicode code point of an <a href="CharacterReference.html#Unterminated">unterminated</a>
* {@linkplain CharacterEntityReference character entity reference} which is to be recognised in the specified context.
* <p>
* See {@link #getUnterminatedCharacterEntityReferenceMaxCodePoint(boolean insideAttributeValue)} for the documentation of this property.
*
* @param insideAttributeValue the context within an HTML document - <code>true</code> if inside an attribute value or <code>false</code> if outside an attribute value.
* @param maxCodePoint the maximum unicode code point.
*/
public void setUnterminatedCharacterEntityReferenceMaxCodePoint(final boolean insideAttributeValue, final int maxCodePoint) {
getUnterminatedCharacterReferenceSettings(insideAttributeValue).characterEntityReferenceMaxCodePoint=maxCodePoint;
}
/**
* Returns the maximum unicode code point of an <a href="CharacterReference.html#Unterminated">unterminated</a>
* <a href="NumericCharacterReference.html#DecimalCharacterReference">decimal character reference</a> which is to be recognised in the specified context.
* <p>
* For example, if <code>getUnterminatedDecimalCharacterReferenceMaxCodePoint(true)</code> had the hypothetical value <code>0xFF</code> (U+00FF)
* in the {@linkplain Config#CurrentCompatibilityMode current compatibility mode}, then:
* <ul>
* <li>{@link CharacterReference#decode(CharSequence,boolean) CharacterReference.decode("&#62",true)}
* returns "<code>></code>".<br />
* The string is recognised as the numeric character reference <code>&#62;</code>
* despite the fact that it is <a href="CharacterReference.html#Unterminated">unterminated</a>,
* because its unicode code point U+003E is below the maximum of U+00FF set by this property.
* <li>{@link CharacterReference#decode(CharSequence,boolean) CharacterReference.decode("&#8364",true)}
* returns "<code>&#8364</code>".<br />
* The string is not recognised as the numeric character reference <code>&#8364;</code>
* because it is <a href="CharacterReference.html#Unterminated">unterminated</a>
* and its unicode code point U+20AC is above the maximum of U+00FF set by this property.
* </ul>
*
* @param insideAttributeValue the context within an HTML document - <code>true</code> if inside an attribute value or <code>false</code> if outside an attribute value.
* @return the maximum unicode code point of an <a href="CharacterReference.html#Unterminated">unterminated</a> <a href="NumericCharacterReference.html#DecimalCharacterReference">decimal character reference</a> which is to be recognised in the specified context.
* @see #setUnterminatedDecimalCharacterReferenceMaxCodePoint(boolean insideAttributeValue, int maxCodePoint)
*/
public int getUnterminatedDecimalCharacterReferenceMaxCodePoint(final boolean insideAttributeValue) {
return getUnterminatedCharacterReferenceSettings(insideAttributeValue).decimalCharacterReferenceMaxCodePoint;
}
/**
* Sets the maximum unicode code point of an <a href="CharacterReference.html#Unterminated">unterminated</a>
* <a href="NumericCharacterReference.html#DecimalCharacterReference">decimal character reference</a> which is to be recognised in the specified context.
* <p>
* See {@link #getUnterminatedDecimalCharacterReferenceMaxCodePoint(boolean insideAttributeValue)} for the documentation of this property.
*
* @param insideAttributeValue the context within an HTML document - <code>true</code> if inside an attribute value or <code>false</code> if outside an attribute value.
* @param maxCodePoint the maximum unicode code point.
*/
public void setUnterminatedDecimalCharacterReferenceMaxCodePoint(final boolean insideAttributeValue, final int maxCodePoint) {
getUnterminatedCharacterReferenceSettings(insideAttributeValue).decimalCharacterReferenceMaxCodePoint=maxCodePoint;
}
/**
* Returns the maximum unicode code point of an <a href="CharacterReference.html#Unterminated">unterminated</a>
* <a href="NumericCharacterReference.html#HexadecimalCharacterReference">hexadecimal character reference</a> which is to be recognised in the specified context.
* <p>
* For example, if <code>getUnterminatedHexadecimalCharacterReferenceMaxCodePoint(true)</code> had the hypothetical value <code>0xFF</code> (U+00FF)
* in the {@linkplain Config#CurrentCompatibilityMode current compatibility mode}, then:
* <ul>
* <li>{@link CharacterReference#decode(CharSequence,boolean) CharacterReference.decode("&#x3e",true)}
* returns "<code>></code>".<br />
* The string is recognised as the numeric character reference <code>&#x3e;</code>
* despite the fact that it is <a href="CharacterReference.html#Unterminated">unterminated</a>,
* because its unicode code point U+003E is below the maximum of U+00FF set by this property.
* <li>{@link CharacterReference#decode(CharSequence,boolean) CharacterReference.decode("&#x20ac",true)}
* returns "<code>&#x20ac</code>".<br />
* The string is not recognised as the numeric character reference <code>&#20ac;</code>
* because it is <a href="CharacterReference.html#Unterminated">unterminated</a>
* and its unicode code point U+20AC is above the maximum of U+00FF set by this property.
* </ul>
*
* @param insideAttributeValue the context within an HTML document - <code>true</code> if inside an attribute value or <code>false</code> if outside an attribute value.
* @return the maximum unicode code point of an <a href="CharacterReference.html#Unterminated">unterminated</a> <a href="NumericCharacterReference.html#HexadecimalCharacterReference">hexadecimal character reference</a> which is to be recognised in the specified context.
* @see #setUnterminatedHexadecimalCharacterReferenceMaxCodePoint(boolean insideAttributeValue, int maxCodePoint)
*/
public int getUnterminatedHexadecimalCharacterReferenceMaxCodePoint(final boolean insideAttributeValue) {
return getUnterminatedCharacterReferenceSettings(insideAttributeValue).hexadecimalCharacterReferenceMaxCodePoint;
}
/**
* Sets the maximum unicode code point of an <a href="CharacterReference.html#Unterminated">unterminated</a>
* <a href="NumericCharacterReference.html#HexadecimalCharacterReference">headecimal character reference</a> which is to be recognised in the specified context.
* <p>
* See {@link #getUnterminatedHexadecimalCharacterReferenceMaxCodePoint(boolean insideAttributeValue)} for the documentation of this property.
*
* @param insideAttributeValue the context within an HTML document - <code>true</code> if inside an attribute value or <code>false</code> if outside an attribute value.
* @param maxCodePoint the maximum unicode code point.
*/
public void setUnterminatedHexadecimalCharacterReferenceMaxCodePoint(final boolean insideAttributeValue, final int maxCodePoint) {
getUnterminatedCharacterReferenceSettings(insideAttributeValue).hexadecimalCharacterReferenceMaxCodePoint=maxCodePoint;
}
/**
* Returns a string representation of this object useful for debugging purposes.
* @return a string representation of this object useful for debugging purposes.
*/
public String getDebugInfo() {
return "Form field name case insensitive: "+formFieldNameCaseInsensitive
+Config.NewLine+"Maximum codepoints in unterminated character references:"
+Config.NewLine+" Inside attribute values:"
+unterminatedCharacterReferenceSettingsInsideAttributeValue
+Config.NewLine+" Outside attribute values:"
+unterminatedCharacterReferenceSettingsOutsideAttributeValue;
}
/**
* Returns the {@linkplain #getName() name} of this compatibility mode.
* @return the {@linkplain #getName() name} of this compatibility mode.
*/
public String toString() {
return getName();
}
UnterminatedCharacterReferenceSettings getUnterminatedCharacterReferenceSettings(final boolean insideAttributeValue) {
return insideAttributeValue ? unterminatedCharacterReferenceSettingsInsideAttributeValue : unterminatedCharacterReferenceSettingsOutsideAttributeValue;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -