本文整理了Java中serp.bytecode.BCClass.addAttribute()
方法的一些代码示例,展示了BCClass.addAttribute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BCClass.addAttribute()
方法的具体详情如下:
包路径:serp.bytecode.BCClass
类名称:BCClass
方法名:addAttribute
暂无
代码示例来源:origin: net.sourceforge.serp/serp
/**
* Return source file information for the class.
* Acts internally through the {@link Attributes} interface.
*
* @param add if true, a new source file attribute will be added
* if not already present
* @return the source file information, or null if none and the
* <code>add</code> param is set to false
*/
public SourceFile getSourceFile(boolean add) {
SourceFile source = (SourceFile) getAttribute(Constants.ATTR_SOURCE);
if (!add || (source != null))
return source;
return (SourceFile) addAttribute(Constants.ATTR_SOURCE);
}
代码示例来源:origin: org.apache.openjpa/openjpa-all
/**
* Return source file information for the class.
* Acts internally through the {@link Attributes} interface.
*
* @param add if true, a new source file attribute will be added
* if not already present
* @return the source file information, or null if none and the
* <code>add</code> param is set to false
*/
public SourceFile getSourceFile(boolean add) {
SourceFile source = (SourceFile) getAttribute(Constants.ATTR_SOURCE);
if (!add || (source != null))
return source;
return (SourceFile) addAttribute(Constants.ATTR_SOURCE);
}
代码示例来源:origin: net.sourceforge.serp/serp
/**
* Return inner classes information for the class.
* Acts internally through the {@link Attributes} interface.
*
* @param add if true, a new inner classes attribute will be added
* if not already present
* @return the inner classes information, or null if none and the
* <code>add</code> param is set to false
*/
public InnerClasses getInnerClasses(boolean add) {
InnerClasses inner = (InnerClasses) getAttribute
(Constants.ATTR_INNERCLASS);
if (!add || (inner != null))
return inner;
return (InnerClasses) addAttribute(Constants.ATTR_INNERCLASS);
}
代码示例来源:origin: org.apache.openjpa/openjpa-all
/**
* Return inner classes information for the class.
* Acts internally through the {@link Attributes} interface.
*
* @param add if true, a new inner classes attribute will be added
* if not already present
* @return the inner classes information, or null if none and the
* <code>add</code> param is set to false
*/
public InnerClasses getInnerClasses(boolean add) {
InnerClasses inner = (InnerClasses) getAttribute
(Constants.ATTR_INNERCLASS);
if (!add || (inner != null))
return inner;
return (InnerClasses) addAttribute(Constants.ATTR_INNERCLASS);
}
代码示例来源:origin: net.sourceforge.serp/serp
/**
* Convenience method to set whether this class should be considered
* deprecated. Acts internally through the {@link Attributes} interface.
*/
public void setDeprecated(boolean on) {
if (!on)
removeAttribute(Constants.ATTR_DEPRECATED);
else if (!isDeprecated())
addAttribute(Constants.ATTR_DEPRECATED);
}
代码示例来源:origin: org.apache.openjpa/openjpa-all
/**
* Convenience method to set whether this class should be considered
* deprecated. Acts internally through the {@link Attributes} interface.
*/
public void setDeprecated(boolean on) {
if (!on)
removeAttribute(Constants.ATTR_DEPRECATED);
else if (!isDeprecated())
addAttribute(Constants.ATTR_DEPRECATED);
}
代码示例来源:origin: org.apache.openejb.patch/openjpa-kernel
private void configureBCs() {
if (!_bcsConfigured) {
if (getRedefine()) {
if (_managedType.getAttribute(REDEFINED_ATTRIBUTE) == null)
_managedType.addAttribute(REDEFINED_ATTRIBUTE);
else
_isAlreadyRedefined = true;
}
if (getCreateSubclass()) {
PCSubclassValidator val = new PCSubclassValidator(
_meta, _managedType, _log, _fail);
val.assertCanSubclass();
_pc = _managedType.getProject().loadClass(
toPCSubclassName(_managedType.getType()));
if (_pc.getSuperclassBC() != _managedType) {
_pc.setSuperclass(_managedType);
_pc.setAbstract(_managedType.isAbstract());
_pc.declareInterface(DynamicPersistenceCapable.class);
} else {
_isAlreadySubclassed = true;
}
}
_bcsConfigured = true;
}
}
代码示例来源:origin: org.apache.openejb.patch/openjpa
private void configureBCs() {
if (!_bcsConfigured) {
if (getRedefine()) {
if (_managedType.getAttribute(REDEFINED_ATTRIBUTE) == null)
_managedType.addAttribute(REDEFINED_ATTRIBUTE);
else
_isAlreadyRedefined = true;
}
if (getCreateSubclass()) {
PCSubclassValidator val = new PCSubclassValidator(
_meta, _managedType, _log, _fail);
val.assertCanSubclass();
_pc = _managedType.getProject().loadClass(
toPCSubclassName(_managedType.getType()));
if (_pc.getSuperclassBC() != _managedType) {
_pc.setSuperclass(_managedType);
_pc.setAbstract(_managedType.isAbstract());
_pc.declareInterface(DynamicPersistenceCapable.class);
} else {
_isAlreadySubclassed = true;
}
}
_bcsConfigured = true;
}
}
代码示例来源:origin: org.apache.openjpa/openjpa-all
private void configureBCs() {
if (!_bcsConfigured) {
if (getRedefine()) {
if (_managedType.getAttribute(REDEFINED_ATTRIBUTE) == null)
_managedType.addAttribute(REDEFINED_ATTRIBUTE);
else
_isAlreadyRedefined = true;
}
if (getCreateSubclass()) {
PCSubclassValidator val = new PCSubclassValidator(
_meta, _managedType, _log, _fail);
val.assertCanSubclass();
_pc = _managedType.getProject().loadClass(
toPCSubclassName(_managedType.getType()));
if (_pc.getSuperclassBC() != _managedType) {
_pc.setSuperclass(_managedType);
_pc.setAbstract(_managedType.isAbstract());
_pc.declareInterface(DynamicPersistenceCapable.class);
} else {
_isAlreadySubclassed = true;
}
}
_bcsConfigured = true;
}
}
代码示例来源:origin: org.apache.openjpa/openjpa-kernel
private void configureBCs() {
if (!_bcsConfigured) {
if (getRedefine()) {
if (_managedType.getAttribute(REDEFINED_ATTRIBUTE) == null)
_managedType.addAttribute(REDEFINED_ATTRIBUTE);
else
_isAlreadyRedefined = true;
}
if (getCreateSubclass()) {
PCSubclassValidator val = new PCSubclassValidator(
_meta, _managedType, _log, _fail);
val.assertCanSubclass();
_pc = _managedType.getProject().loadClass(
toPCSubclassName(_managedType.getType()));
if (_pc.getSuperclassBC() != _managedType) {
_pc.setSuperclass(_managedType);
_pc.setAbstract(_managedType.isAbstract());
_pc.declareInterface(DynamicPersistenceCapable.class);
} else {
_isAlreadySubclassed = true;
}
}
_bcsConfigured = true;
}
}
代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa
private void configureBCs() {
if (!_bcsConfigured) {
if (getRedefine()) {
if (_managedType.getAttribute(REDEFINED_ATTRIBUTE) == null)
_managedType.addAttribute(REDEFINED_ATTRIBUTE);
else
_isAlreadyRedefined = true;
}
if (getCreateSubclass()) {
PCSubclassValidator val = new PCSubclassValidator(
_meta, _managedType, _log, _fail);
val.assertCanSubclass();
_pc = _managedType.getProject().loadClass(
toPCSubclassName(_managedType.getType()));
if (_pc.getSuperclassBC() != _managedType) {
_pc.setSuperclass(_managedType);
_pc.setAbstract(_managedType.isAbstract());
_pc.declareInterface(DynamicPersistenceCapable.class);
} else {
_isAlreadySubclassed = true;
}
}
_bcsConfigured = true;
}
}
内容来源于网络,如有侵权,请联系作者删除!