本文整理了Java中aQute.bnd.osgi.Analyzer.error()
方法的一些代码示例,展示了Analyzer.error()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Analyzer.error()
方法的具体详情如下:
包路径:aQute.bnd.osgi.Analyzer
类名称:Analyzer
方法名:error
暂无
代码示例来源:origin: biz.aQute.bnd/bndlib
private void checkMapReturnType(boolean hasMapReturnType) {
if (hasMapReturnType) {
if (!felixExtensions) {
analyzer.error(
"In component %s, to use a return type of Map you must specify -ds-felix-extensions",
component.implementation, "");
}
//TODO rethink how this is signalled.
if (component.xmlns == null) {
component.xmlns = FELIX_1_2;
}
}
}
代码示例来源:origin: biz.aQute.bnd/bnd
private void checkMapReturnType(boolean hasMapReturnType) {
if (hasMapReturnType) {
if (!felixExtensions) {
analyzer.error(
"In component %s, to use a return type of Map you must specify -ds-felix-extensions",
component.implementation, "");
}
//TODO rethink how this is signalled.
if (component.xmlns == null) {
component.xmlns = FELIX_1_2;
}
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
private void checkMapReturnType(DeclarativeServicesAnnotationError details) {
if (!options.contains(Options.felixExtensions)) {
analyzer.error(
"In component %s, to use a return type of Map you must specify the -dsannotations-options felixExtensions flag "
+ " and use a felix extension attribute or explicitly specify the appropriate xmlns.",
className)
.details(details);
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
private void checkMapReturnType(DeclarativeServicesAnnotationError details) {
if (!options.contains(Options.felixExtensions)) {
analyzer.error(
"In component %s, to use a return type of Map you must specify the -dsannotations-options felixExtensions flag "
+ " and use a felix extension attribute or explicitly specify the appropriate xmlns.",
className)
.details(details);
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
void prepare(Analyzer analyzer) {
if (attributes.isEmpty()) {
updateVersion(MetatypeVersion.VERSION_1_3);
}
Set<String> adIds = new HashSet<>();
for (ADDef ad : attributes) {
ad.prepare(this);
if (!adIds.add(ad.id)) {
analyzer.error("OCD for %s.%s has duplicate AD id %s due to colliding munged element names", id, name,
ad.id);
}
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
void prepare(Analyzer analyzer) {
if (attributes.isEmpty()) {
updateVersion(MetatypeVersion.VERSION_1_3);
}
Set<String> adIds = new HashSet<>();
for (ADDef ad : attributes) {
ad.prepare(this);
if (!adIds.add(ad.id)) {
analyzer.error("OCD for %s.%s has duplicate AD id %s due to colliding munged element names", id, name,
ad.id);
}
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
public void setClasspath(File[] classpath) throws IOException {
List<Jar> list = new ArrayList<>();
for (int i = 0; i < classpath.length; i++) {
if (classpath[i].exists()) {
Jar current = new Jar(classpath[i]);
list.add(current);
} else {
error("Missing file on classpath: %s", IO.absolutePath(classpath[i]));
}
}
for (Iterator<Jar> i = list.iterator(); i.hasNext();) {
addClasspath(i.next());
}
}
代码示例来源:origin: biz.aQute.bnd/bnd
@Override
public void annotation(Annotation annotation) throws Exception {
try {
java.lang.annotation.Annotation a = annotation.getAnnotation();
if (a instanceof Designate)
designate = annotation;
else if (a instanceof Component)
pids = ((Component)a).configurationPid();
}
catch (Exception e) {
e.printStackTrace();
analyzer.error("During generation of a component on class %s, exception %s", clazz, e);
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
@Override
public void annotation(Annotation annotation) throws Exception {
try {
java.lang.annotation.Annotation a = annotation.getAnnotation();
if (a instanceof Designate)
designate = annotation;
else if (a instanceof Component)
pids = ((Component)a).configurationPid();
}
catch (Exception e) {
e.printStackTrace();
analyzer.error("During generation of a component on class %s, exception %s", clazz, e);
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
@Override
public void annotation(Annotation annotation) throws Exception {
try {
java.lang.annotation.Annotation a = annotation.getAnnotation();
if (a instanceof ObjectClassDefinition)
doOCD((ObjectClassDefinition) a, annotation);
else if (a instanceof AttributeDefinition)
methods.put(method, new Pair((AttributeDefinition)a, annotation));
}
catch (Exception e) {
e.printStackTrace();
analyzer.error("During generation of a component on class %s, exception %s", clazz, e);
}
}
代码示例来源:origin: biz.aQute.bnd/bnd
@Override
public void annotation(Annotation annotation) throws Exception {
try {
java.lang.annotation.Annotation a = annotation.getAnnotation();
if (a instanceof ObjectClassDefinition)
doOCD((ObjectClassDefinition) a, annotation);
else if (a instanceof AttributeDefinition)
methods.put(method, new Pair((AttributeDefinition)a, annotation));
}
catch (Exception e) {
e.printStackTrace();
analyzer.error("During generation of a component on class %s, exception %s", clazz, e);
}
}
代码示例来源:origin: biz.aQute/bndlib
/**
*
*/
protected void doDeactivate() {
if (!LIFECYCLEDESCRIPTOR.matcher(method.getDescriptor().toString()).matches())
analyzer.error(
"Deactivate method for %s does not have an acceptable prototype, only Map, ComponentContext, or BundleContext is allowed. Found: %s",
clazz, method.getDescriptor());
else {
component.deactivate = method.getName();
}
}
代码示例来源:origin: biz.aQute/bndlib
/**
*
*/
protected void doActivate() {
if (!LIFECYCLEDESCRIPTOR.matcher(method.getDescriptor().toString()).matches())
analyzer.error(
"Activate method for %s does not have an acceptable prototype, only Map, ComponentContext, or BundleContext is allowed. Found: %s",
clazz, method.getDescriptor());
else {
component.activate = method.getName();
}
}
代码示例来源:origin: biz.aQute/bndlib
/**
*
*/
protected void doModified() {
if (!LIFECYCLEDESCRIPTOR.matcher(method.getDescriptor().toString()).matches())
analyzer.error(
"Modified method for %s does not have an acceptable prototype, only Map, ComponentContext, or BundleContext is allowed. Found: %s",
clazz, method.getDescriptor());
else {
component.modified = method.getName();
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
public void addClasspath(Collection<?> jars) throws IOException {
for (Object jar : jars) {
if (jar instanceof Jar)
addClasspath((Jar) jar);
else if (jar instanceof File)
addClasspath((File) jar);
else if (jar instanceof String)
addClasspath(getFile((String) jar));
else
error("Cannot convert to JAR to add to classpath %s. Not a File, Jar, or String", jar);
}
}
代码示例来源:origin: biz.aQute/bndlib
public void addClasspath(Collection< ? > jars) throws IOException {
for (Object jar : jars) {
if (jar instanceof Jar)
addClasspath((Jar) jar);
else if (jar instanceof File)
addClasspath((File) jar);
else if (jar instanceof String)
addClasspath(getFile((String) jar));
else
error("Cannot convert to JAR to add to classpath %s. Not a File, Jar, or String", jar);
}
}
代码示例来源:origin: biz.aQute.bnd/bnd
public void addClasspath(Collection< ? > jars) throws IOException {
for (Object jar : jars) {
if (jar instanceof Jar)
addClasspath((Jar) jar);
else if (jar instanceof File)
addClasspath((File) jar);
else if (jar instanceof String)
addClasspath(getFile((String) jar));
else
error("Cannot convert to JAR to add to classpath %s. Not a File, Jar, or String", jar);
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
public void addClasspath(Collection< ? > jars) throws IOException {
for (Object jar : jars) {
if (jar instanceof Jar)
addClasspath((Jar) jar);
else if (jar instanceof File)
addClasspath((File) jar);
else if (jar instanceof String)
addClasspath(getFile((String) jar));
else
error("Cannot convert to JAR to add to classpath %s. Not a File, Jar, or String", jar);
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
public void addClasspath(Collection<?> jars) throws IOException {
for (Object jar : jars) {
if (jar instanceof Jar)
addClasspath((Jar) jar);
else if (jar instanceof File)
addClasspath((File) jar);
else if (jar instanceof String)
addClasspath(getFile((String) jar));
else
error("Cannot convert to JAR to add to classpath %s. Not a File, Jar, or String", jar);
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
private void parseAndMergeInheritedMetadata(TypeRef ref, Clazz child) throws Exception {
if (ref.isJava())
return;
Clazz ec = reporter.findClass(ref);
if (ec == null) {
reporter.error("Missing inherited class for Metatype annotations: " + ref + " from " + child.getClassName());
} else {
MetaTypeReader mtr = new MetaTypeReader(ec, reporter);
mtr.setDesignate(designatePid, factory);
mtr.finish();
for (Map.Entry<MethodDef,Meta.AD> entry : mtr.methods.entrySet())
addMethod(entry.getKey(), entry.getValue());
handleInheritedClasses(ec);
}
}
内容来源于网络,如有侵权,请联系作者删除!