public static function toString(array $array_, $mode_ = 3, $maxDepth_ = 99, $separatorKeyValue_ = ': ', $separatorValues_ = ', ', $arrayDelimiterL_ = '[', $arrayDelimiterR_ = ']', &$string_ = '', &$level_ = 0) { $string_ .= $arrayDelimiterL_; $values = []; if ($maxDepth_ > ++$level_ && 0 < count($array_)) { foreach ($array_ as $key => $value) { if (is_array($value)) { if (Bitmask::hasBitForBitmask($mode_, self::RECURSIVE)) { $values[] = $key . $separatorKeyValue_ . self::toString($value, $mode_, $maxDepth_, $separatorKeyValue_, $separatorValues_, $arrayDelimiterL_, $arrayDelimiterR_, $strings_, $level_); } else { $values[] = $key . $separatorKeyValue_ . self::TYPE; } } else { if (is_null($value)) { $values[] = $key . $separatorKeyValue_ . 'null'; } else { if (is_bool($value)) { $values[] = $key . $separatorKeyValue_ . Boolean::valueAsString($value); } else { $values[] = $key . $separatorKeyValue_ . (string) $value; } } } } } $string_ .= implode($separatorValues_, $values); $string_ .= $arrayDelimiterR_; $level_--; return $string_; }
public static function init() { self::$classCRC32Cache = new IdentityHashMap(); self::$CLASS_TO_SERIALIZER_INSTANCE = new IdentityHashMap(); self::$NO_SUCH_SERIALIZER = new SerializabilityUtilEx_NoSuchSerializer(); self::$SERIALIZED_PRIMITIVE_TYPE_NAMES = new HashMap(); self::$TYPES_WHOSE_IMPLEMENTATION_IS_EXCLUDED_FROM_SIGNATURES = new HashSet(); self::$SERIALIZED_PRIMITIVE_TYPE_NAMES->put(Boolean::typeClass()->getFullName(), "Z"); self::$SERIALIZED_PRIMITIVE_TYPE_NAMES->put(Byte::typeClass()->getFullName(), "B"); self::$SERIALIZED_PRIMITIVE_TYPE_NAMES->put(Character::typeClass()->getFullName(), "C"); self::$SERIALIZED_PRIMITIVE_TYPE_NAMES->put(Double::typeClass()->getFullName(), "D"); self::$SERIALIZED_PRIMITIVE_TYPE_NAMES->put(Float::typeClass()->getFullName(), "F"); self::$SERIALIZED_PRIMITIVE_TYPE_NAMES->put(Integer::typeClass()->getFullName(), "I"); self::$SERIALIZED_PRIMITIVE_TYPE_NAMES->put(Long::typeClass()->getFullName(), "J"); self::$SERIALIZED_PRIMITIVE_TYPE_NAMES->put(Short::typeClass()->getFullName(), "S"); self::$TYPES_WHOSE_IMPLEMENTATION_IS_EXCLUDED_FROM_SIGNATURES->add(Boolean::clazz()); self::$TYPES_WHOSE_IMPLEMENTATION_IS_EXCLUDED_FROM_SIGNATURES->add(Byte::clazz()); self::$TYPES_WHOSE_IMPLEMENTATION_IS_EXCLUDED_FROM_SIGNATURES->add(Character::clazz()); self::$TYPES_WHOSE_IMPLEMENTATION_IS_EXCLUDED_FROM_SIGNATURES->add(Double::clazz()); //TODO Exception class //self::$TYPES_WHOSE_IMPLEMENTATION_IS_EXCLUDED_FROM_SIGNATURES->add(Exception::clazz()); self::$TYPES_WHOSE_IMPLEMENTATION_IS_EXCLUDED_FROM_SIGNATURES->add(Float::clazz()); self::$TYPES_WHOSE_IMPLEMENTATION_IS_EXCLUDED_FROM_SIGNATURES->add(Integer::clazz()); self::$TYPES_WHOSE_IMPLEMENTATION_IS_EXCLUDED_FROM_SIGNATURES->add(Long::clazz()); self::$TYPES_WHOSE_IMPLEMENTATION_IS_EXCLUDED_FROM_SIGNATURES->add(Object::clazz()); self::$TYPES_WHOSE_IMPLEMENTATION_IS_EXCLUDED_FROM_SIGNATURES->add(Short::clazz()); self::$TYPES_WHOSE_IMPLEMENTATION_IS_EXCLUDED_FROM_SIGNATURES->add(String::clazz()); self::$TYPES_WHOSE_IMPLEMENTATION_IS_EXCLUDED_FROM_SIGNATURES->add(Classes::classOf('Throwable')); }
function PrimitiveIO_boolean() { $this->_eachPost = ''; $this->addOption("1", "true"); $this->addOption("0", "false"); $zero = Boolean::withValue("0"); $this->setValue($zero); }
/** * Overload the constdcteur * * BooleanSwitch constructor. * @param $name * @param string $label * @param null $function */ public function __construct($name, $label = '', $function = null) { parent::__construct($name, $label); $this->center(); if (!is_null($function)) { $this->setRemoteProcess($function); } }
/** * Returns the string which will be used in the template * @return string */ public function forTemplate() { $isEditable = FrontendEditing::editingEnabled() && FrontendEditing::isEditable($this); $value = parent::forTemplate(); if ($isEditable) { $field = $this->scaffoldSearchField($value)->setAttribute('data-feclass', FrontendEditing::getClassName($this))->setAttribute('data-feid', FrontendEditing::getID($this))->setAttribute('data-fefield', $this->name)->setHasEmptyDefault(false)->addExtraClass("frontend-editable frontend-editable-boolean")->setValue($value); $value = $field->forTemplate(); } return $value; }
public static function init() { self::$TYPE_NAMES[' Z'] = Boolean::typeClass(); self::$TYPE_NAMES[' B'] = Byte::typeClass(); self::$TYPE_NAMES[' C'] = Character::typeClass(); self::$TYPE_NAMES[' D'] = Double::typeClass(); self::$TYPE_NAMES[' F'] = Float::typeClass(); self::$TYPE_NAMES[' I'] = Integer::typeClass(); self::$TYPE_NAMES[' J'] = Long::typeClass(); self::$TYPE_NAMES[' S'] = Short::typeClass(); }
public function __construct($baseShape, $includeMimeContent = null, $bodyType = null, $additionalProperties = null) { if (!DefaultShapeNames::isValidShape($baseShape)) { throw new InvalidArgumentException('Provided base shape is invalid'); } if ($bodyType === null) { $bodyType = BodyType::TYPE_BEST; } elseif (!BodyType::isValidBodyType($bodyType)) { throw new InvalidArgumentException('Provided body type is invalid'); } $this->BaseShape = $baseShape; $this->IncludeMimeContent = Boolean::getBoolean($includeMimeContent); $this->BodyType = $bodyType; }
public static function jsniName(Clazz $clazz) { if ($clazz->isPrimitive()) { if ($clazz === Boolean::typeClass()) { return 'Z'; } else { if ($clazz === Byte::typeClass()) { return 'B'; } else { if ($clazz === Character::typeClass()) { return 'C'; } else { if ($clazz === Short::typeClass()) { return 'S'; } else { if ($clazz === Integer::typeClass()) { return 'I'; } else { if ($clazz === Long::typeClass()) { return 'J'; } else { if ($clazz === Float::typeClass()) { return 'F'; } else { if ($clazz === Double::typeClass()) { return 'D'; } } } } } } } } throw new RuntimeException('Unhandled primitive tye ' + $clazz->getName()); } else { if ($clazz->isArray()) { return '[' . self::jsniName($clazz->getComponentType()); } else { return 'L' . str_replace('.', '/', $clazz->getFullName()) . ';'; } } }
public function getType($object) { $type = \strtolower(\gettype($object)); if (is_int($type)) { $int = Integer::parse($object); //If an integer type was not enough to store the value //let it fall through to string type if ($int !== null) { return $int; } } if (\is_float($object)) { //Prefer decimal over floating point return Decimal::parse($object); } if (\is_bool($object)) { return Boolean::parse($object); } return String::parse($object); }
public static function init() { // Obfuscated self::$PRIMITIVE_TYPES[self::OBFUSCATED_CLASS_REFIX . BOOLEAN_TYPE] = Boolean::typeClass(); self::$PRIMITIVE_TYPES[self::OBFUSCATED_CLASS_REFIX . BYTE_TYPE] = Byte::typeClass(); self::$PRIMITIVE_TYPES[self::OBFUSCATED_CLASS_REFIX . CHAR_TYPE] = Character::typeClass(); self::$PRIMITIVE_TYPES[self::OBFUSCATED_CLASS_REFIX . DOUBLE_TYPE] = Double::typeClass(); self::$PRIMITIVE_TYPES[self::OBFUSCATED_CLASS_REFIX . FLOAT_TYPE] = Float::typeClass(); self::$PRIMITIVE_TYPES[self::OBFUSCATED_CLASS_REFIX . INT_TYPE] = Integer::typeClass(); self::$PRIMITIVE_TYPES[self::OBFUSCATED_CLASS_REFIX . LONG_TYPE] = Long::typeClass(); self::$PRIMITIVE_TYPES[self::OBFUSCATED_CLASS_REFIX . SHORT_TYPE] = Short::typeClass(); self::$PRIMITIVE_TYPES[self::OBFUSCATED_CLASS_REFIX . VOID_TYPE] = Void::typeClass(); // Regular self::$PRIMITIVE_TYPES[Boolean::typeClass()->getName()] = Boolean::typeClass(); self::$PRIMITIVE_TYPES[Byte::typeClass()->getName()] = Byte::typeClass(); self::$PRIMITIVE_TYPES[Character::typeClass()->getName()] = Character::typeClass(); self::$PRIMITIVE_TYPES[Double::typeClass()->getName()] = Double::typeClass(); self::$PRIMITIVE_TYPES[Float::typeClass()->getName()] = Float::typeClass(); self::$PRIMITIVE_TYPES[Integer::typeClass()->getName()] = Integer::typeClass(); self::$PRIMITIVE_TYPES[Long::typeClass()->getName()] = Long::typeClass(); self::$PRIMITIVE_TYPES[Short::typeClass()->getName()] = Short::typeClass(); self::$PRIMITIVE_TYPES[Void::typeClass()->getName()] = Void::typeClass(); }
/** * @dataProvider provideTestFilter */ public function testFilter($options, $raw, $filtered, $valid) { $int = new Boolean($options); $this->assertEquals($filtered, $int->filter($raw)); $this->assertEquals($valid, $int->validate($raw)); }
public function getTargetType() { return Boolean::typeClass(); }
/** * ArticleIsPublished - flag for summary_fields * @return DBField **/ public function ArticleIsPublished() { $field = Boolean::create('IsPublished'); $field->setValue($this->isPublished()); return $field; }
/** * @test(expectedFail=true) * @profile(fork) */ public function testAssertNotEqualsFailed() { assertNotEquals(Boolean::valueOf(true), Boolean::valueOf(true)); }
/** @test */ public function falseBoolean() { $this->assertFalse(Boolean::false()->evaluate()); }
/** * Returns a <code>Boolean</code> with a value represented by the * specified string. The <code>Boolean</code> returned represents a * true value if the string argument is not <code>null</code> * and is equal, ignoring case, to the string {@code "true"}. * * @param s a string. * @return the <code>Boolean</code> value represented by the string. */ public static function valueOf($value) { $b = new Boolean($value); return $b->toNative(); }
/** * Sets whether to display the output of the command * @param boolean $display */ public function setDisplay($display) { $this->display = Boolean::cast($display); }
private static function printTypeName(Clazz $type) { // Primitives // if ($type === Integer::typeClass()) { return 'int'; } else { if ($type === Long::typeClass()) { return 'long'; } else { if ($type === Short::typeClass()) { return 'short'; } else { if ($type === Byte::typeClass()) { return 'byte'; } else { if ($type === Character::typeClass()) { return 'char'; } else { if ($type === Boolean::typeClass()) { return 'boolean'; } else { if ($type === Float::typeClass()) { return 'float'; } else { if ($type === Double::typeClass()) { return 'double'; } } } } } } } } // Arrays // if ($type->isArray()) { $componentType = $type->getComponentType(); return self::printTypeName($componentType) . '[]'; } // Everything else // return str_replace('$', '.', $type->getName()); }
/** * @expectedException DomainException */ public function testShrinkOnlyAcceptsElementsOfTheDomainAsParameters() { $generator = new Boolean(); $generator->shrink(10); }
/** * @param mixed $nullOrValue */ protected function setValue($nullOrValue) { if (is_null($nullOrValue)) { $this->value = $nullOrValue; } else { parent::setValue($nullOrValue); } }
public function writeValue(Clazz $clazz, $instance) { if ($clazz === Boolean::typeClass()) { $this->writeObject(new Boolean($instance)); } else { if ($clazz === Byte::typeClass()) { $this->writeObject(new Byte($instance)); } else { if ($clazz === Character::typeClass()) { $this->writeObject(new Character($instance)); } else { if ($clazz === Double::typeClass()) { $this->writeObject(new Double($instance)); } else { if ($clazz === Float::typeClass()) { $this->writeObject(new Float($instance)); } else { if ($clazz === Integer::typeClass()) { $this->writeObject(new Integer($instance)); } else { if ($clazz === Long::typeClass()) { $this->writeObject(new Long($instance)); } else { if ($clazz === Short::typeClass()) { $this->writeObject(new Short($instance)); } else { if ($clazz === String::clazz()) { $this->writeString($instance); } else { if ($clazz->isEnum()) { $this->writeEnum($clazz, $instance); } else { $this->writeObject($instance); } } } } } } } } } } }
/** * @param mixed $value to assign to boolean * @param mixed $expected text output * @dataProvider getOptionTextDataProvider */ public function testGetOptionText($value, $expected) { // calling outputValue() will cause the protected method getOptionText() to be called $boolean = new Boolean($this->localeMock, $this->loggerMock, $this->attributeMetadataMock, $this->localeResolverMock, $value, 0); $this->assertSame($expected, $boolean->outputValue()); }
static function __static() { self::$TRUE = new self(TRUE); self::$FALSE = new self(FALSE); }
/** * @see \Components\Object::__toString() \Components\Object::__toString() */ public function __toString() { return sprintf('%s@%s{initialized: %s}', __CLASS__, $this->hashCode(), Boolean::valueOf($this->m_initialized)); }
/** * Check if this block has been published. * @return boolean True if this page has been published. */ public function isPublishedNice() { $field = Boolean::create('isPublished'); $field->setValue($this->isPublished()); return $field->Nice(); }
/** * @dataProvider validationProvider */ public function testValidation($value, $result) { $validator = new Boolean(null); $this->assertEquals($result, $validator->validate($value)); }
/** * creates appropriate object from given ids * * @param Id $structureId * @param Id $partStructureId * @param String $part * @return object mixed * @access public * @since 7/21/05 */ function getPartObject($structureId, $partStructureId, $part) { $structure = $this->_destinationRepository->getRecordStructure($structureId); $partStructure = $structure->getPartStructure($partStructureId); $type = $partStructure->getType(); $typeString = $type->getKeyword(); switch ($typeString) { case "shortstring": case "string": $obj = String::withValue($part); return $obj; break; case "integer": $obj = Integer::withValue($part); return $obj; break; case "boolean": $obj = Boolean::withValue($part); return $obj; break; case "float": $obj = Float::withValue($part); return $obj; break; case "datetime": $obj = DateAndTime::fromString($part); return $obj; break; case "type": $obj = HarmoniType::fromString($part); return $obj; break; default: $this->addError("Unsupported PartStructure DataType: " . HarmoniType::typeToString($type) . "."); $false = false; return $false; } }
/** * Save our results. Tearing down and unsetting the Wizard is handled by * in {@link runWizard()} and does not need to be implemented here. * * @param string $cacheName * @return boolean TRUE if save was successful and tear-down/cleanup of the * Wizard should ensue. * @access public * @since 4/28/05 */ function saveWizard($cacheName) { $wizard = $this->getWizard($cacheName); // Make sure we have a valid Repository $authZ = Services::getService("AuthZ"); $idManager = Services::getService("Id"); $repositoryManager = Services::getService("Repository"); $repository = $repositoryManager->getRepository($idManager->getId("edu.middlebury.concerto.exhibition_repository")); $slideshowAsset = $repository->getAsset($idManager->getId(RequestContext::value('slideshow_id'))); $properties = $wizard->getAllValues(); $status = new StatusStars(_("Saving Slideshow")); $status->initializeStatistics(count($properties['slidestep']['slides']) + 2); // First, verify that we chose a parent that we can add children to. if ($authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify"), $slideshowAsset->getId())) { $slideshowAssetId = $slideshowAsset->getId(); $this->_slideshowAssetId = $slideshowAssetId; // Update the Name and description if ($properties['namedescstep']['display_name']) { $slideshowAsset->updateDisplayName($properties['namedescstep']['display_name']); } if ($properties['namedescstep']['description']) { $slideshowAsset->updateDescription($properties['namedescstep']['description']); } // Update the effective/expiration dates // if ($properties['datestep']['effective_date']) // $slideshowAsset->updateEffectiveDate( // DateAndTime::fromString( // $properties['datestep']['effective_date'])); // if ($properties['datestep']['expiration_date']) // $slideshowAsset->updateExpirationDate( // DateAndTime::fromString( // $properties['datestep']['expiration_date'])); // --- Slides --- $slideAssetType = new HarmoniType("Asset Types", "edu.middlebury.concerto", "Slide", "Slides are components of Slide-Shows that contain captions and may reference media Assets."); $slideRecordStructId = $idManager->getId("Repository::edu.middlebury.concerto.exhibition_repository::edu.middlebury.concerto.slide_record_structure"); $targetIdPartStructId = $idManager->getId("Repository::edu.middlebury.concerto.exhibition_repository::edu.middlebury.concerto.slide_record_structure.edu.middlebury.concerto.slide_record_structure.target_id"); $textPositionPartStructId = $idManager->getId("Repository::edu.middlebury.concerto.exhibition_repository::edu.middlebury.concerto.slide_record_structure.edu.middlebury.concerto.slide_record_structure.text_position"); $displayMetadataPartStructId = $idManager->getId("Repository::edu.middlebury.concerto.exhibition_repository::edu.middlebury.concerto.slide_record_structure.edu.middlebury.concerto.slide_record_structure.display_metadata"); $setManager = Services::getService("Sets"); $pSlideOrder = $setManager->getPersistentSet($slideshowAssetId); $slideIterator = $slideshowAsset->getAssets(); // ---- Add/Update Slides in new order (hopefully) $existingSlides = array(); while ($slideIterator->hasNext()) { $currentSlide = $slideIterator->next(); $id = $currentSlide->getId(); $existingSlides[] = $id->getIdString(); } $pSlideOrder->removeAllItems(); $status->updateStatistics(); foreach ($properties['slidestep']['slides'] as $slideProperties) { // print get_class($slideProperties['slideId']).": ".$slideProperties['title']; if (!isset($slideProperties['slideId'])) { // ---- Clean the inputs ---- if (isset($slideProperties['title'])) { $title = $slideProperties['title']; } else { $title = ''; } if (isset($slideProperties['caption'])) { $caption = $slideProperties['caption']; } else { $caption = ''; } if (isset($slideProperties['text_position'])) { $textPosition = String::withValue($slideProperties['text_position']); } else { $textPosition = String::withValue(''); } if (isset($slideProperties['show_target_metadata'])) { $displayMetadata = Boolean::withValue($slideProperties['show_target_metadata']); } else { $displayMetadata = Boolean::false(); } if (isset($slideProperties['_assetId'])) { $targetId = String::withValue($slideProperties['_assetId']->getIdString()); } else { $targetId = String::withValue(''); } // ---- Create the asset ---- $slideAsset = $repository->createAsset($title, $caption, $slideAssetType); $slideAssetId = $slideAsset->getId(); $slideshowAsset->addAsset($slideAssetId); // Add it to the order field $pSlideOrder->addItem($slideAssetId); // ---- Set the additional info ---- $slideRecord = $slideAsset->createRecord($slideRecordStructId); $slideRecord->createPart($textPositionPartStructId, $textPosition); $slideRecord->createPart($displayMetadataPartStructId, $displayMetadata); $slideRecord->createPart($targetIdPartStructId, $targetId); } else { if (in_array($slideProperties['slideId']->getIdString(), $existingSlides)) { $slideAsset = $repository->getAsset($slideProperties['slideId']); $slideAsset->updateDisplayName($slideProperties['title']); $slideAsset->updateDescription($slideProperties['caption']); $textPositionIterator = $slideAsset->getPartsByPartStructure($textPositionPartStructId); if ($textPositionIterator->hasNext()) { $part = $textPositionIterator->next(); $part->updateValue(new String($slideProperties['text_position'])); } $showMetadataIterator = $slideAsset->getPartsByPartStructure($displayMetadataPartStructId); if ($showMetadataIterator->hasNext()) { $part = $showMetadataIterator->next(); $part->updateValue(new Boolean($slideProperties['show_target_metadata'])); } $pSlideOrder->addItem($slideProperties['slideId']); $records = $slideAsset->getRecordsByRecordStructure($slideRecordStructId); $slideRecord = $records->next(); } } $status->updateStatistics(); } // ==== Remove slide assets no longer in slideshow ---- foreach ($existingSlides as $older) { $old = $idManager->getId($older); if (!$pSlideOrder->isInSet($old)) { $slideshowAsset->removeAsset($old, false); $repository->deleteAsset($old); } } $status->updateStatistics(); // Log the success or failure if (Services::serviceRunning("Logging")) { $loggingManager = Services::getService("Logging"); $log = $loggingManager->getLogForWriting("Concerto"); $formatType = new Type("logging", "edu.middlebury", "AgentsAndNodes", "A format in which the acting Agent[s] and the target nodes affected are specified."); $priorityType = new Type("logging", "edu.middlebury", "Event_Notice", "Normal events."); $item = new AgentNodeEntryItem("Modify Node", "Slideshow Modified"); $item->addNodeId($slideshowAssetId); $log->appendLogWithTypes($item, $formatType, $priorityType); } return TRUE; } else { return FALSE; } }
public static function loadFromStream($filename, GenericList $classNotFoundExceptions) { if (is_null($filename)) { throw new NullPointerException('InputStream'); } $whitelistSer = new HashMap(); $whitelistDeser = new HashMap(); $typeIds = new HashMap(); $clientFields = new HashMap(); $br = new BufferedReader($filename); $line = $br->readLine(); $lineNum = 1; while (!is_null($line)) { $line = trim($line); if (mb_strlen($line) > 0) { $components = explode(',', $line); if ($components[0] === self::CLIENT_FIELDS_KEYWORD) { /* * Lines starting with '@ClientFields' list potentially serializable fields known to * client code for classes that may be enhanced with additional fields on the server. * If additional server fields are found, they will be serizalized separately from the * normal RPC process and transmitted to the client as an opaque blob of data stored * in a WeakMapping associated with the object instance. */ $binaryTypeName = trim($components[1]); try { $clazz = Classes::classOf($binaryTypeName); $fieldNames = new HashSet(); for ($i = 2; $i < count($components); $i++) { $fieldNames->add($components[$i]); } $clientFields->put($clazz, $fieldNames); } catch (ClassNotFoundException $e) { // Ignore the error, but add it to the list of errors if one was // provided. if (!is_null($classNotFoundExceptions)) { $classNotFoundExceptions->add($e); } } } else { if (count($components) != 2 && count($components) != 7) { throw new ParseException(self::FORMAT_ERROR_MESSAGE, $lineNum); } for ($i = 0; $i < count($components); $i++) { $components[$i] = trim($components[$i]); if (mb_strlen($components[$i]) == 0) { throw new ParseException(self::FORMAT_ERROR_MESSAGE, $lineNum); } } $binaryTypeName = trim($components[0]); if (count($components) == 2) { $fieldSer = $fieldDeser = true; $instantSer = $instantDeser = Boolean::valueOf($components[1]); $typeId = $binaryTypeName; } else { $idx = 1; // TODO: Validate the instantiable string better $fieldSer = Boolean::valueOf($components[$idx++]); $instantSer = Boolean::valueOf($components[$idx++]); $fieldDeser = Boolean::valueOf($components[$idx++]); $instantDeser = Boolean::valueOf($components[$idx++]); $typeId = $components[$idx++]; if (!$fieldSer && !$fieldDeser && TypeNameObfuscator::SERVICE_INTERFACE_ID != $typeId) { throw new ParseException('Type ' . $binaryTypeName . ' is neither field serializable, field deserializable ' . 'nor the service interface : ', $lineNum); } } try { $clazz = Classes::classOf($binaryTypeName); if ($fieldSer) { $whitelistSer->put($clazz, $instantSer); } if ($fieldDeser) { $whitelistDeser->put($clazz, $instantDeser); } $typeIds->put($clazz, $typeId); } catch (ClassNotFoundException $e) { // Ignore the error, but add it to the list of errors if one was // provided. if (!is_null($classNotFoundExceptions)) { $classNotFoundExceptions->add($e); } } } } $line = $br->readLine(); $lineNum++; } return new StandardSerializationPolicy($whitelistSer, $whitelistDeser, $typeIds, $clientFields); }
public static function init() { self::$CLASS_TO_VALUE_READER = new IdentityHashMap(); self::$CLASS_TO_VECTOR_READER = new IdentityHashMap(); self::$CLASS_TO_VECTOR_READER->put(ArrayType::clazz(Boolean::typeClass()), new SSSR_VectorReader_Boolean()); self::$CLASS_TO_VECTOR_READER->put(ArrayType::clazz(Byte::typeClass()), new SSSR_VectorReader_Byte()); self::$CLASS_TO_VECTOR_READER->put(ArrayType::clazz(Character::typeClass()), new SSSR_VectorReader_Char()); self::$CLASS_TO_VECTOR_READER->put(ArrayType::clazz(Double::typeClass()), new SSSR_VectorReader_Double()); self::$CLASS_TO_VECTOR_READER->put(ArrayType::clazz(Float::typeClass()), new SSSR_VectorReader_Float()); self::$CLASS_TO_VECTOR_READER->put(ArrayType::clazz(Integer::typeClass()), new SSSR_VectorReader_Int()); self::$CLASS_TO_VECTOR_READER->put(ArrayType::clazz(Long::typeClass()), new SSSR_VectorReader_Long()); self::$CLASS_TO_VECTOR_READER->put(ArrayType::clazz(Object::clazz()), new SSSR_VectorReader_Object()); self::$CLASS_TO_VECTOR_READER->put(ArrayType::clazz(Short::typeClass()), new SSSR_VectorReader_Short()); self::$CLASS_TO_VECTOR_READER->put(ArrayType::clazz(String::clazz()), new SSSR_VectorReader_String()); self::$CLASS_TO_VALUE_READER->put(Boolean::typeClass(), new SSSR_ValueReader_Boolean()); self::$CLASS_TO_VALUE_READER->put(Byte::typeClass(), new SSSR_ValueReader_Byte()); self::$CLASS_TO_VALUE_READER->put(Character::typeClass(), new SSSR_ValueReader_Char()); self::$CLASS_TO_VALUE_READER->put(Double::typeClass(), new SSSR_ValueReader_Double()); self::$CLASS_TO_VALUE_READER->put(Float::typeClass(), new SSSR_ValueReader_Float()); self::$CLASS_TO_VALUE_READER->put(Integer::typeClass(), new SSSR_ValueReader_Int()); self::$CLASS_TO_VALUE_READER->put(Long::typeClass(), new SSSR_ValueReader_Long()); self::$CLASS_TO_VALUE_READER->put(Object::clazz(), new SSSR_ValueReader_Object()); self::$CLASS_TO_VALUE_READER->put(Short::typeClass(), new SSSR_ValueReader_Short()); self::$CLASS_TO_VALUE_READER->put(String::clazz(), new SSSR_ValueReader_String()); }