Lines Matching defs:format
155 * the given mutations. If any format is changed or added, and the
213 /* Get the existing format list, or copy it from SimpleCatalog. */
222 Format format = new NonPersistentFormat(Object.class);
223 format.setId(Format.ID_OBJECT);
224 formatList.set(Format.ID_OBJECT, format);
225 format = new NonPersistentFormat(Number.class);
226 format.setId(Format.ID_NUMBER);
227 formatList.set(Format.ID_NUMBER, format);
237 for (Format format : formatList) {
238 if (format != null) {
239 formatMap.put(format.getClassName(), format);
242 for (Format format : formatList) {
243 if (format != null) {
244 format.migrateFromBeta(formatMap);
256 for (Format format : formatList) {
257 if (format != null) {
258 String name = format.getClassName();
259 if (format.isCurrentVersion()) {
260 formatMap.put(name, format);
262 if (format == format.getLatestVersion()) {
263 latestFormatMap.put(name, format);
267 for (Format format : formatList) {
268 if (format != null) {
269 format.initializeIfNeeded(this);
288 * Add all predefined (simple) formats to the format map. The
331 * until an instance is stored, in which case an old format exists.
375 for (Format format : formatList) {
376 if (format != null) {
377 format.initializeIfNeeded(this);
378 if (format == format.getLatestVersion()) {
379 latestFormatMap.put(format.getClassName(), format);
438 for (Format format : formatMap.values()) {
439 if (format.isEntity()) {
440 entityFormats.add(format);
465 * Returns a map from format to a set of its superclass formats. The
466 * format for simple types, enums and class Object are not included. Only
473 for (Format format : formatList) {
474 if (format == null || Format.isPredefined(format)) {
477 Format superFormat = format.getSuperFormat();
484 subclass.add(format);
550 * If the given class format is not already present in the given map,
551 * creates an uninitialized format, adds it to the map, and also collects
555 /* Return a new or existing format for this class. */
557 Format format = newFormats.get(className);
558 if (format != null) {
559 return format;
561 format = formatMap.get(className);
562 if (format != null) {
563 return format;
567 /* Create format of the appropriate type. */
573 format = new ProxiedFormat(type, proxyClassName);
575 format = type.getComponentType().isPrimitive() ?
579 format = new EnumFormat(type);
581 format = new NonPersistentFormat(type);
603 format = new CompositeKeyFormat
608 format = new ComplexFormat(type, metadata, entityMetadata);
611 /* Collect new format along with any related new formats. */
612 newFormats.put(className, format);
613 format.collectRelatedFormats(this, newFormats);
615 return format;
619 * Adds a format and makes it the current format for the class.
621 private void addFormat(Format format) {
622 addFormat(format, formatList, formatMap);
626 * Adds a format to the given the format collections, for use when
629 private void addFormat(Format format,
632 format.setId(list.size());
633 list.add(format);
634 map.put(format.getClassName(), format);
638 * Installs an existing format when no evolution is needed, i.e, when the
651 for (Format format : formatMap.values()) {
652 if (format.isModelClass()) {
653 classes.add(format.getClassName());
660 * When a format is intialized, this method is called to get the version
663 public int getInitVersion(Format format, boolean forReader) {
666 format.getId() >= catalogData.formatList.size()) {
670 * null, the Catalog ctor is finished and the format must be new.
671 * If the ctor is in progress, the format is new if its ID is
678 * Get the version of a pre-existing format during execution of the
688 * format. Use the current version if the format changed
691 return (evolver != null && evolver.isFormatChanged(format)) ?
694 /* Always used the stored version for a pre-existing format. */
702 Format format = formatList.get(formatId);
703 if (format == null) {
707 return format;
716 * Get a format for a given class, creating it if it does not exist.
719 * PersistEntityBinding. When a new entity subclass format is added we
726 Format format = formatMap.get(cls.getName());
727 if (format == null) {
729 format = addNewFormat(cls);
732 Format entityFormat = format.getEntityFormat();
733 if (entityFormat != null && entityFormat != format) {
743 if (format == null) {
748 return format;
760 * Adds a format for a new class. Returns the format added for the given
770 * format needed. Note that this is not the double-check technique
775 Format format = formatMap.get(cls.getName());
776 if (format != null) {
777 return format;
780 /* Copy the read-only format collections. */
787 /* Add the new format and all related new formats. */
789 format = createFormat(cls, newFormats);
808 * are used, since a format must be persistent before it can be
823 return format;
827 * Used to write the catalog when a format has been changed, for example,
919 Format format = (Format) o.getType();
920 if (this != format.getCatalog()) {
921 String className = format.getClassName();
922 format = getFormat(className);
923 if (format == null) {
928 Format proxiedFormat = format.getProxiedFormat();
930 format = proxiedFormat;
935 return format.convertRawObject(this, false, o, converted);
940 for (Format format : formatList) {
941 if (format != null) {
943 ("ID: " + format.getId() +
944 " class: " + format.getClassName() +
945 " version: " + format.getVersion() +
947 (format == formatMap.get(format.getClassName())));