public static String asRequiredString(AnnotationInstance annotationInstance, final String attributeName, PropertyReplacer propertyReplacer) { final AnnotationValue nameValue = annotationInstance.value(attributeName); if (nameValue == null) { throw ROOT_LOGGER.annotationAttributeMissing(annotationInstance.name().toString(), attributeName); } final String nameValueAsString = nameValue.asString(); if (nameValueAsString.isEmpty()) { throw ROOT_LOGGER.annotationAttributeMissing(annotationInstance.name().toString(), attributeName); } return propertyReplacer != null ? propertyReplacer.replaceProperties(nameValueAsString) : nameValueAsString; } }
if (!(target instanceof ClassInfo)) { EjbLogger.DEPLOYMENT_LOGGER.warn(EjbLogger.ROOT_LOGGER.annotationOnlyAllowedOnClass(sessionBeanAnnotation.name().toString(), target).getMessage()); continue;
private static void addAnnotationToMap(AnnotationInstance instance, Map<DotName, List<AnnotationInstance>> annotations) { DotName dotName = instance.name(); List<AnnotationInstance> list; if ( annotations.containsKey( dotName ) ) { list = annotations.get( dotName ); } else { list = new ArrayList<AnnotationInstance>(); annotations.put( dotName, list ); } list.add( instance ); }
private static void addAnnotationToMap(AnnotationInstance instance, Map<DotName, List<AnnotationInstance>> annotations) { DotName dotName = instance.name(); List<AnnotationInstance> list; if ( annotations.containsKey( dotName ) ) { list = annotations.get( dotName ); } else { list = new ArrayList<AnnotationInstance>(); annotations.put( dotName, list ); } list.add( instance ); }
/** * Based on the the annotation type, its either entitymanager or entitymanagerfactory * * @param annotation * @return */ private String getClassLevelInjectionType(final AnnotationInstance annotation) { boolean isPC = annotation.name().local().equals("PersistenceContext"); return isPC ? ENTITY_MANAGER_CLASS : ENTITY_MANAGERFACTORY_CLASS; }
@Override public String getElementName() { return annotation.name().toString(); }
@Override protected AnnotationInstance push(AnnotationInstance annotationInstance) { if ( annotationInstance != null ) { return globalAnnotations.push( annotationInstance.name(), annotationInstance ); } return null; } }
@Override protected AnnotationInstance push(AnnotationInstance annotationInstance) { if ( annotationInstance != null ) { return globalAnnotations.push( annotationInstance.name(), annotationInstance ); } return null; }
@Override protected AnnotationInstance push(AnnotationInstance annotationInstance) { if ( annotationInstance != null ) { return globalAnnotations.push( annotationInstance.name(), annotationInstance ); } return null; }
/** * Based on the the annotation type, its either entitymanager or entitymanagerfactory * * @param annotation * @return */ private String getClassLevelInjectionType(final AnnotationInstance annotation) { boolean isPC = annotation.name().local().equals("PersistenceContext"); return isPC ? ENTITY_MANAGER_CLASS : ENTITY_MANAGERFACTORY_CLASS; }
@Override protected AnnotationInstance push(AnnotationInstance annotationInstance) { if ( annotationInstance != null ) { return globalAnnotations.push( annotationInstance.name(), annotationInstance ); } return null; } }
private boolean isPersistenceUnit(final AnnotationInstance annotation) { return annotation.name().local().equals("PersistenceUnit"); }
@Override public void beforePush(IndexBuilder indexBuilder, DotName classDotName, AnnotationInstance annotationInstance) { DotName annName = annotationInstance.name(); if ( !match( annName ) ) { return; } Map<DotName, List<AnnotationInstance>> map = indexBuilder.getIndexedAnnotations( classDotName ); overrideIndexedAnnotationMap( annName, annotationInstance, map ); }
public static String asRequiredString(AnnotationInstance annotationInstance, final String attributeName, PropertyReplacer propertyReplacer) { final AnnotationValue nameValue = annotationInstance.value(attributeName); if (nameValue == null) { throw ROOT_LOGGER.annotationAttributeMissing(annotationInstance.name().toString(), attributeName); } final String nameValueAsString = nameValue.asString(); if (nameValueAsString.isEmpty()) { throw ROOT_LOGGER.annotationAttributeMissing(annotationInstance.name().toString(), attributeName); } return propertyReplacer != null ? propertyReplacer.replaceProperties(nameValueAsString) : nameValueAsString; } }
public ColumnValues(AnnotationInstance columnAnnotation) { if ( columnAnnotation != null && !JPADotNames.COLUMN.equals( columnAnnotation.name() ) ) { throw new AssertionFailure( "A @Column annotation needs to be passed to the constructor" ); } applyColumnValues( columnAnnotation ); }
@Override public void beforePush(IndexBuilder indexBuilder, DotName classDotName, AnnotationInstance annotationInstance) { DotName annName = annotationInstance.name(); if ( !match( annName ) ) { return; } Map<DotName, List<AnnotationInstance>> map = indexBuilder.getIndexedAnnotations( classDotName ); overrideIndexedAnnotationMap( annName, annotationInstance, map ); }
public static String asRequiredString(AnnotationInstance annotationInstance, final String attributeName, PropertyReplacer propertyReplacer) { final AnnotationValue nameValue = annotationInstance.value(attributeName); if (nameValue == null) { throw ROOT_LOGGER.annotationAttributeMissing(annotationInstance.name().toString(), attributeName); } final String nameValueAsString = nameValue.asString(); if (nameValueAsString.isEmpty()) { throw ROOT_LOGGER.annotationAttributeMissing(annotationInstance.name().toString(), attributeName); } return propertyReplacer != null ? propertyReplacer.replaceProperties(nameValueAsString) : nameValueAsString; } }
public ColumnValues(AnnotationInstance columnAnnotation) { if ( columnAnnotation != null && !JPADotNames.COLUMN.equals( columnAnnotation.name() ) ) { throw new AssertionFailure( "A @Column annotation needs to be passed to the constructor" ); } applyColumnValues( columnAnnotation ); }
private void addAnnotation(AnnotationInstance instance) { addClassName(instance.name()); for (AnnotationValue value : instance.values()) { buildAValueEntries(value); } addAnnotationTarget(instance.target()); annotationTable.addReference(instance); }
private void writeAnnotation(PackedDataOutputStream stream, AnnotationInstance instance) throws IOException { stream.writePackedU32(positionOf(instance.name())); AnnotationTarget target = instance.target(); writeAnnotationTarget(stream, target); writeAnnotationValues(stream, instance.values()); }