Package org.eclipse.jst.jsf.common.metadata

Examples of org.eclipse.jst.jsf.common.metadata.Entity


   * @param nodeName
   * @return Entity
   */
  protected Entity findTagEntity(final String nodeName) {
    for (Iterator it=getMergedModel().getChildEntities().iterator();it.hasNext();){
      Entity entity = (Entity)it.next();
      if (nodeName.equals(entity.getId()))
        return entity;
    }
    return null;
  }
View Full Code Here


   * @param attributeName
   * @return Attribute entity for supplied attribute name and given Tag entity.  Will return null if not found.
   */
  protected Entity findAttributeEntityForTagEntity(final Entity tag, final String attributeName) {
    for (Iterator it=tag.getChildEntities().iterator();it.hasNext();){
      Entity attr = (Entity)it.next();
      if (attributeName.equals(attr.getId()))
        return attr;
    }
    return null;
  }
View Full Code Here

   * Create entities for tags
   * @param tagLib
   */
  protected void createTags(final Namespace tagLib) {
    for (final ITagElement tag : tagLib.getViewElements()){
      Entity entity = findTagEntity(tag.getName());
      if (entity == null){
        entity = MetadataFactory.eINSTANCE.createEntity();
        entity.setId(getTagNodeName(tag));
        entity.setType("tag"); //$NON-NLS-1$
        getMergedModel().getChildEntities().add(entity);
      }
      setTagEntityTraits(tag, entity);
    }
   
View Full Code Here

   */
  protected void createAttributeEntities(final Entity tagEntity, final
      ITagElement tag) {
   
    for (final ITagAttribute tagAttr : tag.getAttributes().values()){         
      Entity attr = findAttributeEntityForTagEntity(tagEntity, tagAttr.getName());
      if (attr == null) {
        attr = MetadataFactory.eINSTANCE.createEntity();
        attr.setId(tagAttr.getName());
        tagEntity.getChildEntities().add(attr);
      }
      createAttributeTraits(attr, tagAttr);
    }
     
View Full Code Here

    String attrKey = tagName + "/" + attributeName; //$NON-NLS-1$
   
      final IMetaDataDomainContext modelContext = getMetaDataDomainContext(sdContext);
    final ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(modelContext);

    Entity attrEntity = query.getQueryHelper().getEntity(uri, attrKey);

    if (attrEntity != null)
      return getAttributeValueRuntimeTypeFeatureProcessors(featureType, sdContext, attrEntity);
   
    return Collections.EMPTY_LIST;
View Full Code Here

    return false;

  }
  private Trait getTraitForEntityUsingContext(final String traitName) {
    //look for trait on given entity
    final Entity entity = getMetaDataContext().getEntity();   
    final IMetaDataDomainContext modelContext = getMetaDataDomainContext();
    final IMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(modelContext);
    return query.getQueryHelper().getTrait(entity, traitName);
  }
View Full Code Here

     */
    public TagMapping getTagToViewMapping(final TagIdentifier tagId)
    {
        final ITaglibDomainMetaDataModelContext modelContext = createMetadataContext(tagId
                .getUri());
        final Entity entity = TaglibDomainMetaDataQueryHelper.getEntity(
                modelContext, tagId.getTagName());
        if (entity != null)
        {
            final Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(
                    entity, ViewMetadataMapper.DEFAULT_MAPPING_TRAIT_ID);
View Full Code Here

    public AttributeToPropertyMapping getAttributeMapping(
            final TagIdentifier tagId, final String name)
    {
        final ITaglibDomainMetaDataModelContext modelContext = createMetadataContext(tagId
                .getUri());
        final Entity entity = TaglibDomainMetaDataQueryHelper.getEntity(
                modelContext, tagId.getTagName()+"/"+name); //$NON-NLS-1$
        if (entity != null)
        {
            final Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(
                    entity, ViewMetadataMapper.DEFAULT_ATTRIBUTE_TRAIT_ID);
View Full Code Here

            final Trait trait = MetadataFactory.eINSTANCE.createTrait();
            trait.setId(ViewMetadataMapper.DEFAULT_MAPPING_TRAIT_ID);
            trait.setValue(tagMapping);

            final Entity entity = MetadataFactory.eINSTANCE.createEntity();
            entity.setId(tagName);
            entity.setType("tag"); //$NON-NLS-1$
            entity.getTraits().add(trait);

            _root.getChildEntities().add(entity);
        }
    }
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated NOT
   */
  private EObject getTagTraitValue(final String tagName, final String traitKey) {
    Entity tag_ = getTag(tagName);
    if (tag_ != null){
      for (Iterator it=tag_.getTraits().iterator();it.hasNext();){
        Trait trait = (Trait)it.next();
        if (traitKey.equals(trait.getId()))
          return trait.getValue();  
      }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jst.jsf.common.metadata.Entity

Copyright © 2018 www.massapicom. 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.