예제 #1
0
  /** {@inheritDoc} */
  public IEntity create(OMElement root, IParserContext context) {
    BeanXml entity = new BeanXml(context.getResource());
    entity.setEntity(entity);
    entity.setResource(context.getResource());
    entity.setResourceLocator(context.getLocator());
    entity.setTagName(TAG_NAME);

    return entity;
  }
예제 #2
0
  /** {@inheritDoc} */
  @Override
  protected boolean populate(T tag, IParserContext context) {

    super.populate(tag, context);

    final OMElement ele = context.getElement();

    final Set<String> ignore = getIgnoredAttributes(tag, context);

    processElement(
        tag,
        context,
        new IAttributeFilter() {

          public boolean accept(OMElement ele, String attrName, String attrValue) {
            return ignore == null || !ignore.contains(attrName);
          }
        });

    for (OMElement child : AxiomUtils.getElements(ele, null)) {
      if (isInvokerTag(child, context)) {
        encloseWithValueTag(ele, child, null);
      }
    }

    return false;
  }
예제 #3
0
  /**
   * Process the tag attributes and children.
   *
   * @param tag the tag
   * @param context the parse context
   * @param filter the attribute filter
   */
  public static void processElement(ITag tag, IParserContext context, IAttributeFilter filter) {

    final OMElement ele = context.getElement();

    String text = ele.getText();
    if (StringUtils.isBlank(text)) {
      text = null;
    }

    pushAttributeToSubConst(ele, filter);
  }