Examples of NameResolver


Examples of org.apache.myfaces.trinidadinternal.share.io.NameResolver

  /**
   * Gets the NameResolver stored on the ParseContext.
   */
  static public NameResolver getResolver(ParseContext context)
  {
    NameResolver source = (NameResolver)
      context.getProperty(_SHARE_NAMESPACE, "_nameResolver");
    if (source == null)
      source = new DefaultNameResolver(null, null);

    return source;
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.share.io.NameResolver

    // Get the index of the icon name in the _ICONS list
    String source = null;
    boolean isDirectionIndependent = false;
    boolean isCoreColor = false;
    Class<LookAndFeel> lookAndFeel = null;
    NameResolver resolver = null;

    if ( icon != null )
    {
      source = icon.getName();
      isDirectionIndependent = icon.isSymmetric();
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.share.io.NameResolver

    // at the same time
    synchronized (this)
    {
      if (_resolver == null)
      {
        NameResolver resolver = new DefaultNameResolver(_sourceFile, null);

        // We explicitly wrap the NameResolver in a CachingNameResolver
        // since that conveniently handles checking for modifications to
        // dependent (imported) files.
        // The default storage for cached files is a bit large,
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.share.io.NameResolver

    )
  {
    // In order to create the StyleSheetEntry, we need to locate and
    // parse the style sheet file.  We use a NameResolver to use to
    // find the style sheet.
    NameResolver resolver = _getNameResolver(context);
    if (resolver == null)
      return null;

    // a private static inner class to store the document, icon, and skin properties
    // =-=jmw @todo Should I just create a StyleSheetEntry directly,
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.share.io.NameResolver

    StyleContext context
    )
  {
    // First, get a NameResolver that we can use to resolve
    // locate the style sheet file.
    NameResolver resolver = StyleSheetNameResolver.createResolver(context);
    if (resolver == null)
    {
      // If we can't get a NameResolver, something is seriously wrong.
      // createResolver() logged the error already, so just return null.
      return null;
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.share.io.NameResolver

        // Throw away the old InputStreamProvider and StyleSheetDocument
        _provider = null;
        __setDocument(null);

        // Get a new NameResolver
        NameResolver resolver = _getNameResolver(context);
        if (resolver != null)
        {
          String name = getStyleSheetName();

          // Recreate the StyleSheetEntry for the styleSheet using the new NameResolver
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.share.io.NameResolver

    ParseContext context,
    String       sourceName,
    Class<?>     expectedType) throws IOException, SAXException
  {
    // Step 1. Find the name resolver.
    NameResolver resolver = getResolver(context);
    if (resolver == null)
    {
      _log(context, "Internal error: couldn't find NameResolver");
      return null;
    }

    // Step 2. Find an InputStreamProvider.  Mark a dependency on the base
    // provider (if necessary)
    InputStreamProvider provider = resolver.getProvider(sourceName);
    InputStreamProvider baseProvider = getInputStreamProvider(context);
    if (baseProvider instanceof CachingInputStreamProvider)
    {
      ((CachingInputStreamProvider) baseProvider).addCacheDependency(provider);
    }

    // Step 3. Detect if this will be a circular include.
    ArrayList<Object> list =
      (ArrayList<Object>) context.getProperty(_SHARE_NAMESPACE, "_includeStack");
    Object identifier = provider.getIdentifier();

    if ((list != null) && (list.contains(identifier)))
    {
      // =-=AEW Just logging an error isn't really enough - the include
      // will fail, but parsing continues.  So, instead, we throw
      // an exception...
      throw new SAXParseException(_LOG.getMessage(
        "CIRCULAR_INCLUDE_DETECTED", sourceName), context.getLocator());
    }

    // Step 4. Try to get a cached version
    Object cached = provider.getCachedResult();
    if ((cached != null) && expectedType.isInstance(cached))
      return cached;


    // Step 5. Set up the new context;  first, clone the original
    ParseContext newContext = (ParseContext) context.clone();

    // Add the current identifer to the stack (used for detecting
    // circular includes) placed on the ParseContext
    if (list == null)
      list = new ArrayList<Object>();
    else
      list = (ArrayList<Object>) list.clone();
    list.add(identifier);
    newContext.setProperty(_SHARE_NAMESPACE, "_includeStack", list);


    ParserManager parserManager =context.getParserManager();
    TreeBuilder builder = new TreeBuilder(parserManager,
                                          expectedType);
    InputStream stream = provider.openInputStream();

    try
    {
      InputSource source = new InputSource(stream);
      source.setSystemId(sourceName);

      setResolver(newContext, resolver.getResolver(sourceName));
      setInputStreamProvider(newContext, provider);

      // Step 6. Parse!
      Object value = builder.parse(context.getXMLProvider(),
                                   source,
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.share.io.NameResolver

  /**
   * Gets the NameResolver stored on the ParseContext.
   */
  static public NameResolver getResolver(ParseContext context)
  {
    NameResolver source = (NameResolver)
      context.getProperty(_SHARE_NAMESPACE, "_nameResolver");
    if (source == null)
      source = new DefaultNameResolver(null, null);

    return source;
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.share.io.NameResolver

    // Get the index of the icon name in the _ICONS list
    String source = null;
    boolean isDirectionIndependent = false;
    boolean isCoreColor = false;
    Class<LookAndFeel> lookAndFeel = null;
    NameResolver resolver = null;

    if ( icon != null )
    {
      source = icon.getName();
      isDirectionIndependent = icon.isSymmetric();
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.share.io.NameResolver

  private void _initResolver()
  {

    if (_resolver == null)
    {
      NameResolver resolver = new DefaultNameResolver(_sourceFile, null);

      // We explicitly wrap the NameResolver in a CachingNameResolver
      // since that conveniently handles checking for modifications to
      // dependent (imported) files.
      // The default storage for cached files is a bit large,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.