private static void collectFieldAccessors(@NotNull Class<?> aClass, @NotNull List<MutableAccessor> accessors) { Class<?> currentClass = aClass; do { for (Field field : currentClass.getDeclaredFields()) { int modifiers = field.getModifiers(); //noinspection deprecation if (!Modifier.isStatic(modifiers) && (field.getAnnotation(OptionTag.class) != null || field.getAnnotation(Tag.class) != null || field.getAnnotation(Attribute.class) != null || field.getAnnotation(Property.class) != null || field.getAnnotation(Text.class) != null || field.getAnnotation(CollectionBean.class) != null || field.getAnnotation(MapAnnotation.class) != null || field.getAnnotation(AbstractCollection.class) != null || (Modifier.isPublic(modifiers) && // we don't want to allow final fields of all types, but only supported (!Modifier.isFinal(modifiers) || Collection.class.isAssignableFrom(field.getType())) && !Modifier.isTransient(modifiers) && field.getAnnotation(Transient.class) == null))) { accessors.add(new FieldAccessor(field)); } } } while ((currentClass = currentClass.getSuperclass()) != null && currentClass.getAnnotation(Transient.class) == null); }
@NotNull @Property(surroundWithTag = false) @Tag("devices") @AbstractCollection(surroundWithTag = false, elementTag = "device", elementValueAttribute = "id") public List<String> getDeviceIds() { return myDeviceIds; }
@AbstractCollection( elementTypes = { XPathResponseHandler.class, JsonPathResponseHandler.class, RegExResponseHandler.class }, surroundWithTag = false ) public List<ResponseHandler> getResponseHandlers() { Collection<ResponseHandler> handlers = myResponseHandlersMap.values(); return new ArrayList<ResponseHandler>(handlers); }
@Tag("selectors") @Property(surroundWithTag = false) @AbstractCollection(surroundWithTag = false) @NotNull public List<Selector> getSelectors() { return new ArrayList<Selector>(mySelectors.values()); }
@NotNull @Override @Property(surroundWithTag = false) @AbstractCollection(surroundWithTag = false, elementTag="branch") public List<BranchInfo> getBranches() { return myBranches; }
@NotNull @Property(surroundWithTag = false) @AbstractCollection(surroundWithTag = false, elementTag="workItem") @Override public List<WorkItem> getWorkItems() { return myWorkItems; }
@NotNull public Object createObject(@NotNull Class<?> aClass, FList<Type> processedTypes) throws Exception { Object o = ReflectionUtil.newInstance(aClass); for (MutableAccessor accessor : XmlSerializerUtil.getAccessors(aClass)) { AbstractCollection abstractCollection = accessor.getAnnotation(AbstractCollection.class); List<Type> elementTypes = abstractCollection != null ? Arrays.<Type>asList(abstractCollection.elementTypes()) : Collections.<Type>emptyList(); Object value = createValue(accessor.getGenericType(), processedTypes, elementTypes); if (value != null) { accessor.set(o, value); } } return o; }
@NotNull @Property(surroundWithTag = false) @AbstractCollection(surroundWithTag = false, elementTag = "changelist") public List<ChangeListInfo> getChangeLists() { return myChangeLists; }
@NotNull @Override @Property(surroundWithTag = false) @AbstractCollection(surroundWithTag = false, elementTag = "branch") public List<BranchInfo> getBranches() { return myBranches; }
@NotNull @Property(surroundWithTag = false) @AbstractCollection(surroundWithTag = false, elementTag = "workItem") @Override public List<WorkItem> getWorkItems() { return myWorkItems; }
@AbstractCollection( surroundWithTag = false, elementTypes = {AS3.class, Cocoa.class, Cpp.class, CSharp.class, Delphi.class, Erlang.class, Generator.class, Go.class, Graphviz.class, HTML.class, IGenerator.class, Java.class, Javascript.class, PHP.class, Python.class, Ruby.class} ) public List<Generator> getGenerators() { return generators; }
@Property(surroundWithTag = false) @AbstractCollection(surroundWithTag = false) public List<FacetState> getSubFacets() { return mySubFacets; }
@Property(surroundWithTag = false) @AbstractCollection(surroundWithTag = false) public List<FacetState> getFacets() { return myFacets; }
@Property(surroundWithTag = false) @AbstractCollection(surroundWithTag = false) public List<ArtifactState> getArtifacts() { return myArtifacts; }
@Property(surroundWithTag = false) @AbstractCollection(surroundWithTag = false) public List<ArtifactPropertiesState> getPropertiesList() { return myPropertiesList; }
@Tag("instance-filters") @AbstractCollection(surroundWithTag = false) public InstanceFilter[] getInstanceFilters() { return myInstanceFilters != null ? myInstanceFilters : InstanceFilter.EMPTY_ARRAY; }
@Tag("class-filters") @AbstractCollection(surroundWithTag = false) public final ClassFilter[] getClassFilters() { return myClassFilters != null ? myClassFilters : ClassFilter.EMPTY_ARRAY; }
@Tag("class-exclusion-filters") @AbstractCollection(surroundWithTag = false) public ClassFilter[] getClassExclusionFilters() { return myClassExclusionFilters != null ? myClassExclusionFilters : ClassFilter.EMPTY_ARRAY; }
@Property(surroundWithTag = false) @AbstractCollection(elementTag = "artifact", surroundWithTag = false) public List<Artifact> getArtifacts() { return myArtifacts; }
@NotNull @Property(surroundWithTag = false) @AbstractCollection(elementTag = "framework", surroundWithTag = false, elementValueAttribute = "") public List<String> getFrameworks() { return myFrameworks; }
@Tag("states") @AbstractCollection(surroundWithTag = false) public List<ComponentState> getStates() { return myStates; }
public AbstractCollectionBinding(@NotNull Class elementType, @Nullable MutableAccessor accessor) { super(accessor); itemType = elementType; annotation = accessor == null ? null : accessor.getAnnotation(AbstractCollection.class); }
@Tag("default-breakpoints") @AbstractCollection(surroundWithTag = false) public List<BreakpointState> getDefaultBreakpoints() { return myDefaultBreakpoints; }
@Tag("breakpoints") @AbstractCollection(surroundWithTag = false, elementTypes = {BreakpointState.class, LineBreakpointState.class}) public List<BreakpointState> getBreakpoints() { return myBreakpoints; }
@Tag("breakpoints-defaults") @AbstractCollection(surroundWithTag = false, elementTypes = {BreakpointState.class, LineBreakpointState.class}) public List<BreakpointState> getBreakpointsDefaults() { return myBreakpointsDefaults; }
@Tag("selected-grouping-rules") @AbstractCollection(surroundWithTag = false, elementTag = "grouping-rule", elementValueAttribute = "id") public Set<String> getSelectedGroupingRules() { return mySelectedGroupingRules; }
@Tag("ignored-facets") @AbstractCollection(surroundWithTag = false, elementTag = "facet", elementValueAttribute = "id") public Set<String> getIgnoredFacets() { return myIgnoredFacets; }
/** * @return names for file types */ @Tag("file-type-list") @AbstractCollection(elementTag = "filtered-out-file-type", elementValueAttribute = "name", surroundWithTag = false) public Set<String> getFilteredOutFileTypeNames() { return filteredOutFileTypeNames; }
@Tag("performed-conversions") @AbstractCollection(surroundWithTag = false, elementTag = "converter", elementValueAttribute = "id") public List<String> getPerformedConversionIds() { return myPerformedConversionIds; }
@Tag("modules") @AbstractCollection(surroundWithTag = false) public List<DisabledAutodetectionInModuleElement> getModuleElements() { return myModuleElements; }
@Tag("files") @AbstractCollection(surroundWithTag = false, elementTag = "file", elementValueAttribute = "url") public Set<String> getFiles() { return myFiles; }
@Tag("directories") @AbstractCollection(surroundWithTag = false, elementTag = "directory", elementValueAttribute = "url") public Set<String> getDirectories() { return myDirectories; }
@Tag("autodetection-disabled") @AbstractCollection(surroundWithTag = false) public List<DisabledAutodetectionByTypeElement> getElements() { return myElements; }
@Property(surroundWithTag = false) @AbstractCollection(surroundWithTag = false, elementTag = "type", elementValueAttribute = "id") public List<String> getFrameworkTypes() { return myFrameworkTypes; }
@Property(surroundWithTag = false) @AbstractCollection(surroundWithTag = false) public List<ExcludedFileState> getFiles() { return myFiles; }
@Tag("dependencies") @AbstractCollection(surroundWithTag = false) public List<AndroidExternalApklibDependenciesManager.MavenDependencyInfo> getDependencies() { return myDependencies; }