public <T extends java.lang.annotation.Annotation> T getAnnotation() throws Exception { return getAnnotation(getClass().getClassLoader()); }
public <T extends java.lang.annotation.Annotation> T getAnnotation() throws Exception { return getAnnotation(getClass().getClassLoader()); }
public <T extends java.lang.annotation.Annotation> T getAnnotation() throws Exception { String cname = name.getFQN(); try { Class<T> c = (Class<T>) getClass().getClassLoader().loadClass(cname); return getAnnotation(c); } catch (ClassNotFoundException e) { } catch (NoClassDefFoundError e) { } return null; }
public <T extends java.lang.annotation.Annotation> T getAnnotation(ClassLoader cl) throws Exception { String cname = name.getFQN(); try { @SuppressWarnings("unchecked") Class<T> c = (Class<T>) cl.loadClass(cname); return getAnnotation(c); } catch (ClassNotFoundException | NoClassDefFoundError e) { return null; } }
@Override public void annotation(Annotation annotation) { try { Meta.OCD ocd = annotation.getAnnotation(Meta.OCD.class); Meta.AD ad = annotation.getAnnotation(Meta.AD.class); if (ocd != null) { MetaTypeReader.this.ocdAnnotation = annotation; } if (ad != null) { assert method != null; methods.put(method, ad); } } catch (Exception e) { reporter.error("Error during annotation parsing %s : %s", clazz, e); e.printStackTrace(); } }
public <T extends java.lang.annotation.Annotation> T getAnnotation(ClassLoader cl) throws Exception { String cname = name.getFQN(); try { @SuppressWarnings("unchecked") Class<T> c = (Class<T>) cl.loadClass(cname); return getAnnotation(c); } catch (ClassNotFoundException | NoClassDefFoundError e) { return null; } }
public <T extends java.lang.annotation.Annotation> T getAnnotation() throws Exception { String cname = name.getFQN(); try { @SuppressWarnings("unchecked") Class<T> c = (Class<T>) getClass().getClassLoader().loadClass(cname); return getAnnotation(c); } catch (ClassNotFoundException e) { } catch (NoClassDefFoundError e) { } return null; }
public <T extends java.lang.annotation.Annotation> T getAnnotation() throws Exception { String cname = name.getFQN(); try { @SuppressWarnings("unchecked") Class<T> c = (Class<T>) getClass().getClassLoader().loadClass(cname); return getAnnotation(c); } catch (ClassNotFoundException e) { } catch (NoClassDefFoundError e) { } return null; }
@Override public void annotation(Annotation annotation) throws Exception { String fqn = annotation.getName() .getFQN(); if (fqn.equals("aQute.bnd.annotation.xml.XMLAttribute")) { xmlAttr = annotation.getAnnotation(XMLAttribute.class); } }
@Override public void annotation(Annotation annotation) throws Exception { String fqn = annotation.getName() .getFQN(); if (fqn.equals("aQute.bnd.annotation.xml.XMLAttribute")) { xmlAttr = annotation.getAnnotation(XMLAttribute.class); } }
@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); } }
@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); } }
@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); } }
@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); } }
@Override public void annotation(Annotation annotation) { try { java.lang.annotation.Annotation a = annotation.getAnnotation(); if (a instanceof Component) doComponent((Component) a, annotation); else if (a instanceof Activate) doActivate(); else if (a instanceof Deactivate) doDeactivate(); else if (a instanceof Modified) doModified(); else if (a instanceof Reference) doReference((Reference) a, annotation); } catch (Exception e) { e.printStackTrace(); analyzer.error("During generation of a component on class %s, exception %s", clazz, e); } }
private void doLicense(Annotation a) throws Exception { BundleLicense annotation = a.getAnnotation(BundleLicense.class); Parameters p = new Parameters(); p.put(annotation.name(), getAttributes(a, "name")); add(Constants.BUNDLE_LICENSE, p.toString()); }
private void doLicense(Annotation a) throws Exception { BundleLicense annotation = a.getAnnotation(BundleLicense.class); Parameters p = new Parameters(); p.put(annotation.name(), getAttributes(a, "name")); add(Constants.BUNDLE_LICENSE, p.toString()); }
private void doRequireCapability(Annotation a) throws Exception { RequireCapability annotation = a.getAnnotation(RequireCapability.class); Parameters p = new Parameters(); Attrs attrs = getAttributes(a, "ns"); directivesAndVersion(attrs, "filter", "effective", "resolution"); replaceParameters(attrs); if ("".equals(attrs.get(Constants.FILTER_DIRECTIVE))) attrs.remove(Constants.FILTER_DIRECTIVE); p.put(annotation.ns(), attrs); String s = p.toString(); String extra = annotation.extra(); if (extra != null) { extra = extra.trim(); if (extra.length() > 0) s += ";" + extra; } add(Constants.REQUIRE_CAPABILITY, s); }
private void doProvideCapability(Annotation a) throws Exception { ProvideCapability annotation = a.getAnnotation(ProvideCapability.class); Parameters p = new Parameters(); Attrs attrs = getAttributes(a, "ns"); directivesAndVersion(attrs, "uses", "mandatory", "effective"); p.put(annotation.ns(), attrs); String value = attrs.remove("name"); if (value != null) attrs.put(annotation.ns(), value); value = attrs.remove("value"); String s = p.toString(); if (value != null) s += ";" + annotation.value(); add(Constants.PROVIDE_CAPABILITY, s); }
private void doProvideCapability(Annotation a) throws Exception { ProvideCapability annotation = a.getAnnotation(ProvideCapability.class); Parameters p = new Parameters(); Attrs attrs = getAttributes(a, "ns"); directivesAndVersion(attrs, "uses", "mandatory", "effective"); p.put(annotation.ns(), attrs); String value = attrs.remove("name"); if (value != null) attrs.put(annotation.ns(), value); value = attrs.remove("value"); String s = p.toString(); if (value != null) s += ";" + annotation.value(); add(Constants.PROVIDE_CAPABILITY, s); }