Java Code Examples for org.w3c.dom.DOMException#SYNTAX_ERR

The following examples show how to use org.w3c.dom.DOMException#SYNTAX_ERR . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractValueFactory.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Creates a DOM exception, given an invalid identifier.
 */
protected DOMException createInvalidIdentifierDOMException( String ident )
{
	Object[] p = new Object[]{getPropertyName( ), ident};
	String s = Messages.formatMessage( "invalid.identifier", p );
	return new DOMException( DOMException.SYNTAX_ERR, s );
}
 
Example 2
Source File: FloatValue.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Returns the CSS text associated with the given type/value pair.
 */
public static String getCssText( short unit, float value )
{
	if ( unit < 0 || unit >= UNITS.length )
	{
		throw new DOMException( DOMException.SYNTAX_ERR, "" );
	}
	String s = FORMATTER.format( value );
	return s + UNITS[unit - CSSPrimitiveValue.CSS_NUMBER];
}
 
Example 3
Source File: SVGAttr.java    From latexdraw with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void setValue(final String val) {
	if(val == null) {
		throw new DOMException(DOMException.SYNTAX_ERR, "A value cannot be null");
	}
	value = val;
}