org.w3c.css.sac.ElementSelector Java Examples

The following examples show how to use org.w3c.css.sac.ElementSelector. 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: SelectorFactoryImpl.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Creates a pseudo element selector.
 *
 * @param pseudoName the pseudo element name. <code>NULL</code> if this element selector can match any pseudo
 *                   element.</p>
 * @return the element selector
 * @throws CSSException If this selector is not supported.
 */
public ElementSelector createPseudoElementSelector( String namespaceURI,
                                                    String pseudoName )
  throws CSSException {
  if ( namespaceURI != null ) {
    throw new CSSException( CSSException.SAC_NOT_SUPPORTED_ERR );
  } else {
    return new PseudoElementSelectorImpl( pseudoName );
  }
}
 
Example #2
Source File: FixNamespaceSelectorFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
public ElementSelector createElementSelector( final String namespaceURI,
                                              final String tagName )
  throws CSSException {

  if ( namespaceURI != null ) {
    return parent.createElementSelector( namespaceURI, tagName );
  } else {
    if ( tagName == null ) {
      return parent.createElementSelector( null, null );
    } else {
      final String[] ns = StyleSheetParserUtil.parseNamespaceIdent( tagName );
      return parent.createElementSelector( ns[ 0 ], ns[ 1 ] );
    }
  }
}
 
Example #3
Source File: FixNamespaceSelectorFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
public ElementSelector createPseudoElementSelector( final String namespaceURI,
                                                    final String pseudoName )
  throws
  CSSException {
  if ( namespaceURI != null ) {
    return parent.createPseudoElementSelector( namespaceURI, pseudoName );
  } else {
    final String[] ns = StyleSheetParserUtil.parseNamespaceIdent( pseudoName );
    return parent.createPseudoElementSelector( ns[ 0 ], ns[ 1 ] );
  }
}
 
Example #4
Source File: CSSSelectorFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Creates an element selector.
 *
 * @param namespaceURI the <a href="http://www.w3.org/TR/REC-xml-names/#dt-NSName">namespace URI</a> of the element
 *                     selector.
 * @param tagName      the <a href="http://www.w3.org/TR/REC-xml-names/#NT-LocalPart">local part</a> of the element
 *                     name. <code>NULL</code> if this element selector can match any element.</p>
 * @return the element selector
 * @throws CSSException If this selector is not supported.
 */
public ElementSelector createElementSelector( String namespaceURI,
                                              String tagName )
  throws CSSException {
  if ( namespaceURI == null ) {
    namespaceURI = CSSParserContext.getContext().getDefaultNamespace();
  }

  return new CSSElementSelector
    ( Selector.SAC_ELEMENT_NODE_SELECTOR, namespaceURI, tagName );
}
 
Example #5
Source File: CSSSelectorFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Creates a pseudo element selector.
 *
 * @param pseudoName the pseudo element name. <code>NULL</code> if this element selector can match any pseudo
 *                   element.</p>
 * @return the element selector
 * @throws CSSException If this selector is not supported.
 */
public ElementSelector createPseudoElementSelector( String namespaceURI,
                                                    String pseudoName )
  throws CSSException {
  if ( namespaceURI == null ) {
    namespaceURI = CSSParserContext.getContext().getDefaultNamespace();
  }
  return new CSSElementSelector
    ( Selector.SAC_PSEUDO_ELEMENT_SELECTOR, namespaceURI, pseudoName );
}
 
Example #6
Source File: FixNamespaceSelectorFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
public ElementSelector createElementSelector( final String namespaceURI, final String tagName ) throws CSSException {

    if ( namespaceURI != null ) {
      return parent.createElementSelector( namespaceURI, tagName );
    } else {
      if ( tagName == null ) {
        return parent.createElementSelector( null, null );
      } else {
        styleSheetParserUtil = StyleSheetParserUtil.getInstance();
        final String[] ns = styleSheetParserUtil.parseNamespaceIdent( tagName, namespaceCollection );
        return parent.createElementSelector( ns[0], ns[1] );
      }
    }
  }
 
Example #7
Source File: FixNamespaceSelectorFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
public ElementSelector createPseudoElementSelector( final String namespaceURI, final String pseudoName )
  throws CSSException {
  if ( namespaceURI != null ) {
    return parent.createPseudoElementSelector( namespaceURI, pseudoName );
  } else {
    final String[] ns = styleSheetParserUtil.parseNamespaceIdent( pseudoName, namespaceCollection );
    return parent.createPseudoElementSelector( ns[0], ns[1] );
  }
}
 
Example #8
Source File: CSSSelectorFactory.java    From tm4e with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public ElementSelector createElementSelector(String uri, String name) throws CSSException {
	return new CSSElementSelector(uri, name);
}
 
Example #9
Source File: CSSSelectorFactory.java    From tm4e with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public ElementSelector createPseudoElementSelector(String arg0, String arg1) throws CSSException {
	throw new UnsupportedOperationException();
}
 
Example #10
Source File: SelectorFactoryImpl.java    From pentaho-reporting with GNU Lesser General Public License v2.1 3 votes vote down vote up
/**
 * Creates an element selector.
 *
 * @param namespaceURI the <a href="http://www.w3.org/TR/REC-xml-names/#dt-NSName">namespace URI</a> of the element
 *                     selector.
 * @param tagName      the <a href="http://www.w3.org/TR/REC-xml-names/#NT-LocalPart">local part</a> of the element
 *                     name. <code>NULL</code> if this element selector can match any element.</p>
 * @return the element selector
 * @throws CSSException If this selector is not supported.
 */
public ElementSelector createElementSelector( String namespaceURI, String localName )
  throws CSSException {
  if ( namespaceURI != null ) {
    throw new CSSException( CSSException.SAC_NOT_SUPPORTED_ERR );
  } else {
    return new ElementSelectorImpl( localName );
  }
}
 
Example #11
Source File: CSSSelectorFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Creates an element selector.
 *
 * @param namespaceURI
 *          the <a href="http://www.w3.org/TR/REC-xml-names/#dt-NSName">namespace URI</a> of the element selector.
 * @param tagName
 *          the <a href="http://www.w3.org/TR/REC-xml-names/#NT-LocalPart">local part</a> of the element name.
 *          <code>NULL</code> if this element selector can match any element.</p>
 * @return the element selector
 * @throws CSSException
 *           If this selector is not supported.
 */
public ElementSelector createElementSelector( final String namespaceURI, final String tagName ) throws CSSException {
  return new CSSElementSelector( Selector.SAC_ELEMENT_NODE_SELECTOR, namespaceURI, tagName );
}
 
Example #12
Source File: CSSSelectorFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Creates a pseudo element selector.
 *
 * @param pseudoName
 *          the pseudo element name. <code>NULL</code> if this element selector can match any pseudo element.</p>
 * @return the element selector
 * @throws CSSException
 *           If this selector is not supported.
 */
public ElementSelector createPseudoElementSelector( final String namespaceURI, final String pseudoName )
  throws CSSException {
  return new CSSElementSelector( Selector.SAC_PSEUDO_ELEMENT_SELECTOR, namespaceURI, pseudoName );
}