Method to format a given object.

@param _attribute Attribute the object belongs to
@param _object Object to be formated
@return formated object
@throws EFapsException on error
549049
@Override
    public Object get(final Attribute _attribute,
                      final Object _object)
        throws EFapsException
    {
        Object ret = null;
        if (_object != null && _attribute.getAttributeType().getDbAttrType() instanceof IFormattableType) {
            final IFormattableType attrType = (IFormattableType) _attribute.getAttributeType().getDbAttrType();
            if (_object instanceof List<?>) {
                final List<?> objectList = (List<?>) _object;
                final List<Object> temp = new ArrayList<>();
                for (final Object object : objectList) {
                    temp.add(attrType.format(object, this.pattern));
                }
                ret = temp;
            } else {
                ret = attrType.format(_object, this.pattern);
            }
        }
        return ret;
    }
1286402
public Attribute attribute(final String _alias)
        throws EFapsException
    {
        initialize(true);
        Attribute ret = null;
        final Optional<Select> selectOpt = this.selection.getSelects()
                        .stream()
                        .filter(select -> _alias.equals(select.getAlias()))
                        .findFirst();
        if (selectOpt.isPresent()) {
            ret = attribute(selectOpt.get());
        }
        return ret;
    }
681097
function formatAttrs(attributes, opts, keyOnlyAttribs = []) {
  if (!attributes) return;

  var output = '',
    value;

  // Loop through the attributes
  for (var key in attributes) {
    value = attributes[key];
    if (output) {
      output += ' ';
    }

    if (!value && booleanAttributes[key] || isExpr(key) || isKeyOnlyAttr(key, keyOnlyAttribs)) {
      output += key;
    } else {
      output += key + `=${isExpr(value) ? '' : '"'}` + (opts.decodeEntities ? entities.encodeXML(value) : value) + (isExpr(value) ? '' : '"');
    }
  }

  return output;
}
761014
public void set(String name, Object obj) throws IOException {
        if (!(obj instanceof AlgorithmId)) {
            throw new IOException("Attribute must be of type AlgorithmId.");
        }
        if (name.equalsIgnoreCase(ALGORITHM)) {
            algId = (AlgorithmId)obj;
        } else {
            throw new IOException("Attribute name not recognized by " +
                              "CertAttrSet:CertificateAlgorithmId.");
        }
    }
949976
public static Attr toAttr(Document doc, Object o) throws PageException {
	if (o instanceof Attr) return (Attr) o;
	if (o instanceof Struct && ((Struct) o).size() == 1) {
	    Struct sct = (Struct) o;
	    Entry<Key, Object> e = sct.entryIterator().next();
	    Attr attr = doc.createAttribute(e.getKey().getString());
	    attr.setValue(Caster.toString(e.getValue()));
	    return attr;
	}

	throw new XMLException("can't cast Object of type " + Caster.toClassName(o) + " to a XML Attribute");
    }
888851
@Override
    public Object getValue(final Object _object)
        throws EFapsException
    {
        final Instance inst = (Instance) super.getValue(_object);
        if (this.esjp == null) {
            try {
                final Class<?> clazz = Class.forName(this.className, false, EFapsClassLoader.getInstance());
                this.esjp = (IEsjpSelect) clazz.newInstance();
                final List<Instance> instances = new ArrayList<>();
                for (final Object obj : getOneSelect().getObjectList()) {
                    instances.add((Instance) super.getValue(obj));
                }
                if (this.parameters.isEmpty()) {
                    this.esjp.initialize(instances);
                } else {
                    this.esjp.initialize(instances, this.parameters.toArray(new String[this.parameters.size()]));
                }
            } catch (final ClassNotFoundException | InstantiationException | IllegalAccessException e) {
                LOG.error("Catched error", e);
            }
        }
        return this.esjp.getValue(inst);
    }
811620
public PrintStmt execute()
        throws EFapsException
    {
        if (getEQLStmt() instanceof IPrintObjectStatement) {
            this.print = new ObjectPrint((IPrintObjectStatement) getEQLStmt(), getFlags());
        } else if (getEQLStmt() instanceof IPrintListStatement) {
            this.print = new ListPrint((IPrintListStatement) getEQLStmt(), getFlags());
        } else if (getEQLStmt() instanceof IPrintQueryStatement) {
            this.print = new QueryPrint((IPrintQueryStatement) getEQLStmt(), getFlags());
        }
        StmtRunner.get().execute(this.print);
        return this;
    }
978713
public void listAnyObject(PdfObject object)
    {
        switch (object.type()) {
        case PdfObject.ARRAY:
            listArray((PdfArray)object);
            break;
        case PdfObject.DICTIONARY:
            listDict((PdfDictionary) object);
            break;
        case PdfObject.STRING:
            out.println("(" + object.toString() + ")");
            break;
        default:
            out.println(object.toString());
            break;
        }
    }
315581
def _object_with_attr(self, name):
        
        for obj in self._objects:
            if hasattr(obj, name):
                return obj

        raise AttributeError("No object has attribute {!r}".format(name))
216514
function unserializeContentObjectAttribute( $package, $objectAttribute, $attributeNode )
    {
        $timeNode = $attributeNode->getElementsByTagName( 'time' )->item( 0 );
        if ( is_object( $timeNode ) )
        {
            $timestamp = eZDateUtils::textToDate( $timeNode->textContent );
            $timeOfDay = null;
            if ( $timestamp >= 0 )
            {
                $time = new eZTime( $timestamp );
                $timeOfDay = $time->timeOfDay();
            }
            $objectAttribute->setAttribute( 'data_int', $timeOfDay );
        }
    }
355593
private MsgFormat init()
        throws EFapsException
    {
        if (!this.initialized) {
            for (final Class<?> clazz : new EsjpScanner().scan(EFapsFormatFactory.class)) {
                try {
                    final FormatFactory factory = (FormatFactory) clazz.newInstance();
                    final EFapsFormatFactory ano = clazz.getAnnotation(EFapsFormatFactory.class);
                    this.registry.put(ano.name(), factory);
                } catch (final InstantiationException | IllegalAccessException e) {
                    MsgFormat.LOG.error("Catched error on instantiotion", e);
                }
            }
            MsgFormat.LOG.info("registered FormatFactories: {}", this.registry);
            this.initialized = true;
        }
        return this;
    }
110580
public static String format(Object object) {
        Gson gson = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create();
        JsonParser jp = new JsonParser();
        JsonElement je = jp.parse(gson.toJson(object));
        String prettyJsonString = gson.toJson(je);
        //简单处理function
        String[] lines = prettyJsonString.split("\n");
        lines = replaceFunctionQuote(lines);
        StringBuilder stringBuilder = new StringBuilder();
        for (String line : lines) {
            stringBuilder.append(line);
        }
        return stringBuilder.toString();
    }
186417
public Object getAttribute(Object object, String attribute) {
        return getAttribute(theClass, object, attribute, false, false);
    }
484476
private String formatObject(Object obj) {
        if (obj == null) {
            return null;
        }

        if (obj instanceof Number) {
            return NumberFormat.getInstance(locale).format(obj); // fix
        } else if (obj instanceof Date) {
            return DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, locale).format(obj); //fix
        } else if (obj instanceof String) {
            return (String) obj;
        }

        return obj.toString();
    }
278207
protected function validateAttribute($object, $attribute)
    {
        $method = $this->method;
        $object->{$method}($attribute, $this->params);
    }
1355688
function objectAttributeContent( $contentObjectAttribute )
    {
        $userID = $contentObjectAttribute->attribute( "contentobject_id" );
        if ( empty( $GLOBALS['eZUserObject_' . $userID] ) )
        {
            $GLOBALS['eZUserObject_' . $userID] = eZUser::fetch( $userID );
        }

        $user = eZUser::fetch( $userID );
        eZDebugSetting::writeDebug( 'kernel-user', $user, 'user' );

        //Looking for a "draft" and loading its content
        $serializedDraft = $contentObjectAttribute->attribute( 'data_text' );

        if ( !empty( $serializedDraft ) )
        {
            $user = $this->updateUserDraft( $user, $serializedDraft );
        }

        return $user;
    }
1185389
public AbstractPrintQuery addAttribute(final String... _attrNames)
        throws EFapsException
    {
        final Type type = getMainType();
        if (type != null) {
            for (final String attrName : _attrNames) {
                final Attribute attr = type.getAttribute(attrName);
                if (attr == null) {
                    final AttributeSet set = AttributeSet.find(type.getName(), attrName);
                    if (set != null) {
                        addAttributeSet(set);
                    }
                } else {
                    addAttribute(attr);
                }
            }
        }
        return this;
    }