Examples of CMDocument


Examples of org.eclipse.wst.xml.core.internal.contentmodel.CMDocument

  /**
   * Returns the CMDocument that corresponds to the DOM Node. or null if no
   * CMDocument is appropriate for the DOM Node.
   */
  public CMDocument getCorrespondingCMDocument(Node node) {
    CMDocument jcmdoc = null;
    if (node instanceof IDOMNode) {
      IDOMModel model = ((IDOMNode) node).getModel();
      String modelPath = model.getBaseLocation();
      if (modelPath != null && !IModelManager.UNMANAGED_MODEL.equals(modelPath)) {
        if(node.getNodeName().trim().startsWith("t:")){
          jcmdoc = JSPCMDocumentFactory.getTapestryCMDocument();
        }else{
          float version = DeploymentDescriptorPropertyCache.getInstance().getJSPVersion(new Path(modelPath));
          jcmdoc = JSPCMDocumentFactory.getCMDocument(version);
        }
       
      }
    }
    if (jcmdoc == null) {
      jcmdoc = JSPCMDocumentFactory.getCMDocument();
    }
   
    CMDocument result = null;
    try {
      if (node.getNodeType() == Node.ELEMENT_NODE) {
        String elementName = node.getNodeName();

        // test to see if this node belongs to JSP's CMDocument (case
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.contentmodel.CMDocument

  /* (non-Javadoc)
   * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataTranslator#translate(org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelMergeAssistant)
   */
  public void translate(final IMetaDataModelMergeAssistant assistant) {
    _assistant = assistant;
    CMDocument doc = getSourceModel();
    if (doc instanceof HTMLCMDocument){
      doTranslate(doc);     
    }
  }
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.contentmodel.CMDocument

    String reference = uri;
    Object cacheKey = getCacheKey(reference);
    if (cacheKey == null)
      return null;
   
    CMDocument doc = (CMDocument) getDocuments().get(cacheKey);
    if (doc == null) {
      long lastModified = getModificationStamp(reference);
      /*
       * If hasn't been moved into the local table, do so and increment
       * the count. A local URI reference can be different depending on
       * the file from which it was referenced. Use a computed key to
       * keep them straight.
       */
      Object o = getSharedDocumentCache().get(cacheKey);
      if (o != null) {
        if (o instanceof TLDCacheEntry) {
          TLDCacheEntry entry = (TLDCacheEntry) o;
          if (_debugCache) {
            System.out.println("TLDCMDocument cache hit on " + cacheKey);
          }
          if (entry != null && entry.modificationStamp != IResource.NULL_STAMP && entry.modificationStamp >= lastModified) {
            doc = entry.document;
            entry.referenceCount++;
          }
          else {
            getSharedDocumentCache().remove(cacheKey);
          }
        }
        else if (o instanceof Reference) {
          TLDCacheEntry entry = (TLDCacheEntry) ((Reference) o).get();
          if (entry != null) {
            if (entry.modificationStamp != IResource.NULL_STAMP && entry.modificationStamp >= lastModified) {
              doc = entry.document;
              entry.referenceCount = 1;
              getSharedDocumentCache().put(cacheKey, entry);
            }
          }
          else {
            getSharedDocumentCache().remove(cacheKey);
          }
        }
      }
      /* No document was found cached, create a new one and share it */
      if (doc == null) {
        if (_debugCache) {
          System.out.println("TLDCMDocument cache miss on " + cacheKey);
        }
        CMDocument document = loadTaglib(reference);
        if (document != null) {
          TLDCacheEntry entry = new TLDCacheEntry();
          doc = entry.document = document;
          entry.referenceCount = 1;
          entry.modificationStamp = lastModified;
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.contentmodel.CMDocument

  /**
   * Loads the taglib from the specified URI. It must point to a valid
   * taglib descriptor to work.
   */
  protected CMDocument loadTaglib(String uri) {
    CMDocument document = null;
    IPath currentPath = getCurrentParserPath();
    if (currentPath != null) {
      ITaglibRecord record = TaglibIndex.resolve(currentPath.toString(), uri, false);
      if (record != null) {
        document = getCMDocumentBuilder().createCMDocument(record);
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.contentmodel.CMDocument

  public Element createElement(Document document, String data, boolean isJSPTag) {
    ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
    if (modelQuery == null) {
      return null;
    }
    CMDocument cm = modelQuery.getCorrespondingCMDocument(document);
    if (cm == null) {
      return null;
    }
    CMNamedNodeMap map = cm.getElements();
    if (map == null) {
      return null;
    }

    TagScanner scanner = new TagScanner(data, 1);
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.contentmodel.CMDocument

    Document document = element.getOwnerDocument();
    ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
    if (modelQuery == null) {
      return false;
    }
    CMDocument cm = modelQuery.getCorrespondingCMDocument(document);
    if (cm == null) {
      return false;
    }
    CMNamedNodeMap map = cm.getElements();
    if (map == null) {
      return false;
    }
    String prefix = element.getPrefix();
    if (prefix == null || !prefix.equals(SSI_PREFIX)) {
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.contentmodel.CMDocument

    }

    if (grammerURI == null)
      return null;
   
    CMDocument cmDocument = null;
    if (CACHE_FIXED_DOCUMENTS) {
      Reference ref = (Reference) fFixedCMDocuments.get(publicId);
      if (ref != null) {
        cmDocument = (CMDocument) ref.get();
        if (cmDocument != null) {
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.contentmodel.CMDocument

    }

    pid = entry.getPublicId();
    String sid = entry.getSystemId();

    CMDocument dtdcm = xhtmlassoc.getXHTMLCMDocument(pid, sid);
    if (dtdcm == null) {
      if (pid != null && pid.equals(HTMLDocumentTypeRegistry.CHTML_PUBLIC_ID)) {
        return staticCHTML;
      }
      return staticHTML;
    }

    String grammarURI = xhtmlassoc.getCachedGrammerURI();
    CMDocument buddycm = (CMDocument) buddyCache.get(grammarURI);
    if (buddycm != null)
      return buddycm;

    buddycm = new CMDocumentForBuddySystem(dtdcm, entry.isXMLType());
    buddyCache.put(grammarURI, buddycm);
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.contentmodel.CMDocument

    super();
  }
 
  public List/*<IMetaDataModelProvider>*/ locateMetaDataModelProviders(String uri) {
    List ret = new ArrayList();
    CMDocument doc = null;

    if (uri == null){
      return ret;
    }
    else if (uri.equalsIgnoreCase(CMDocType.HTML_DOC_TYPE)){
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.contentmodel.CMDocument

  /* (non-Javadoc)
   * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataTranslator#translate(org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelMergeAssistant)
   */
  public void translate(final IMetaDataModelMergeAssistant assistant) {
    setAssistant(assistant);
    CMDocument doc = getSourceModel();
    if (doc instanceof TLDDocument){
      doTranslate(doc);
     
    }
  }
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.