Search in sources :

Example 11 with Debug

use of org.apache.sis.util.Debug in project sis by apache.

the class Formatter method toString.

/**
 * Returns a string representation of this formatter for debugging purpose.
 *
 * @return a string representation of this formatter.
 */
@Debug
@Override
public String toString() {
    final StringBuilder b = new StringBuilder(Classes.getShortClassName(this));
    String separator = " of ";
    for (int i = enclosingElements.size(); --i >= 0; ) {
        b.append(separator).append(Classes.getShortClassName(enclosingElements.get(i)));
        separator = " inside ";
    }
    return b.toString();
}
Also used : InternationalString(org.opengis.util.InternationalString) Debug(org.apache.sis.util.Debug)

Example 12 with Debug

use of org.apache.sis.util.Debug in project sis by apache.

the class PropertyAccessor method toString.

/**
 * Returns a string representation of this accessor for debugging purpose.
 * Output example:
 *
 * {@preformat text
 *     PropertyAccessor[13 getters & 13 setters in DefaultCitation:Citation from “ISO 19115”]
 * }
 */
@Debug
@Override
public String toString() {
    final StringBuilder buffer = new StringBuilder(60);
    buffer.append("PropertyAccessor[").append(standardCount).append(" getters");
    final int extra = allCount - standardCount;
    if (extra != 0) {
        buffer.append(" (+").append(extra).append(" ext.)");
    }
    if (setters != null) {
        int c = 0;
        for (final Method setter : setters) {
            if (setter != null) {
                c++;
            }
        }
        buffer.append(" & ").append(c).append(" setters");
    }
    buffer.append(" in ").append(Classes.getShortName(implementation));
    if (type != implementation) {
        buffer.append(':').append(Classes.getShortName(type));
    }
    return buffer.append(" from “").append(Citations.getIdentifier(standard, false)).append("”]").toString();
}
Also used : Method(java.lang.reflect.Method) Debug(org.apache.sis.util.Debug)

Example 13 with Debug

use of org.apache.sis.util.Debug in project sis by apache.

the class SimpleIdentifier method toString.

/**
 * Returns a string representation of this identifier.
 */
@Debug
@Override
public String toString() {
    final String classname = Classes.getShortClassName(this);
    final StringBuilder buffer = new StringBuilder(classname.length() + CharSequences.length(code) + 10);
    buffer.append(classname).append('[');
    // Subclasses may have overridden this method.
    final String codespace = getCodeSpace();
    boolean open = false;
    if (codespace != null) {
        buffer.append('“').append(codespace);
        open = true;
    }
    if (code != null) {
        buffer.append(open ? DEFAULT_SEPARATOR : '“').append(code);
        open = true;
    }
    if (open) {
        buffer.append('”');
    }
    appendToString(buffer);
    return buffer.append(']').toString();
}
Also used : InternationalString(org.opengis.util.InternationalString) Debug(org.apache.sis.util.Debug)

Example 14 with Debug

use of org.apache.sis.util.Debug in project sis by apache.

the class Molodensky method internal.

/**
 * Creates a descriptor for the internal parameters of {@link MolodenskyTransform}.
 * This is similar to the standard parameters except that the redundant target axes
 * lengths are omitted.
 *
 * @return internal parameter descriptor.
 */
@Debug
public static ParameterDescriptorGroup internal() {
    final ParameterBuilder builder = builder().setCodeSpace(Citations.SIS, Constants.SIS);
    ParameterDescriptor<Boolean> abridged = builder.addName("abridged").create(Boolean.class, null);
    return builder.addName("Molodensky (radians domain)").createGroup(DIMENSION, SRC_SEMI_MAJOR, SRC_SEMI_MINOR, AXIS_LENGTH_DIFFERENCE, FLATTENING_DIFFERENCE, TX, TY, TZ, abridged);
}
Also used : ParameterBuilder(org.apache.sis.parameter.ParameterBuilder) Debug(org.apache.sis.util.Debug)

Example 15 with Debug

use of org.apache.sis.util.Debug in project sis by apache.

the class ConcurrentAuthorityFactory method toString.

/**
 * Returns a string representation of this factory for debugging purpose only.
 * The string returned by this method may change in any future SIS version.
 *
 * @return a string representation for debugging purpose.
 *
 * @see #printCacheContent(PrintWriter)
 */
@Debug
@Override
public String toString() {
    final String s = super.toString();
    DataAccessRef<DAO> usage = currentDAO.get();
    if (usage == null) {
        synchronized (availableDAOs) {
            usage = availableDAOs.peekLast();
        }
        if (usage == null) {
            return s;
        }
    }
    return s + System.lineSeparator() + usage;
}
Also used : InternationalString(org.opengis.util.InternationalString) Debug(org.apache.sis.util.Debug)

Aggregations

Debug (org.apache.sis.util.Debug)20 IOException (java.io.IOException)4 InternationalString (org.opengis.util.InternationalString)4 TableAppender (org.apache.sis.io.TableAppender)3 ParameterBuilder (org.apache.sis.parameter.ParameterBuilder)3 TreeTable (org.apache.sis.util.collection.TreeTable)3 Map (java.util.Map)2 Parameters (org.apache.sis.parameter.Parameters)2 Console (java.io.Console)1 PrintWriter (java.io.PrintWriter)1 UncheckedIOException (java.io.UncheckedIOException)1 Method (java.lang.reflect.Method)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 NilReferencingObject (org.apache.sis.internal.referencing.NilReferencingObject)1 FormattableObject (org.apache.sis.io.wkt.FormattableObject)1 ObjectConverter (org.apache.sis.util.ObjectConverter)1 DefaultTreeTable (org.apache.sis.util.collection.DefaultTreeTable)1 TreeTableFormat (org.apache.sis.util.collection.TreeTableFormat)1 ParameterDescriptor (org.opengis.parameter.ParameterDescriptor)1