org.jvnet.hk2.config.Dom.getKey()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(181)

本文整理了Java中org.jvnet.hk2.config.Dom.getKey()方法的一些代码示例,展示了Dom.getKey()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dom.getKey()方法的具体详情如下:
包路径:org.jvnet.hk2.config.Dom
类名称:Dom
方法名:getKey

Dom.getKey介绍

[英]Obtains the actual key value from this Dom.
[中]从这个Dom中获取实际的键值。

代码示例

代码示例来源:origin: javaee/glassfish

@Override
  String elementValue(Object element) {
    return Dom.unwrap((ConfigBeanProxy) element).getKey();
  }
}

代码示例来源:origin: javaee/glassfish

@Override
  public void set(Dom dom, Object arg) {
    Dom target = (Dom) arg;
    dom.attribute(xmlName, arg==null?null:target.getKey());
  }
}

代码示例来源:origin: javaee/glassfish

/**
 * Recursively decends the DOM tree and finds a DOM that has the given key
 * and the type name.
 *
 * <p>
 * TODO: the current algorithm does a full tree scan. Expand the model
 * so that we can detect deadends that are statically known not to contain
 * the kind we are looking for, and use that to cut the search space.
 */
public Dom resolveReference(String key, String typeName) {
  String keyedAs = model.keyedAs;
  if(keyedAs!=null && keyedAs.equals(typeName) && getKey().equals(key))
    return this; // found it
  for (Child child : children) {
    if (child instanceof NodeChild) {
      NodeChild n = (NodeChild) child;
      Dom found = n.dom.resolveReference(key,typeName);
      if(found!=null) return found;
    }
  }
  return null;
}

代码示例来源:origin: javaee/glassfish

/**
 * Replaces an existing {@link NodeChild} with another one.
 *
 * @see #insertAfter(Dom, String, Dom)
 */
public synchronized void replaceChild(Dom reference, String name, Dom newNode) {
  ListIterator<Child> itr = children.listIterator();
  while(itr.hasNext()) {
    Child child = itr.next();   
    if (child instanceof NodeChild) {
      NodeChild nc = (NodeChild) child;
      if(nc.dom==reference) {
        reference.release();
        newNode.domDescriptor = addWithAlias(getHabitat(), newNode,newNode.getProxyType(), newNode.getKey());
        
        itr.set(new NodeChild(name,newNode));
        return;
      }
    }
  }
  throw new IllegalArgumentException(reference+" is not a valid child of "+this+". Children="+children);
}

代码示例来源:origin: javaee/glassfish

@Override
  public void set(Dom dom, Object arg) {
    if(arg==null) {
      dom.removeLeafElement(xmlName, dom.leafElement(xmlName));
    } else {
      dom.setLeafElements(xmlName,((Dom) arg).getKey());
    }
  }
}

代码示例来源:origin: javaee/glassfish

newNode.domDescriptor = addWithAlias(getHabitat(), newNode, newNode.getProxyType(), newNode.getKey());
return;
  if(nc.dom==reference) {
    itr.add(newChild);
    newNode.domDescriptor = addWithAlias(getHabitat(), newNode, newNode.getProxyType(), newNode.getKey());

代码示例来源:origin: javaee/glassfish

throw new IllegalArgumentException("A " + master.getProxyType().getSimpleName() +
    " with the same key \"" + keyValue + "\" already exists in " +
    parent.getProxyType().getSimpleName() + " " + parent.getKey()) ;

代码示例来源:origin: javaee/glassfish

throw new PropertyVetoException("Instance of " + getImplementation() + " named '" + getKey() +
    "' is not locked for writing when invoking method " + method.getName()
    + " you must use transaction semantics to access it.", null);

代码示例来源:origin: javaee/glassfish

String siblingKey = sibling.getKey();
if (newValue.equals(siblingKey)) {
  bean.getLock().unlock();

代码示例来源:origin: javaee/glassfish

domDescriptor = dc.addActiveDescriptor(domDesc, false);
String key = getKey();
for (String contract : model.contracts) {
  ActiveDescriptor<Dom> alias = new AliasDescriptor<Dom>(locator, domDescriptor, contract, key);

代码示例来源:origin: org.glassfish.hk2/config

@Override
  public void set(Dom dom, Object arg) {
    Dom target = (Dom) arg;
    dom.attribute(xmlName, arg==null?null:target.getKey());
  }
}

代码示例来源:origin: org.glassfish.hk2/hk2-config

@Override
  String elementValue(Object element) {
    return Dom.unwrap((ConfigBeanProxy) element).getKey();
  }
}

代码示例来源:origin: org.glassfish.hk2/hk2-config

@Override
  public void set(Dom dom, Object arg) {
    Dom target = (Dom) arg;
    dom.attribute(xmlName, arg==null?null:target.getKey());
  }
}

代码示例来源:origin: com.sun.enterprise/config

@Override
  public void set(Dom dom, Object arg) {
    Dom target = (Dom) arg;
    dom.attribute(xmlName, arg==null?null:target.getKey());
  }
}

代码示例来源:origin: eclipse-ee4j/glassfish

@Override
  String elementValue(Object element) {
    return Dom.unwrap((ConfigBeanProxy) element).getKey();
  }
}

代码示例来源:origin: org.glassfish.hk2/config

@Override
  String elementValue(Object element) {
    return Dom.unwrap((ConfigBeanProxy) element).getKey();
  }
}

代码示例来源:origin: org.glassfish.hk2/config

@Override
  public void set(Dom dom, Object arg) {
    if(arg==null) {
      dom.removeLeafElement(xmlName, dom.leafElement(xmlName));
    } else {
      dom.setLeafElements(xmlName,((Dom) arg).getKey());
    }
  }
}

代码示例来源:origin: org.glassfish.hk2/hk2-config

@Override
  public void set(Dom dom, Object arg) {
    if(arg==null) {
      dom.removeLeafElement(xmlName, dom.leafElement(xmlName));
    } else {
      dom.setLeafElements(xmlName,((Dom) arg).getKey());
    }
  }
}

代码示例来源:origin: org.glassfish.hk2/config

/* package */ void register() {
  habitat.add(this);
  String key = getKey();
  for (String contract : model.contracts) {
    habitat.addIndex(this, contract, key);
  }
  if (key!=null) {
    habitat.addIndex(this, model.targetTypeName, key);
  }
}

代码示例来源:origin: com.sun.enterprise/config

/* package */ void register() {
  habitat.add(this);
  String key = getKey();
  for (String contract : model.contracts) {
    habitat.addIndex(this, contract, key);
  }
  if (key!=null) {
    habitat.addIndex(this, model.targetTypeName, key);
  }
}

相关文章